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 ENDTRYThis 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,