******************************************************** * SidesHdImport - Import SIDE_HD items * Parameters: xmlSidesHd - XML data for sides header ******************************************************** FUNCTION SidesHdImport (xmlSidesHd as String) SELECT 0 XMLTOCURSOR(xmlSidesHd, "xmlimport") SELECT xmlimport GO top SCAN SELECT sides_hd LOCATE FOR list_name = xmlimport.list_name IF FOUND() replace disp_name WITH xmlimport.disp_name ENDIF ENDSCAN ENDFUNCClient Code (mostly from the XML test code):
LOCAL lorestserv AS "XML Web Service" * LOCAL lorestserv AS "MSSOAP.SoapClient30" * Do not remove or alter following line. It is used to support IntelliSense for your XML Web service. *__VFPWSDef__: lorestserv = http://little-p/wsrest/restserv.wsdl , restserv , restservSoapPort LOCAL loException, lcErrorMsg, loWSHandler TRY loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx") lorestserv = loWSHandler.SetupClient("http://little-p/wsrest/restserv.wsdl", "restserv", "restservSoapPort") * Call your XML Web service here. ex: leResult = lorestserv.SomeMethod() SELECT sides_hd CURSORTOXML("sides_hd","xmlSidesHd") loRestServ.SidesHdImport(xmlSidesHd) CATCH TO loException lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message DO CASE CASE VARTYPE(lorestserv)#"O" * Handle SOAP error connecting to web service CASE !EMPTY(lorestserv.FaultCode) * Handle SOAP error calling method lcErrorMsg=lcErrorMsg+CHR(13)+lorestserv.Detail OTHERWISE * Handle other error ENDCASE * Use for debugging purposes MESSAGEBOX(lcErrorMsg) FINALLY ENDTRYOther methods of the same COM object are working, however I have only tried simple functions with simple return types. I suspect I need to do something different with my XML creation and parsing, but I am new to XML and am not sure what to do.