Fwd: Request for Information XML-RPC (Python)

Davide D'Arenzo davide.darenzo at gmail.com
Wed Jul 29 08:52:29 EDT 2015


Goodmorning dear Team,

I'm Davide D'Arenzo and I'm working with Python using the standard
xmlrpclib library communicating between a JavaServer (that host xmlrpc
server) and my python client. I have a problem and I hope that you should
solve my issue.

I want to send a DOM instance through xmlrpc protocol. I know that the
istance are impossible to manage by xmlrpclib library in Python but this is
what I need. I'm trying to understand why is not possible to marshal the
class Nodelist and I recognize that the target function is dumps(self,
values) in class Marshaller because she couldn't find this type of Python
Object.

For Instance, the Fault code is this:

Traceback (most recent call last):
  File "testRestSwi.py", line 31, in <module>
    conn.xxx.xxx(dom3,"xxx","xxx")
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1572, in __request
    allow_none=self.__allow_none)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1085, in dumps
    data = m.dumps(params)
  File "/usr/lib/python2.7/xmlrpclib.py", line 632, in dumps
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 756, in dump_instance
    self.dump_struct(value.__dict__, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 735, in dump_struct
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 646, in __dump
    raise TypeError, "cannot marshal %s objects" % type(value)
TypeError: cannot marshal <class 'xml.dom.minicompat.NodeList'> objects

Now, I would want to solve this problem and for sure there are many
solutions. But I don't know how to develop or implement something within
the xmlrpclib in order to avoid the "marshalling" problem. Keep in mind
that the file object must be a DOM, is aim, uncheangeable.

For Instance, I'm developing the following:
import xml.dom.minidom as parser
import xmlrpclib
dom3 = parser.parseString("xxx")
conn = xmlrpclib.ServerProxy('xxx',allow_none=True,verbose=True)
conn.xxx.xxx(dom3,"xxx","xxx") #<--- The problem Here.

Might you help me?
Thank you a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150729/cf04381f/attachment.html>


More information about the Python-list mailing list