Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with .net client #16

Open
morsupil opened this issue Oct 12, 2012 · 4 comments
Open

Problem with .net client #16

morsupil opened this issue Oct 12, 2012 · 4 comments
Assignees

Comments

@morsupil
Copy link

Hello,

I've this error return to a .net client :
Error in web service : 'NoneType' object has no attribute 'replace'

I don't have the problem with soapui and suds.

Here is the traceback of the error:

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/tornado/web.py", line 1042, in _execute
getattr(self, self.request.method.lower())(_args, *_kwargs)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 148, in post
self._request = self._parseSoap(self.request.body)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 229, in _parseSoap
body_elements = self._parseXML(body)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 265, in _parseXML
elem_list.append(xml.dom.minidom.parseString(element.toxml()))
File "/usr/lib/python2.6/xml/dom/minidom.py", line 45, in toxml
return self.toprettyxml("", "", encoding)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 59, in toprettyxml
self.writexml(writer, "", indent, newl)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
node.writexml(writer,indent+addindent,addindent,newl)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 812, in writexml
_write_data(writer, attrs[a_name].value)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 301, in _write_data
data = data.replace("&", "&").replace("<", "<")
AttributeError: 'NoneType' object has no attribute 'replace'

The xml enveloppe send by the client is here:

http://pastebin.com/JnbrUWXj

Any Idea?

Michael

@rancavil
Copy link
Owner

Hello Michael. You can send me the SOAP message generated by the client .NET?.

I can see what this is an error of the xml parser in the API.

Thanks. Rodrigo.


De: morsupil [email protected]
Para: rancavil/tornado-webservices [email protected]
Enviado: Viernes, 12 de octubre, 2012 12:28 P.M.
Asunto: [tornado-webservices] Problem with .net client (#16)

Hello,
I've this error return to a .net client :
Error in web service : 'NoneType' object has no attribute 'replace'
I don't have the problem with soapui and suds.
Here is the traceback of the error:
Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/tornado/web.py", line 1042, in _execute
getattr(self, self.request.method.lower())(_args, *_kwargs)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 148, in post
self._request = self._parseSoap(self.request.body)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 229, in _parseSoap
body_elements = self._parseXML(body)
File "/usr/local/lib/python2.6/dist-packages/tornadows/soaphandler.py", line 265, in _parseXML
elem_list.append(xml.dom.minidom.parseString(element.toxml()))
File "/usr/lib/python2.6/xml/dom/minidom.py", line 45, in toxml
return self.toprettyxml("", "", encoding)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 59, in toprettyxml
self.writexml(writer, "", indent, newl)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 817, in writexml
node.writexml(writer,indent+addindent,addindent,newl)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 812, in writexml
_write_data(writer, attrs[a_name].value)
File "/usr/lib/python2.6/xml/dom/minidom.py", line 301, in _write_data
data = data.replace("&", "&").replace("<", "<")
AttributeError: 'NoneType' object has no attribute 'replace'
And the xml enveloppe send by the client:

soap:Body1411numericable/soap:Body/soap:Envelope

Any Idea?
Michael

Reply to this email directly or view it on GitHub.

@rancavil
Copy link
Owner

Sorry, did not see the link :-)

@morsupil
Copy link
Author

no problem... I've test a cast in the xml parser module to force NoneType object to an str... No error after this modification but I don't think that this is the solution :-(((

@morsupil
Copy link
Author

here is my modified writexml :
def writexml(self, writer, indent="", addindent="", newl=""):
# indent = current indentation
# addindent = indentation to add to higher levels
# newl = newline string
writer.write(indent+"<" + self.tagName)
attrs = self._get_attributes()
a_names = attrs.keys()
a_names.sort()
for a_name in a_names:
writer.write(" %s="" % a_name)
_write_data(writer, str(attrs[a_name].value))
writer.write(""")
if self.childNodes:
writer.write(">%s"%(newl))
for node in self.childNodes:
node.writexml(writer,indent+addindent,addindent,newl)
writer.write("%s</%s>%s" % (indent,self.tagName,newl))
else:
writer.write("/>%s"%(newl))

@ghost ghost assigned rancavil Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants