Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing a wsdl service from within vfp
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01380582
Message ID:
01381036
Views:
57
>The cSearchResult is a string and can be parsed either as a regular string or as XML data using the DOM XML
>
>obj = CreateObject("Microsoft.XMLDOM")
>obj.LoadXML(cSearchResult)
>
Totally confused here.... starting from the top

I have a web service that returns an xml object when called from visual foxpro form. My code in a button's click event
is as follows. The file I generate from xmltocursor isn't working properly as I described earlier. I don't know enough about wsdl or dom to ask the correct questions but when I strip out elements above the DirectoryRecord element xmltocursor works properly.


local loCdyne411 as "XML Web Service"
local oXA as XMLAdapter


* LOCAL loCdyne411 AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loCdyne411 = http://ws.cdyne.com/cdyne411ws/cdyne411.asmx?wsdl , Cdyne411 , Cdyne411Soap

LOCAL loException, lcErrorMsg, loWSHandler, loXML

TRY

loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
loCdyne411 = loWSHandler.SetupClient("http://ws.cdyne.com/cdyne411ws/cdyne411.asmx?wsdl", "Cdyne411", "Cdyne411Soap")

* Call your XML Web service here. ex: leResult = loCdyne411.SomeMethod()

loResult = loCdyne411.ReversePhone("6339999","905","Ontario","serialno")

loXML = loResult.item(0).parentNode.XML

=xmltocursor(obj,"cdyne411",4)

browse


CATCH TO loException
lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
DO CASE
CASE VARTYPE(loCdyne411)#"O"
* Handle SOAP error connecting to web service
CASE !EMPTY(loCdyne411.FaultCode)
* Handle SOAP error calling method
lcErrorMsg=lcErrorMsg+CHR(13)+loCdyne411.Detail
OTHERWISE
* Handle other error
ENDCASE
* Use for debugging purposes
MESSAGEBOX(lcErrorMsg)
FINALLY

ENDTRY
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform