Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run WEB services - how to?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Titre:
Run WEB services - how to?
Divers
Thread ID:
01002698
Message ID:
01002698
Vues:
122
Hi,
I have no experience using web services.
I went through WS registration, but got stocked using it. I don't know how to initialize the object and call the methods.
Bellow is a Foxpro code example from task pane manager:

///////////////////////////////////////////////////////////////
doSingleRecord(Request AS RequestRecord) AS XMLDOMNodeList

Sample Code:
LOCAL lomdWebServices AS "XML Web Service"
* LOCAL lomdWebServices AS "MSSOAP.SoapClient30"
* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
*__VFPWSDef__: lomdWebServices = https://ws.melissadata.com/dqws/address.asmx?wsdl , mdWebServices , mdWebServicesSoap
LOCAL loException, lcErrorMsg, loWSHandler
TRY
loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
lomdWebServices = loWSHandler.SetupClient("https://ws.melissadata.com/dqws/address.asmx?wsdl", "mdWebServices", "mdWebServicesSoap")
* Call your XML Web service here. ex: leResult = lomdWebServices.SomeMethod()

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

What do I do with the code:
doSingleRecord(Request AS RequestRecord) AS XMLDOMNodeList

lomdWebServices object doesn't have properties and method that I expected to call.

The WS supplier has a VB.NET sample that works fine and looks like this:

/////////////////////////////////////////////////
Dim Action As New mdWebService.mdWebServices
Dim Request As New mdWebService.RequestRecord
Dim Response As New mdWebService.ResponseRecord
...
Response = Action.doSingleRecord(Request)
//////////////////////////////////////////////////

Do you have any sugesstions how to Dim it in FoxPro?

Thank you
Galina
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform