LOCAL oFSHttp AS "MSSOAP.SoapClient30" * Do not remove or alter following line. It is used to support IntelliSense for your XML Web service. *__VFPWSDef__: loImdsWS = c:\lcsweb\imds.wsdl , ImdsService , ImdsWS LOCAL loException, lcErrorMsg, loWSHandler, lcHeader, lcResult lcHeader = '' lcHeader = SPACE(4096) TRY oFSHttp = NEWOBJECT("MSSOAP.SoapClient30") oFSHttp.MSSoapInit("file://c:\lcsweb\wsdl\FSHttpService.wsdl") oFSHttp.ConnectorProperty("ConnectTimeout") = 300000 oFSHttp.ConnectorProperty("EndPointURL")="https://phony.web.address/fsWebService/servlet/rpcrouter" oFSHttp.ConnectorProperty("RequestHTTPHeader") = "Cookie:" + uWebCookie oFSHttp.ConnectorProperty("ProxyServer")="<CURRENT_USER>" * Call your XML Web service here. ex: leResult = loImdsWS.SomeMethod() lcResult = oFSHttp.FSLogon(thisform.username, thisform.password, thisform.account, ; thisform.projectid, thisform.terminalid) lcHeader = oFSHttp.ConnectorProperty("ResponseHTTPHeader") CATCH TO loException lcHeader = oFSHttp.ConnectorProperty("ResponseHTTPHeader") MESSAGEBOX(lcHeader) lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message DO CASE CASE VARTYPE(oFSHttp)#"O" * Handle SOAP error connecting to web service CASE !EMPTY(oFSHttp.FaultCode) * Handle SOAP error calling method lcErrorMsg=lcErrorMsg+CHR(13)+oFSHttp.Detail OTHERWISE * Handle other error ENDCASE * Use for debugging purposes MESSAGEBOX(lcErrorMsg) SET STEP ON FINALLY ENDTRYWSDL:
<?xml version="1.0" encoding="UTF-8"?> <definitions name="FSHttp" targetNamespace="http://http.fs.ssg.af.mil.wsdl/FSHttp/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://http.fs.ssg.af.mil.wsdl/FSHttp/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <message name="FSLogonRequest"> <part name="UserName" type="xsd:string"/> <part name="Password" type="xsd:string"/> <part name="AccountNumber" type="xsd:string"/> <part name="ProjectId" type="xsd:string"/> <part name="TerminalId" type="xsd:string"/> </message> <message name="FSLogonResponse"> <part name="result" type="xsd:string"/> </message> <message name="FSPutRequest1"> <part name="sData" type="xsd:string"/> </message> <message name="FSPutResponse1"> <part name="result" type="xsd:string"/> </message> <message name="FSLogoffRequest"/> <message name="FSLogoffResponse"> <part name="result" type="xsd:string"/> </message> <portType name="FSHttp"> <operation name="FSLogon" parameterOrder="UserName Password AccountNumber ProjectId TerminalId"> <input message="tns:FSLogonRequest" name="FSLogonRequest"/> <output message="tns:FSLogonResponse" name="FSLogonResponse"/> </operation> <operation name="FSPut" parameterOrder="sData"> <input message="tns:FSPutRequest1" name="FSPutRequest1"/> <output message="tns:FSPutResponse1" name="FSPutResponse1"/> </operation> <operation name="FSLogoff"> <input message="tns:FSLogoffRequest" name="FSLogoffRequest"/> <output message="tns:FSLogoffResponse" name="FSLogoffResponse"/> </operation> </portType> </definitions> <?xml version="1.0" encoding="UTF-8"?> <definitions name="FSHttpBinding" targetNamespace="http://http.fs.ssg.af.mil.wsdl/FSHttpBinding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:interface="http://http.fs.ssg.af.mil.wsdl/FSHttp/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://http.fs.ssg.af.mil.wsdl/FSHttpBinding/"> <import location="FSHttp.wsdl" namespace="http://http.fs.ssg.af.mil.wsdl/FSHttp/"/> <binding name="FSHttpBinding" type="interface:FSHttp"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="FSLogon"> <soap:operation soapAction="" style="rpc"/> <input name="FSLogonRequest"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" parts="UserName Password AccountNumber ProjectId TerminalId" use="encoded"/> </input> <output name="FSLogonResponse"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" use="encoded"/> </output> </operation> <operation name="FSPut"> <soap:operation soapAction="" style="rpc"/> <input name="FSPutRequest1"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" parts="sData" use="encoded"/> </input> <output name="FSPutResponse1"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" use="encoded"/> </output> </operation> <operation name="FSLogoff"> <soap:operation soapAction="" style="rpc"/> <input name="FSLogoffRequest"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" use="encoded"/> </input> <output name="FSLogoffResponse"> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://tempuri.org/mil.af.ssg.fs.http.FSHttp" use="encoded"/> </output> </operation> </binding> </definitions> <?xml version="1.0" encoding="UTF-8"?> <definitions name="FSHttpService" targetNamespace="http://http.fs.ssg.af.mil.wsdl/FSHttpService/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:binding="http://http.fs.ssg.af.mil.wsdl/FSHttpBinding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://http.fs.ssg.af.mil.wsdl/FSHttpService/"> <import location="FSHttpBinding.wsdl" namespace="http://http.fs.ssg.af.mil.wsdl/FSHttpBinding/"/> <service name="FSHttpService"> <port binding="binding:FSHttpBinding" name="FSHttpPort"> <soap:address location="http://localhost:9080/fsWebService/servlet/rpcrouter"/> </port> </service> </definitions>