Archived Forum Post

Index of archived forum posts

Question:

calling a webservice method.

May 18 '16 at 14:49

Hello.

I have to call a function on a webservice with the following syntax:

Delivery(Username As String, Name As String, AccessID as string, XMLFile As String) As String

The webservice address is something like:

http://www.website.com/delivdev/delivery.asmx?wsdl

The XMLfile is in Utf-8 and contains several items to be exported, according to an XSD file that validates the XML file I create.

How can I do this using Chilkat activeX ( for example in FoxPro )?

Thanks,

Carlos


Answer

Hi Carlos,

You could start following a SOAP 1.1 example at "https://www.example-code.com/foxpro/soap_web_service.asp"

In the xml file in this example you should fill with variables and data following the rules dictacted by wsdl page. In general in these pages the developer has an example using SOAP, REST and xml accessing in your example "http://www.webiste.com/delivdev/delivery.asmx?delivery" where delivery is the name of the method used in your example. This page in general has examples that the developer expect to get correct results. If does not have this documentation you should contact developer/owner to send you an example.

Xml file has to follow construction rules accordingly to protocol SOAP, REST or Xml. In this example you should replace "GetUKLocationByPostCode" by a function and parameters like "PostCode" by your parameters something like:

<username>paul1</username> <name>Paul</name> <accessid>1</accessid> <xmlfile>path</xmlfile>

There's another example using xml webservice in "https://www.example-code.com/foxpro/http_postUrlEncoded.asp" where we're using xml. Use AddParam to set you data.

Your example seems to have some kind of login/authentication first using Username, Name and ID. Check to see if you have a method "login" for example or this is all integrated in one call.

Hope this help you as starting point.

Marcos


Answer

Here is an example:

https://www.example-code.com/foxpro/soap_web_service.asp

Andy