Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a wsdl service from within vfp
Message
De
11/02/2009 16:40:58
 
 
À
11/02/2009 15:19:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01380582
Message ID:
01381059
Vues:
51
>>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


Got it working.....


The xml doc has an items element that's 3rd child under the root. Change the following line and all is well.

loXML = loResult.item(2).XML

Now xmltocursor loads properly.....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform