{"action":"created","issue":{"url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/153","repository_url":"https://api.github.com/repos/mvantellingen/python-zeep","labels_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/153/comments","events_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/153/events","html_url":"https://github.com/mvantellingen/python-zeep/issues/153","id":168322969,"number":153,"title":"Error while parsing a response","user":{"login":"twanschik","id":970943,"avatar_url":"https://avatars.githubusercontent.com/u/970943?v=3","gravatar_id":"","url":"https://api.github.com/users/twanschik","html_url":"https://github.com/twanschik","followers_url":"https://api.github.com/users/twanschik/followers","following_url":"https://api.github.com/users/twanschik/following{/other_user}","gists_url":"https://api.github.com/users/twanschik/gists{/gist_id}","starred_url":"https://api.github.com/users/twanschik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twanschik/subscriptions","organizations_url":"https://api.github.com/users/twanschik/orgs","repos_url":"https://api.github.com/users/twanschik/repos","events_url":"https://api.github.com/users/twanschik/events{/privacy}","received_events_url":"https://api.github.com/users/twanschik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mvantellingen/python-zeep/labels/xsd","name":"xsd","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mvantellingen/python-zeep/milestones/8","html_url":"https://github.com/mvantellingen/python-zeep/milestones/0.15","labels_url":"https://api.github.com/repos/mvantellingen/python-zeep/milestones/8/labels","id":1905689,"number":8,"title":"0.15","description":"","creator":{"login":"mvantellingen","id":245297,"avatar_url":"https://avatars.githubusercontent.com/u/245297?v=3","gravatar_id":"","url":"https://api.github.com/users/mvantellingen","html_url":"https://github.com/mvantellingen","followers_url":"https://api.github.com/users/mvantellingen/followers","following_url":"https://api.github.com/users/mvantellingen/following{/other_user}","gists_url":"https://api.github.com/users/mvantellingen/gists{/gist_id}","starred_url":"https://api.github.com/users/mvantellingen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvantellingen/subscriptions","organizations_url":"https://api.github.com/users/mvantellingen/orgs","repos_url":"https://api.github.com/users/mvantellingen/repos","events_url":"https://api.github.com/users/mvantellingen/events{/privacy}","received_events_url":"https://api.github.com/users/mvantellingen/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":0,"state":"open","created_at":"2016-07-26T19:31:47Z","updated_at":"2016-08-03T20:36:54Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-29T13:19:24Z","updated_at":"2016-09-01T15:01:40Z","closed_at":null,"body":"Hi,\r\nI'm not allowed to post all information, however I try to do my best to describe the problem I'm facing.\r\nHere is the wsdl definition of the response for the ping request of a third party service:\r\n\r\n```xml\r\n<definitions name='3rdService' targetNamespace='com.3rd.soap.3rd' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='com.3rd.soap.3rd' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>\r\n <documentation>3rdService</documentation>\r\n <types>\r\n  <schema targetNamespace='com.3rd.soap.3rd' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:tns='com.3rd.soap.3rd'>\r\n   <complexType name='3rdPingResponse'>\r\n    <complexContent>\r\n     <extension base='tns:3rdResponse'>\r\n      <sequence>\r\n       <element minOccurs='0' name='echoData' nillable='true' type='xsd:string'/>\r\n      </sequence>\r\n     </extension>\r\n    </complexContent>\r\n   </complexType>\r\n   <complexType name='3rdGenericData'>\r\n    <sequence>\r\n     <element minOccurs='0' name='key' nillable='true' type='xsd:string'/>\r\n     <element maxOccurs='unbounded' minOccurs='0' name='values' nillable='true' type='xsd:string'/>\r\n    </sequence>\r\n   </complexType>\r\n   <complexType name='3rdResponse'>\r\n    <sequence>\r\n     <element maxOccurs='unbounded' minOccurs='0' name='genericData' nillable='true' type='tns:3rdGenericData'/>\r\n     <element minOccurs='0' name='traceId' nillable='true' type='xsd:string'/>\r\n     <element minOccurs='0' name='transactionId' nillable='true' type='tns:3rdIdType'/>\r\n    </sequence>\r\n   </complexType>\r\n  </schema>\r\n </types>\r\n <message name='3rdSoapService_pingResponse'>\r\n  <part name='pingResponse' type='tns:PingResponse'></part>\r\n </message>\r\n <portType name='3rdSoapService'>\r\n  <operation name='ping'>\r\n   <input message='tns:3rdSoapService_pingRequest'></input>\r\n   <output message='tns:3rdSoapService_pingResponse'></output>\r\n   <fault message='tns:3rdException' name='3rdException'></fault>\r\n  </operation>\r\n </portType>\r\n</definitions>\r\n```\r\n\r\nI have no problem doing the ping request using zeep. However, when doing so I get the following response:\r\n\r\n```xml\r\n<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <env:Header>\r\n </env:Header>\r\n <env:Body>\r\n  <ns1:pingResponse xmlns:ns1=\"com.3rd.soap.3rd\">\r\n   <pingResponse>\r\n    <echoData>Hello World!</echoData>\r\n   </pingResponse>\r\n  </ns1:pingResponse>\r\n </env:Body>\r\n</env:Envelope>\r\n```\r\n\r\nZeep can't parse the response. The following exception is raised:\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"C:/Users/qqq/Documents/Development/myProject/myProject/my_test.py\", line 5, in <module>\r\n    session.ping()\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\mylib\\mylib\\api.py\", line 61, in ping\r\n    'echoData': 'Hello world'}))\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\client.py\", line 24, in __call__\r\n    self._op_name, args, kwargs)\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\wsdl\\soap.py\", line 94, in send\r\n    return self.process_reply(client, operation_obj, response)\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\wsdl\\soap.py\", line 125, in process_reply\r\n    return operation.process_reply(doc)\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\wsdl\\soap.py\", line 258, in process_reply\r\n    return self.output.deserialize(body)\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\wsdl\\messages.py\", line 274, in deserialize\r\n    result = self.body.parse(value, self.wsdl.types)\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\xsd\\elements.py\", line 212, in parse\r\n    xmlelement, '{http://www.w3.org/2001/XMLSchema-instance}type')\r\n  File \"C:\\Users\\qqq\\Documents\\Development\\myProject\\.venv\\lib\\site-packages\\zeep\\utils.py\", line 14, in qname_attr\r\n    value = node.get(attr_name)\r\nAttributeError: 'NoneType' object has no attribute 'get'\r\n```\r\n\r\nWhile debugging I found that zeep tries to deserialize the body (i.e. the first line of the method `deserialize()` of the class `RpcMessage` in 'zeep/wsdl/messages.py'). zeep searches for the `3rdSoapService_pingResponse`-message element inside of the `Body`-element but can't find it, leading to `node` being `None`. The response doesn't contain such an element (instead it only contains an `ns1:pingResponse` node). When hardcoding the tag that is searched for from `3rdSoapService_pingResponse` to `pingResponse` everything works fine.\r\n\r\nI'm not sure if the response is incorrect or if zeep should be able to handle these kind of problems. Thanks in advance for any help."},"comment":{"url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/comments/244107240","html_url":"https://github.com/mvantellingen/python-zeep/issues/153#issuecomment-244107240","issue_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/153","id":244107240,"user":{"login":"FrugoFruit90","id":16898662,"avatar_url":"https://avatars.githubusercontent.com/u/16898662?v=3","gravatar_id":"","url":"https://api.github.com/users/FrugoFruit90","html_url":"https://github.com/FrugoFruit90","followers_url":"https://api.github.com/users/FrugoFruit90/followers","following_url":"https://api.github.com/users/FrugoFruit90/following{/other_user}","gists_url":"https://api.github.com/users/FrugoFruit90/gists{/gist_id}","starred_url":"https://api.github.com/users/FrugoFruit90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FrugoFruit90/subscriptions","organizations_url":"https://api.github.com/users/FrugoFruit90/orgs","repos_url":"https://api.github.com/users/FrugoFruit90/repos","events_url":"https://api.github.com/users/FrugoFruit90/events{/privacy}","received_events_url":"https://api.github.com/users/FrugoFruit90/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T15:01:40Z","updated_at":"2016-09-01T15:01:40Z","body":"I'm starting to think I have the same issue https://github.com/mvantellingen/python-zeep/issues/177\r\n\r\nJudging from the following part of traceback in my case, the function seems to break down when dealing with the body:\r\n```\r\n  File \"C:\\Users\\j.zysko\\Envs\\gabinet\\lib\\site-packages\\zeep\\wsdl\\soap.py\", line 256, in process_reply\r\n    return self.output.deserialize(body)\r\n  File \"C:\\Users\\j.zysko\\Envs\\gabinet\\lib\\site-packages\\zeep\\wsdl\\messages.py\", line 240, in deserialize\r\n    assert elm is not None, '%s not found' % part.element.qname\r\n```\r\nThe problematic XML response is the following:\r\n```\r\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n   <soapenv:Header>\r\n      <ns1:session id=\"8376098C176B5AD5E9A14AF2FA07D870\" xmlns:ns1=\"http://xml.kamsoft.pl/ws/common\"/>\r\n      <ns1:authToken id=\"BSLp7AoO_IFHXGite_3gye\" xmlns:ns1=\"http://xml.kamsoft.pl/ws/common\"/>\r\n   </soapenv:Header>\r\n   <soapenv:Body>\r\n      <ns1:loginReturn xmlns:ns1=\"http://xml.kamsoft.pl/ws/kaas/login_types\">[000] U&amp;#380;ytkownik zosta&amp;#322; prawid&amp;#322;owo zalogowany.</ns1:loginReturn>\r\n   </soapenv:Body>\r\n</soapenv:Envelope>\r\n```\r\nDoes any of you guys know if I could somehow circumvent this before the whole thing gets fixed?\r\nThing is, I don't really need anything that is inside of the body as I'm only interested in the header.\r\nWhen I comment out the \"assert\" line from traceback I get the same error message as you guys:\r\n```\r\n  File \"C:\\Users\\j.zysko\\Envs\\gabinet\\lib\\site-packages\\zeep\\utils.py\", line 14, in qname_attr\r\n    value = node.get(attr_name)\r\nAttributeError: 'NoneType' object has no attribute 'get'\r\n```"}}
{"actor":{"display_login":"FrugoFruit90"}}