Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SOAP appears to lose carriage return codes...
Message
 
 
To
21/06/2002 12:00:08
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00671055
Message ID:
00671069
Views:
15
My apologies for not including source. Both examples are VFP code. Here is the client side:
LOCAL obj as csrserver web service
LOCAL loWS
loWS = NEWOBJECT("Wsclient",HOME()+"ffc\_webservices.vcx")
loWS.cWSName = "csrserver web service"
obj = loWS.SetupClient("http://xxxxxxxxx/CSRServer/csrserver.WSDL", "csrserver", "csrserverSoapPort")

*o_obj = newobject('csrserver', 'main.fxp')
SET STEP ON 

r=FOPEN("setup.ini",0)

l_text = FREAD(r,128)

abc = obj.sendtocsr("Steve","Stevetest.txt","N",l_text)

WAIT WINDOW abc

=FCLOSE(r)
And the Web Service contains this:
DEFINE CLASS csrserver as session olepublic
	FUNCTION  sendtocsr(l_login as string, l_filename as character, l_status as Character , ;
		l_text as string) as string

		LOCAL l_return as Character
		LOCAL l_len as Integer

		*Let's put everything in a consistent place...
		LOCAL l_directory as Character 
		l_directory = "c:\csr\import\"

		LOCAL l_newfile as Character 
		l_newfile = l_directory + ALLTRIM(l_filename)						

		*RETURN l_newfile
		DO case
		CASE l_status = "N"	&&New Transmission....
			a=FCREATE(l_newfile)
			l_len = FWRITE(a,l_text)
		OTHERWISE
			a=FOPEN(l_newfile,12)
			l_len =FSEEK(a,0,2)
			l_sub=FWRITE(a,l_text)
			l_len = l_len + l_sub
			
		ENDCASE
		
		=FCLOSE(a)
				
		l_return = "Written " + ALLTRIM(STR(l_len)) + " bytes to server..."
		
		RETURN l_return

	endfunc	
The file I'm using is a simple text file with about 10 lines of text, none more than about 50 characters wide.

Hope this helps - thanks for such a quick response!
Steve Howie, owner
DaSH Technology
Denver, CO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform