Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Web Services with VFP 9 SP2

72 views
Skip to first unread message

PoG

unread,
Oct 12, 2009, 11:49:40 AM10/12/09
to
Hi all.

I'm a real newbie to XML and Web services, but I have an application where
I'm bound to communicate via Web Services.
I feel quite lost on this, and need someone to point me in the right
direction on what tools and functions to use.
The web service I'm connecting to is quite well documented, and uses nuSOAP
Php.
I can register the Web Service in VFP Taskpane and see all functions
available, but the auto-generated code doesn't give any results. I'm using
"Charles web debugging proxy", and discovered that my requests didn't give
any responds.
Therefore, I downloaded West Winds Service Proxy Generator, and with this
tool I can get valid responses.
Now, using (in short):
loBridge = CREATEOBJECT("wwdotnetbridge") (That is the West Wind Web Service
interface)
loService = CREATEOBJECT("MyWDSLProxy") (That is the proxy generated by WW
proxy generator)
I can call functions like: loResult = loService.wsdlGetCustomer(apiKey)

The returned object is an array, that can be anything from one set of XML
data that I'd like to read into a cursor/table, to multiple XML documents
that I believe should be able to read into a MSXML DomDocument or an
XMLAdapter.

Having experimented with one of the simpliest functions returning a single
XML document, I can see with "Charles" that i get an XML document. However,
If I try to use functions like "oXMLAdapter.LoadXml(loResult,.F.,.F.)" I get
the error "Function argument, type or count is invalid".

If I copy the XML result from "Charles" into a file and tries to read the
file with "oXMLAdapter.LoadXml(loResult,.T.,.F.)" I get:
XML Error: XML Parse error: Type
'{http://schemas.xmlsoap.org/soap/encoding/}Array is not found in schema.
Line 4, Position 75. <return xsi:type="SOAP-ENC:Array" SOAP-ENC:array
type="tns:Customer[1]">

I have played around with all kinds of methods and functions, LoadXml,
Attach, DomDocuments and XMLAdapters, but I just can't get started
somewhere.
Can anyone PLEASE point me in some direction here. Should I use a
Domdocument? XMLAdapter? Am I missing something essential?

Thanks in advance!

PoG


tg

unread,
Oct 13, 2009, 6:26:27 AM10/13/09
to
PoG schrieb:

> The web service I'm connecting to is quite well documented, and uses nuSOAP
> Php.
> I can register the Web Service in VFP Taskpane and see all functions
> available, but the auto-generated code doesn't give any results. I'm using
> "Charles web debugging proxy", and discovered that my requests didn't give
> any responds.
> Therefore, I downloaded West Winds Service Proxy Generator, and with this
> tool I can get valid responses.
The fox Soap Kit has been deprecated for a looong time now, newer WS
added technology for security and logging mostly using complex XML types
or hidden cookies in the SOAP header which the fox toolkit doesn not
know. You can reinvent such things in fox using fox SOAP COM objects,
but this would be a) a waste of time since .Net or java can do this for
you if you host them (as you correctly did).

>
> The returned object is an array, that can be anything from one set of XML
> data that I'd like to read into a cursor/table, to multiple XML documents
> that I believe should be able to read into a MSXML DomDocument or an
> XMLAdapter.

No magic bullet here. You can get better support for XML in DotNet and
Java, but this is a case where I don't feel comfortable relying on
automatic imports. Too much that can go wrong without you getting any
kind of hint...

My solution is/was creating an importing fwk built on configuarble
objects. Each document is analyzed and hopefully read by settign some
properties - sometimes a new parsing object/method needs to be
implemented. YMMV - but I feel much safer if I get reports of data read
I can compare to a manifest, return to the originator for validation or
compare to the XML-Stream.

my 0.01 EUR - less than usual... ;-)

PoG

unread,
Oct 15, 2009, 7:03:11 AM10/15/09
to
tg,

Thanks for your input. I've managed to get some progress with the West Wind
tool (together with .NET 3.5) and some support from there. Still, this is
all new to me and a lot to get familiar with.
I have managed to get the data out from the object (allthough in what I
believe a rather unorthodox way), the challenge now is to update the WSDL
with data from my end.

/PoG

"tg"
<tganss_at_t_dash_online_dot_de-...@yahoo.com>
skrev i meddelandet news:hb1kmg$i99$02$1...@news.t-online.com...

0 new messages