??? wrote at 2011-12-7 13:59 +0800:
...
When I try to invoke a remote method getWeather() in the url "
http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl", it
failed. My code and the exception returned are as follows:
...
Traceback (most recent call last):
...
File "/usr/lib/python2.6/urllib2.py", line 1134, in do_open
r = h.getresponse()
File "/usr/lib/python2.6/httplib.py", line 986, in getresponse
response.begin()
File "/usr/lib/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.6/httplib.py", line 355, in _read_status
raise BadStatusLine(line)
The traceback indicates a bad reply from the remote web server:
the response in not a valid HTTP response.
This does not look like a client problem
(at least not completely a client problem).
Should the problem be reproducible, then the most likely cause would be
some error in the WSDL (bad port information) which causes the client
to speak to a non HTTP server.
WSDL is complexe. Especially, it allows to specify different sets of
ports. If the concrete WSDL uses multiple ports, clients may
choose different ports unless the port is specified explicitely in
the call. Maybe, "suds" is using a broken port definition while other
clients use another correct port definition.
Note also that "suds" does not (yet) support "SOAP 1.2" (unlike
the
Java/.Net soap clients). Check whether your WSDL defines
a "SOAP 1.1" port and in this case, use this one.
--
Dieter