kartagis / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

Unable to retrieve WSDL #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Invoke SoapClient containing a WSDL which is different from the action URL, 
e.g. client = SoapClient(wsdl="http://example.com/test.wsdl") where the action 
URL is http://example.com/XML/test

2. Running wireshark, you will observe the following output:
GET http://example.com/test.wsdl HTTP/1.0
Host: example.com
User-Agent: Python-urllib/1.17

3. Python stack trace:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\scott\Documents\workspace\web2py\web2py-dev\gluon\contrib\pysimplesoap\client.py", line 67, in __init__
    self.services = wsdl and self.wsdl(wsdl) # parse wsdl url
  File "C:\Users\scott\Documents\workspace\web2py\web2py-dev\gluon\contrib\pysimplesoap\client.py", line 241, in wsdl
    wsdl = SimpleXMLElement(xml, namespace=wsdl_uri)
  File "C:\Users\scott\Documents\workspace\web2py\web2py-dev\gluon\contrib\pysimplesoap\simplexml.py", line 104, in __init__
    self.__document = xml.dom.minidom.parseString(text)
  File "D:\Python25\lib\xml\dom\minidom.py", line 1925, in parseString
    return expatbuilder.parseString(string)
  File "D:\Python25\Lib\xml\dom\expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "D:\Python25\Lib\xml\dom\expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: mismatched tag: line 11, column 2

What is the expected output? What do you see instead?
I expect that the WSDL would be retrieved.  Unfortunately, instead of 
requesting issuing a GET /test.wsdl, the SoapClient is actually performing GET 
http://example.com/test.wsdl, which will fail with a 404 not found.

What version of the product are you using? On what operating system?
1.02a

Original issue reported on code.google.com by blueseas...@gmail.com on 4 Aug 2010 at 3:19

GoogleCodeExporter commented 8 years ago
It looks like this is an HTTP 1.0 versus HTTP 1.1 issue.  Our Web servers only 
support HTTP 1.1, which is why the 404 is being thrown.

Original comment by blueseas...@gmail.com on 4 Aug 2010 at 3:49

GoogleCodeExporter commented 8 years ago
I'm having some troubles with urllib too.

I'll try to replace it with urllib2 or httplib2.

In the meantime, a quick (and faster) workaround is to download the WSDL file 
manually, and then using url="file:/path/to/wsdl.xml".

Original comment by reingart@gmail.com on 6 Aug 2010 at 2:53

GoogleCodeExporter commented 8 years ago
Thanks.  Using the file-based WSDL is what led to my logging Issue 3 :-)

Original comment by blueseas...@gmail.com on 6 Aug 2010 at 2:56

GoogleCodeExporter commented 8 years ago
This hasn't happened again, maybe it was a particular failure.

Original comment by reingart@gmail.com on 23 Nov 2010 at 11:10