By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,186 Members | 1,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,186 IT Pros & Developers. It's quick & easy.

SOAPPy helloworld-ish problem

P: 2
Hello

I'm trying to make a web service client in python, and so to start out, I found this simple example that are supposed to parse an wsdl file using SOAPPy. I'm using Windows and got SOAPPy installed using the Enthought Python Distribution. I've tried several wsdl files and commenting out parts of the code etc. but I just can't twist my head around what's the problem here. Any help would be greatly appreciated.

soappyTest.py:
Expand|Select|Wrap|Line Numbers
  1. from SOAPpy import WSDL
  2.  
  3. url = 'GoogleSearch.wsdl' # from http://api.google.com/GoogleSearch.wsdl
  4.  
  5. # just use the path to the wsdl of your choice
  6. wsdlObject = WSDL.Proxy(url + '?WSDL')
  7.  
  8. print 'Available methods:'
  9. for method in wsdlObject.methods.keys() :
  10.   print method
  11.   ci = wsdlObject.methods[method]
  12.   # you can also use ci.inparams
  13.   for param in ci.outparams :
  14.     # list of the function and type 
  15.     # depending of the wsdl...
  16.     print param.name.ljust(20) , param.type
  17.   print
  18.  
output at command prompt / terminal:
Expand|Select|Wrap|Line Numbers
  1. Traceback (most recent call last):
  2.   File "C:\jostein\matlab_med_webservice\soappyTest.py", line 6, in <module>
  3.     wsdlObject = WSDL.Proxy(url + '?WSDL')
  4.   File "C:\Python25\lib\site-packages\soappy-0.11.6.0001-py2.5-win32.egg\SOAPpy\WSDL.py", line 67, in __init__
  5.     self.wsdl = reader.loadFromString(str(wsdlsource))
  6.   File "C:\Python25\lib\site-packages\soappy-0.11.6.0001-py2.5-win32.egg\SOAPpy\wstools\WSDLTools.py", line 47, in loadFromString
  7.     return self.loadFromStream(StringIO(data))
  8.   File "C:\Python25\lib\site-packages\soappy-0.11.6.0001-py2.5-win32.egg\SOAPpy\wstools\WSDLTools.py", line 28, in loadFromStream
  9.     document = DOM.loadDocument(stream)
  10.   File "C:\Python25\lib\site-packages\soappy-0.11.6.0001-py2.5-win32.egg\SOAPpy\wstools\Utility.py", line 572, in loadDocument
  11.     return xml.dom.minidom.parse(data)
  12.   File "C:\Python25\lib\site-packages\pyxml-0.8.4.0002-py2.5-win32.egg\_xmlplus\dom\minidom.py", line 1915, in parse
  13.     return expatbuilder.parse(file)
  14.   File "C:\Python25\lib\site-packages\pyxml-0.8.4.0002-py2.5-win32.egg\_xmlplus\dom\expatbuilder.py", line 930, in parse
  15.     result = builder.parseFile(file)
  16.   File "C:\Python25\lib\site-packages\pyxml-0.8.4.0002-py2.5-win32.egg\_xmlplus\dom\expatbuilder.py", line 207, in parseFile
  17.     parser.Parse(buffer, 0)
  18. xml.parsers.expat.ExpatError: syntax error: line 1, column 0
Thanks in advance for any help!
Jun 30 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.