Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameters - how do I pass them to XML ?????
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Parameters - how do I pass them to XML ?????
Miscellaneous
Thread ID:
00884646
Message ID:
00884646
Views:
64
Hi

I am just trying to get to grips with the basics of creating Web Servers that use SOAP and XML. I have been following the examples that come in VFP 8, but I now want to pass a few parameters to my web service - I cannot find any examples of how to do this! I am sure it must be covered somewhere, but if I have stumbled accross it without recognising it then it must very complex.

The standard example is constructed like this:

DEFINE CLASS ShowCustomers AS Session OLEPUBLIC
PROCEDURE CustomersInGermany AS String
LOCAL loXMLAdapter AS XMLAdapter
LOCAL lcXMLCustomers AS String

loXMLAdapter = CREATEOBJECT("XMLAdapter")

OPEN DATABASE "C:\Program Files\Microsoft Visual FoxPro 8\" + ; "Samples\Northwind\northwind.dbc"

USE customers
SELECT * ;
FROM customers ;
WHERE country LIKE "Germany%" ;
INTO CURSOR curCustomers

loXMLAdapter.AddTableSchema("curCustomers")
loXMLAdapter.UTF8Encoded = .T.
loXMLAdapter.ToXML("lcXMLCustomers")

CLOSE DATABASES ALL

RETURN lcXMLCustomers
ENDPROC
ENDDEFINE

But what I want to do is something like this:

DEFINE CLASS ShowCustomers AS Session OLEPUBLIC
PROCEDURE CustomersAsRequested AS String
PARAMETERS pc_customer, pc_country

Then use the parameters passed to look up specific customers in specific countries.

To call the wsdl for the web service defined above, in the microsoft example it is simply:

LOCAL lcXML, lcAlias AS String
LOCAL loXMLAdapter AS XMLAdapter

lcXML = loShowCustomers.CustomersInGermany

loXMLAdapter = CREATEOBJECT("XMLAdapter")
loXMLAdapter.LoadXML(lcXML)

lcAlias = loXMLAdapter.Tables.Item(1).Alias
loXMLAdapter.Tables.Item(1).ToCursor()

SELECT(lcAlias)
BROWSE

Now I am stumped - because if I do this:

lcXML = loShowCustomers.CustomersAsRequested("Smith", "New Zealand")

It generates a SOAP error - wrong unmber of parameters, wrong type of parameters.

How should this be done? I am really stuck here and need to get moving to deliver sonething but this is jsut frustratingly hard to find information on....

Thanks
Chris Palmer
Next
Reply
Map
View

Click here to load this message in the networking platform