Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do i get the data
Message
De
05/06/2004 14:06:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Titre:
How do i get the data
Divers
Thread ID:
00910376
Message ID:
00910376
Vues:
68
Hello everybody.

i am plying around with vfp9 xml/webservice (i think that was already in vfp8, but i don't have 8).

with the code below, i was able to connect, execute, and retrive from a web service. but i can not get it in a format i can use. i've tried to use XMLTOCURSOR(), but i do not know how to apply it.
CLEAR

LOCAL loUSZip AS "XML Web Service"
* LOCAL loUSZip AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: loUSZip = http://www.webservicex.net/uszip.asmx?WSDL , USZip , USZipSoap
LOCAL loException, lcErrorMsg, loWSHandler

TRY

	loWSHandler = NEWOBJECT("WSHandler", IIF(VERSION(2)=0, "", HOME()+"FFC\")+"_ws3client.vcx")
	loUSZip = loWSHandler.SetupClient("http://www.webservicex.net/uszip.asmx?WSDL", "USZip", "USZipSoap")
	* Call your XML Web service here.  ex: leResult = loUSZip.SomeMethod()
	leResult = loUSZip.GetInfoByZIP("79936") && AS XMLDOMNodeList

	?leResult.ITEM(0).XML
	?leResult.ITEM(0).TEXT
	?leResult.ITEM(0).parsed
	*XMLTOCURSOR(leResult, "c:\devfox9\test.dbf")

CATCH TO loException
	lcErrorMsg="Error: "+TRANSFORM(loException.ERRORNO)+" - "+loException.MESSAGE
	DO CASE
		CASE VARTYPE(loUSZip)#"O"
			* Handle SOAP error connecting to web service
		CASE !EMPTY(loUSZip.FaultCode)
			* Handle SOAP error calling method
			lcErrorMsg=lcErrorMsg+CHR(13)+loUSZip.DETAIL
		OTHERWISE
			* Handle other error
	ENDCASE
	* Use for debugging purposes
	MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY
as always, i appreaciate you help.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform