Question : Problem with Zolera SOAP libs with WSDL: response is "text/html", not "text/xml".

My code is like this:

from ZSI import ServiceProxy

service = ServiceProxy('https://mywebservice.wsdl')
key = '12345'
value = service.status(key)

(note: key is a string; status is one of the functions of the web service).


The error:
>>> status = service.status("1234")
Traceback (most recent call last):
  File "", line 1, in ?
  File "C:\Python24\lib\site-packages\ZSI\ServiceProxy.py", line 308, in __call_
_
    return self.parent()._call(self.__name__, *args, **kwargs)
  File "C:\Python24\lib\site-packages\ZSI\ServiceProxy.py", line 106, in _call
    apply(getattr(binding, callinfo.methodName), args)
  File "C:\Python24\lib\site-packages\ZSI\client.py", line 28, in __call__
    requesttypecode=TC.Any(self.name, aslist=1))
  File "C:\Python24\lib\site-packages\ZSI\client.py", line 143, in RPC
    return self.Receive(replytype, **kw)
  File "C:\Python24\lib\site-packages\ZSI\client.py", line 284, in Receive
    self.ReceiveSOAP(**kw)
  File "C:\Python24\lib\site-packages\ZSI\client.py", line 256, in ReceiveSOAP
    raise TypeError(
TypeError: Response is "text/html", not "text/xml"


I read somewhere that this is because the return value is an error html page...

What could be the cause of this?  The web service works with other languages (Perl, Java, etc.).  All the code for those clients do is load the wsdl file and call the functions.  When I type the command to load the wsdl file, everything seems to work fine.  But it breaks when I call the function "status".



Answer : Problem with Zolera SOAP libs with WSDL: response is "text/html", not "text/xml".

If there's no way to get the HTML response out of ZSI, you could use a packet sniffer like Ethereal (http://ethereal.com) to see what the HTML error page says.  It'll probably be something dead simple once you can see the error.
Random Solutions  
 
programming4us programming4us