LOCAL loPrime2006WS AS "XML Web Service" * LOCAL loPrime2006WS AS "MSSOAP.SoapClient30" * Do not remove or alter following line. It is used to support IntelliSense for your XML Web service. *__VFPWSDef__: loPrime2006WS = http://ourserver/oursite/Service.asmx?WSDL , Prime2006WS , Prime2006WSSoap LOCAL loException, lcErrorMsg, loWSHandler TRY loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx") loPrime2006WS = loWSHandler.SetupClient("http://oursever/oursite.financesrvc/Service.asmx?WSDL", "Prime2006WS", "Prime2006WSSoap") * Call your XML Web service here. ex: leResult = loPrime2006WS.SomeMethod() cxml = FILETOSTR("C:\cxml.txt") clogin = 'loginname' && <---Actual login substituted for this of course cpass = 'password' && <---Actual password substituted for this of course loPrime = loPrime2006WS.CalcFinancing(clogin,cpass,cxml) *^^^^ Error occurs in line above IF TYPE('loPrime') = "O" .and. !ISNULL(loPrime) =AMEMBERS(gaprops,loPrime,1) && <-------- Problem here ********** loprime is an object, not null here but no props ********** gaprops does not exist here set STEP on ENDIF cresult = loPrime.document && this property should exist but it does not IF !EMPTY(cresult) =MESSAGEBOX(cresult) ELSE =MESSAGEBOX('No results were returned.') ENDIF RELEASE loPrime2006WS RELEASE loWSHandler CATCH TO loException lcErrorMsg="Error: "+TRANSFORM(loException.ERRORNO)+" - "+loException.MESSAGE DO CASE CASE VARTYPE(loPrime2006WS)#"O" * Handle SOAP error connecting to web service CASE !EMPTY(loPrime2006WS.FaultCode) * Handle SOAP error calling method lcErrorMsg=lcErrorMsg+CHR(13)+loPrime2006WS.DETAIL OTHERWISE * Handle other error ENDCASE * Use for debugging purposes MESSAGEBOX(lcErrorMsg) FINALLY ENDTRYHere is the webservice service description:
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?> - <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="www.oursite.net/FinanceSrvc" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="www.oursite.net/FinanceSrvc" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Our Web Services</wsdl:documentation> - <wsdl:types> - <s:schema elementFormDefault="qualified" targetNamespace="www.oursiteonline.net/FinanceSrvc"> - <s:element name="CalcFinancing"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="LoginID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="LoginPassword" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="aDoc" type="s:string" /> </s:sequence> </s:complexType> </s:element> - <s:element name="CalcFinancingResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="CalcFinancingResult" type="tns:TSrvcResponse" /> </s:sequence> </s:complexType> </s:element> - <s:complexType name="TSrvcResponse"> - <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="Status" type="tns:TResponseStatus" /> <s:element minOccurs="0" maxOccurs="1" name="Document" type="s:string" /> </s:sequence> </s:complexType> - <s:simpleType name="TResponseStatus"> - <s:restriction base="s:string"> <s:enumeration value="sOK" /> <s:enumeration value="sBusy" /> <s:enumeration value="sFailed" /> <s:enumeration value="sLoginFailed" /> </s:restriction> </s:simpleType>