{"action":"created","issue":{"url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/208","repository_url":"https://api.github.com/repos/mvantellingen/python-zeep","labels_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/208/comments","events_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/208/events","html_url":"https://github.com/mvantellingen/python-zeep/issues/208","id":180653125,"number":208,"title":"Force ns0 removal from envelope sent","user":{"login":"wmehanna","id":1326288,"avatar_url":"https://avatars.githubusercontent.com/u/1326288?v=3","gravatar_id":"","url":"https://api.github.com/users/wmehanna","html_url":"https://github.com/wmehanna","followers_url":"https://api.github.com/users/wmehanna/followers","following_url":"https://api.github.com/users/wmehanna/following{/other_user}","gists_url":"https://api.github.com/users/wmehanna/gists{/gist_id}","starred_url":"https://api.github.com/users/wmehanna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmehanna/subscriptions","organizations_url":"https://api.github.com/users/wmehanna/orgs","repos_url":"https://api.github.com/users/wmehanna/repos","events_url":"https://api.github.com/users/wmehanna/events{/privacy}","received_events_url":"https://api.github.com/users/wmehanna/received_events","type":"User","site_admin":false},"labels":[{"id":374672988,"url":"https://api.github.com/repos/mvantellingen/python-zeep/labels/info-required","name":"info-required","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-03T14:21:50Z","updated_at":"2016-12-21T08:26:16Z","closed_at":"2016-11-06T18:07:16Z","body":"I'm having an issue when using zeep-python, the envelope sent has a bunch of **ns0** added as namespacing.\n\nI tried using the etree.register_namespace() method but it doesn't seems to apply it to the envelope.\n\nI'm using fiddler to debug, so here's what doesn't work, and what's working :\n## Not working:\n\n`\n<?xml version='1.0' encoding='utf-8'?>\n<soap-env:Envelope xmlns:ns0=\"http://www.myurl.com/Integration/\" xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\">\n    <soap-env:Body>\n        <ns0:GetList>\n            <ns0:entity xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"ns0:Employee\">\n                <ns0:ID xsi:nil=\"true\"/>\n                <ns0:Delete>false</Delete>\n            </ns0:entity>\n            <ns0:returnFullEntities>false</ns0:returnFullEntities>\n        </ns0:GetList>\n    </soap-env:Body>\n</soap-env:Envelope>\n`\n## Working :\n\n`\n<?xml version='1.0' encoding='utf-8'?>\n<soap-env:Envelope xmlns=\"http://www.myurl.com/Integration/\" xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\">\n    <soap-env:Body>\n        <GetList>\n            <entity xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Employee\">\n                <ID xsi:nil=\"true\"/>\n                <Delete>false</Delete>\n            </entity>\n            <returnFullEntities>false</returnFullEntities>\n        </GetList>\n    </soap-env:Body>\n</soap-env:Envelope>\n`\n## My python code\n\n`\nfrom zeep import Client\nfrom zeep.transports import Transport\nfrom lxml import etree\nfrom xml.etree import ElementTree as etree\n\ntransport = Transport(verify=False)\nwsdl = 'https://my.urlcom/Integration/?WSDL' #Private wsdl\nclient = Client(wsdl, transport=transport)\netree.register_namespace(\"\", \"http://www.myurl.com/Integration/\")\nclient.service.Login('username', 'password', 'schema', 'smtn', 'EN-US') #need to login (works with the ns0 added)\n\nDepartmentCls = client.get_type('ns0:Department')\ndepartment = DepartmentCls()\ndepartment[\"Delete\"] = False\nresDepartments = client.service.GetList(department, False) #crashes\n`\n## Here's the output :\n\n> zeep.exceptions.Fault: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object.\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.AddListField(XmlDocument document, String entityType, FieldNode field, XmlNode fieldElementValue, XmlAttribute typeAttribute, XmlElement fieldElement)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.AddFields(XmlDocument document, XmlNode entity, IEnumerable`1 fields, String entityType)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformEntityNode(XmlDocument document, XmlNode entity, String parent, String fieldName, String type)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformInputMessage(XmlDocument document)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformInputMessage(XmlReader input, XmlWriter output, String oldNamespace, String newNamespace)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.TransformSoapMessage(XmlReader input, XmlWriter output, String oldNamespace, String newNamespace, Action`4 transformer)\n>    at PX.Api.ContractBased.Soap.EntityTransformExtension.ProcessMessage(SoapMessage message)\n>    at System.Web.Services.Protocols.SoapMessage.RunExtensions(SoapExtension[] extensions, Boolean throwOnException)\n>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()\n>    at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()\n>    --- End of inner exception stack trace ---\n>   Process finished with exit code 1\n\nAny help would be appreciated\n"},"comment":{"url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/comments/268464394","html_url":"https://github.com/mvantellingen/python-zeep/issues/208#issuecomment-268464394","issue_url":"https://api.github.com/repos/mvantellingen/python-zeep/issues/208","id":268464394,"user":{"login":"xeor","id":682676,"avatar_url":"https://avatars.githubusercontent.com/u/682676?v=3","gravatar_id":"","url":"https://api.github.com/users/xeor","html_url":"https://github.com/xeor","followers_url":"https://api.github.com/users/xeor/followers","following_url":"https://api.github.com/users/xeor/following{/other_user}","gists_url":"https://api.github.com/users/xeor/gists{/gist_id}","starred_url":"https://api.github.com/users/xeor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xeor/subscriptions","organizations_url":"https://api.github.com/users/xeor/orgs","repos_url":"https://api.github.com/users/xeor/repos","events_url":"https://api.github.com/users/xeor/events{/privacy}","received_events_url":"https://api.github.com/users/xeor/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T08:26:16Z","updated_at":"2016-12-21T08:26:16Z","body":"I have this issue as well (I think).\r\n\r\nThe error I get back from the server I am talking to is like;\r\n\r\n```\r\nEnd element 'anID' from namespace 'http://url.for/namespace/v1' expected.\r\nFound element 'ns0:anID' from namespace 'http://url.for/namespace/v1'. Line 6, position 18.\r\n```"}}
{"actor":{"display_login":"xeor"}}