Note: This requires VFP7.0 minimum and SOAP tool kit version 2.0 minimum. "http://www.microsoft.com/downloads/details.aspx?FamilyId=147ED727-0BE8-48A1-B1DA-D50B1EA582CB&displaylang=en"
In order to consume a Web service, you first need an actual web service. This following example assumes you have a web service. (This FAQ is based on a web service in Visual Studio .NET and it works like a DLL where there is no interface). All it does it takes two paramaters, one being a postal code (like a zip code in the US) and the second paramter is a delimeter, in order to be able to parse the answer. In Canada we have a web site run by the Federal government, that if you type-in the postal code, it will return the range of possible addresses, the street name, the city, province. We use this as a validation for our customer service agent to "verify the customer's authenticity". So we wrote a webservice that "sends" postal codes to this site and retrieves the requested information.
Once you have the path as to where the asmx file and the wsdl file (the actual web service files themselves), (the path has to be on a web server, not a regular server)you need to register it with VFP, in order to use it in an application. To register a web service, you go to tools->Intellisense Manager->Type->Webservices. The prompt will ask you for two values (ie. the name of the service, as in the code below the name is pcode2address, the actual web URL address, as in below "http://intranet/stgwebservices/pcode2address.asmx?wsdl", that points to the asmx and wsdl files.
Once register, now you can used (in a similar fashion as a class or a DLL). But once registered Intellisense will actually produce the code for you to use to call the webservice. All you need to do is either create a program, or a function and type : LOCAL ow as After you hit the space bar after the 'as' intellisense kicks-in and show you the "class and services available". You select your services and VFP produces the rest of the code, like magic: