oWebService = CREATEOBJECT('mssoap.soapclient') oWebService.mssoapinit('http://xxx.mycompany.com/WS/DailyDilbert/DilbertService.asmx?wsdl') ?oWebService.GetDailyDilbertUrl()It produced http://www.dilbert.com/comics/dilbert/archive/images/dilbert2002443261018.gif
>LOCAL loDilbertService AS "XML Web Service" >* LOCAL loDilbertService AS "MSSOAP.SoapClient30" >* Do not remove or alter following line. >* It is used to support IntelliSense for your XML Web service. >*__VFPWSDef__: loDilbertService = >* http://xxx.mycompany.com/WS/DailyDilbert/DilbertService.asmx?wsdl , >* DilbertService , DilbertServiceSoap > >LOCAL loException, lcErrorMsg, loWSHandler >TRY > loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx") > loDilbertService = loWSHandler.SetupClient ; >("http://xxx.mycompany.com/WS/DailyDilbert/DilbertService.asmx?wsdl", "DilbertService", "DilbertServiceSoap") > * Call your XML Web service here. ex: leResult = loDilbertService.SomeMethod() > ?loDilbertService.GetDailyDilbertUrl() >CATCH TO loException > lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message > DO CASE > CASE VARTYPE(loDilbertService)#"O" > * Handle SOAP error connecting to web service > CASE !EMPTY(loDilbertService.FaultCode) > * Handle SOAP error calling method > lcErrorMsg=lcErrorMsg+CHR(13)+loDilbertService.Detail > OTHERWISE > * Handle other error > ENDCASE > * Use for debugging purposes > MESSAGEBOX(lcErrorMsg) >FINALLY >ENDTRY >>
><?xml version="1.0" encoding="utf-8" ?> >- <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" >xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >xmlns:s="http://www.w3.org/2001/XMLSchema" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" >xmlns:tns="http://xxx.mycompany.com/ws/dailydilbert" >xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" >xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" >targetNamespace="http://xxx.mycompany.com/ws/dailydilbert" >xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> >- <wsdl:types> >- <s:schema elementFormDefault="qualified" targetNamespace="http://xxx.mycompany.com/ws/dailydilbert"> >- <s:element name="GetDailyDilbertUrl"> > <s:complexType /> > </s:element> >- <s:element name="GetDailyDilbertUrlResponse"> >- <s:complexType> >- <s:sequence> > <s:element minOccurs="0" maxOccurs="1" name="GetDailyDilbertUrlResult" type="s:string" /> > </s:sequence> > </s:complexType> > </s:element> >- <s:element name="GetDailyDilbertImage"> > <s:complexType /> > </s:element> >- <s:element name="GetDailyDilbertImageResponse"> >- <s:complexType> >- <s:sequence> > <s:element minOccurs="0" maxOccurs="1" name="GetDailyDilbertImageResult" type="s:base64Binary" /> > </s:sequence> > </s:complexType> > </s:element> > </s:schema> > </wsdl:types> >- <wsdl:message name="GetDailyDilbertUrlSoapIn"> > <wsdl:part name="parameters" element="tns:GetDailyDilbertUrl" /> > </wsdl:message> >- <wsdl:message name="GetDailyDilbertUrlSoapOut"> > <wsdl:part name="parameters" element="tns:GetDailyDilbertUrlResponse" /> > </wsdl:message> >- <wsdl:message name="GetDailyDilbertImageSoapIn"> > <wsdl:part name="parameters" element="tns:GetDailyDilbertImage" /> > </wsdl:message> >- <wsdl:message name="GetDailyDilbertImageSoapOut"> > <wsdl:part name="parameters" element="tns:GetDailyDilbertImageResponse" /> > </wsdl:message> >- <wsdl:portType name="DilbertServiceSoap"> >- <wsdl:operation name="GetDailyDilbertUrl"> > <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Retrieve the URL for the daily Dilbert image</documentation> > <wsdl:input message="tns:GetDailyDilbertUrlSoapIn" /> > <wsdl:output message="tns:GetDailyDilbertUrlSoapOut" /> > </wsdl:operation> >- <wsdl:operation name="GetDailyDilbertImage"> > <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Retrieve a byte array containing the daily Dilbert image</documentation> > <wsdl:input message="tns:GetDailyDilbertImageSoapIn" /> > <wsdl:output message="tns:GetDailyDilbertImageSoapOut" /> > </wsdl:operation> > </wsdl:portType> >- <wsdl:binding name="DilbertServiceSoap" type="tns:DilbertServiceSoap"> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> >- <wsdl:operation name="GetDailyDilbertUrl"> > <soap:operation soapAction="http://xxx.mycompany.com/ws/dailydilbert/GetDailyDilbertUrl" style="document" /> >- <wsdl:input> > <soap:body use="literal" /> > </wsdl:input> >- <wsdl:output> > <soap:body use="literal" /> > </wsdl:output> > </wsdl:operation> >- <wsdl:operation name="GetDailyDilbertImage"> > <soap:operation soapAction="http://xxx.mycompany.com/ws/dailydilbert/GetDailyDilbertImage" style="document" /> >- <wsdl:input> > <soap:body use="literal" /> > </wsdl:input> >- <wsdl:output> > <soap:body use="literal" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> >- <wsdl:service name="DilbertService"> > <documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Provides methods to access the daily Dilbert image</documentation> >- <wsdl:port name="DilbertServiceSoap" binding="tns:DilbertServiceSoap"> > <soap:address location="http://xxx.mycompany.com/WS/DailyDilbert/DilbertService.asmx" /> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> >>