ZSI Examples
Revision as of 16:11, 19 February 2008 by PeterHarding (talk | contribs)
Some Python ZSI Examples
CDPBilling
SaintBook
$ cat wsdl.sh #!/bin/sh wget http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL
from ZSI.wstools import WSDLTools ... location = 'http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL' load = reader.loadFromURL wsdl = load(location) ...
Not sure works for me -josh $ mkdir TMP $ cd TMP/ $ wsdl2py http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL $ ls Maxim_client.py Maxim_server.py Maxim_types.py $ python Python 2.5.1 (r251:54863, May 23 2007, 10:06:54) [GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from ZSI.wstools import WSDLTools >>> location = 'http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL' >>> w = reader.loadFromURL(location) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'reader' is not defined >>> reader = WSDLTools.WSDLReader() >>> w = reader.loadFromURL(location) >>> w <ZSI.wstools.WSDLTools.WSDL instance at 0xca080> On Jan 31, 2008, at 7:49 AM, Lorena Carlo wrote: > Hi, > > I don't know if this is a ZSI bug, but for some reason I can not load > the following webservice: > > http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL > > This is the portion of code: > > from ZSI.wstools import WSDLTools > location = 'http://saintbook.org/MightyMaxims/MightyMaxims.asmx?WSDL' > load = reader.loadFromURL > wsdl = load(location) > > This is the exception I get: > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File > "c:\Python24\lib\site-packages\zsi-2.1_a1-py2.4.egg\ZSI\wstools > \WSDLTools > .py", line 39, in loadFromURL > File > "c:\Python24\lib\site-packages\zsi-2.1_a1-py2.4.egg\ZSI\wstools > \Utility.p > y", line 642, in loadFromURL > File > "c:\Python24\lib\site-packages\zsi-2.1_a1-py2.4.egg\ZSI\wstools > \Utility.p > y", line 203, in urlopen > File > "c:\Python24\lib\site-packages\zsi-2.1_a1-py2.4.egg\ZSI\wstools > \Utility.p > y", line 153, in urlopen > File "c:\Python24\lib\urllib.py", line 82, in urlopen > return opener.open(url) > File "c:\Python24\lib\urllib.py", line 190, in open > return getattr(self, name)(url) > File "c:\Python24\lib\urllib.py", line 426, in open_file > return self.open_local_file(url) > File "c:\Python24\lib\urllib.py", line 440, in open_local_file > raise IOError(e.errno, e.strerror, e.filename) > IOError: [Errno 2] No such file or directory: > '\\MightyMaxims\\MightyMaxims.asmx > ?WSDL?65784000' > > Any help will be appreciated, thanks! > > Lorena