ngodoy / pysimplesoap

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

xsi:nil="true" value can't be parsed #175

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
1. Connect with affected WS (OVH webservice for example):
SoapClient(wsdl="http://www.ovh.com/soapi/soapi-dlw-1.63.wsdl", 
soap_server="axis", trace=debug)
2.Try to invoke logout method:
connector.logout(session)
3.Response xml:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:typens="http://soapi.ovh.com/manager" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><logoutRespons
e xmlns="http://soapi.ovh.com/manager"><return xsi:nil="true" 
/></logoutResponse></soap:Body></soap:Envelope>

What is the expected output? 
Properly parsed response.

What do you see instead?

Traceback (most recent call last):
  File "/home/majlo/Projekty/DomainBank/main.py", line 38, in <module>
    ovh.logout()
  File "/home/majlo/Projekty/DomainBank/libovhconnect/ovhclient.py", line 72, in logout
    self.connector.logout(self.session)
  File "/home/majlo/.virtualenvs/OVH_Connect/local/lib/python2.7/site-packages/pysimplesoap/client.py", line 181, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
  File "/home/majlo/.virtualenvs/OVH_Connect/local/lib/python2.7/site-packages/pysimplesoap/client.py", line 348, in wsdl_call
    return self.wsdl_call_with_args(method, args, kwargs)
  File "/home/majlo/.virtualenvs/OVH_Connect/local/lib/python2.7/site-packages/pysimplesoap/client.py", line 374, in wsdl_call_with_args
    resp = response('Body', ns=soap_uri).children().unmarshall(output)
  File "/home/majlo/.virtualenvs/OVH_Connect/local/lib/python2.7/site-packages/pysimplesoap/simplexml.py", line 434, in unmarshall
    value = children and children.unmarshall(fn, strict)
  File "/home/majlo/.virtualenvs/OVH_Connect/local/lib/python2.7/site-packages/pysimplesoap/simplexml.py", line 381, in unmarshall
    raise TypeError("Tag: %s invalid (type not found)" % (name,))
TypeError: Tag: return invalid (type not found)

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

Please attach the related WSDL (if any), a small code fragment to reproduce
and provide any additional information below.

Original issue reported on code.google.com by majlo...@gmail.com on 10 Feb 2015 at 10:15

GoogleCodeExporter commented 8 years ago
Ah, I forgot and can't edit issue.

Setting strict=False on unmarshall method fixes exception and generates this as 
result

{'return': None}

which I don't know is proper or not here.

Problem is that strict value is hardcoded to True in Client and can't be 
configured without changing Client code.

Original comment by majlo...@gmail.com on 10 Feb 2015 at 10:21