[Tutor] Re: SOAP

dominic.fox dominic.fox" <dominic.fox@ntlworld.com
Fri, 5 Jul 2002 22:41:28 +0100


Thanks to Danny and Charlie for hints & pointers on this.

xmlrpclib has slightly spoiled me for SOAP, because it's very "Pythonic" as
Dr Grisby says, and simple, and intuitive. ZSI SOAP is not any of these
things, although that's probably not its fault. The key to the magic kingdom
is guarded by a slightly fearsome-looking troll, beneath whose glowering
visage I'm currently trembling somewhat.

developerWorks is definitely the people's friend, as I've found a couple of
times before. I had a simple problem using the ZSI tutorial, however: one of
the namespaces specified by ZSI SOAP refers to a schema hosted at zolera.
com, which is currently unavailable. You therefore get an error when you try
to run the tutorial example. If all ZSI SOAP calls need zolera.com to be up
and running in order to work, then any SOAP system built on top of ZSI is
going to have an extra vulnerability; it will also not work if you want to
run it across an intranet without external internet access (which is one of
my potential deployment targets). Presumably it's possible to make a local
copy of the schema, and refer to that instead. The tutorial doesn't say how,
though; and I can't make a local copy if I can't access the remote one
because the server that hosts it is vacationing in Elbonia. I also don't
know whether the schema in question needs to be accessible by both parties
to the SOAP transaction: if it does, then there's no point in my keeping a
copy on my desktop machine's hard-disk...

pyGoogle uses SOAP.py, which is less sophisticated than ZSI but also less
newbie-frighteningly feature-intensive. I downloaded and installed SOAP.py,
and had another go. Captain Haddock was venting his spleen at me
("slubberdegullions!") within a few minutes, which was encouraging. Here's
what I tried next, and what happened:

>>> google = SOAP.SOAPProxy(
 "http://api.google.com/search/beta2",
 namespace="urn:GoogleSearch")

>>> google.doGoogleSearch(key=myLicenceKey,
       q="Python SOAP",
       start=0,
       maxResults=10,
       filter=1,
       restrict='',
       safeSearch=0,
       lr='',
       ie='latin1',
       oe='latin1')
Traceback (most recent call last):
  File "<pyshell#22>", line 10, in ?
    oe='latin1')
  File "C:\Python22\SOAPpy097\SOAP.py", line 3603, in __r_call
    self.__hd, self.__ma)
  File "C:\Python22\SOAPpy097\SOAP.py", line 3532, in __call
    raise p
faultType: <Fault SOAP-ENV:Client: No Deserializer found to deserialize a
'http://www.w3.org/1999/XMLSchema:str' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.>

So I went and got pyGoogle, built and installed, and ran the following:

>>> import google
>>> google.LICENSE_KEY = myLicenceKey
>>> google.doGoogleSearch("Python SOAP")

and got the exact same error message. Here I am stuck!

Dominic

--> Nobody knows the trouble you've seen / walking from your desk to the
staff canteen <--
homepage: http://www.geocities.com/domfox