Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error when sending to a webservice
Message
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00996134
Message ID:
00997615
Views:
22
Hi,

>>I've tried all combinations I can think of... with no luck.

Had time for a quick play with this. The following VFP generated code seems to work OK:
LOCAL loPatientDataIFPort AS "XML Web Service"
* LOCAL loPatientDataIFPort AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loPatientDataIFPort = http://nybf01-al-n002.buffalo.gd-ais.com:8080/lifetrac/insert?WSDL , PatientDataService , PatientDataIFPort
SET STEP ON
LOCAL loException, lcErrorMsg, loWSHandler
TRY
	loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
	loPatientDataIFPort = loWSHandler.SetupClient("http://nybf01-al-n002.buffalo.gd-ais.com:8080/lifetrac/insert?WSDL", "PatientDataService", "PatientDataIFPort")
    xx = loPatientDataIFPort.OP_ReceiveLifetracData("fred","password", "<test>line</test>")
	
CATCH TO loException
	lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
	DO CASE
	CASE VARTYPE(loPatientDataIFPort)#"O"
		* Handle SOAP error connecting to web service
	CASE !EMPTY(loPatientDataIFPort.FaultCode)
		* Handle SOAP error calling method
		lcErrorMsg=lcErrorMsg+CHR(13)+loPatientDataIFPort.Detail
	OTHERWISE
		* Handle other error
	ENDCASE
	* Use for debugging purposes
	MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY
This generated the following SOAP message:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<OP_ReceiveLifetracData xmlns="urn:Foo">
<username xmlns:SOAPSDK4="urn:Foo">fred</username> 
<password xmlns:SOAPSDK5="urn:Foo">password</password> 
<lifetracXMLString xmlns:SOAPSDK6="urn:Foo><test>line</test></lifetracXMLString> 
</OP_ReceiveLifetracData>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
FWIW the equivalent .NET message was:
<?xml version="1.0" encoding="utf-8" ?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<OP_ReceiveLifetracData xmlns="urn:Foo">
<username>gd</username> 
<password>gd</password> 
<lifetracXMLString>exact XML String from your sample message</lifetracXMLString> 
</OP_ReceiveLifetracData>
</soap:Body>
</soap:Envelope>
I'm surprised that MSSOAP handled the data type correctly - but it worked. No SOAP error - just a 'Unknown user' response. HTH,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform