Closed melvinkcx closed 5 years ago
Currently, there is no way to configure the class used to serialize data in XML Handler. This job is done by (undocumented) builtin class xmlrpc.client.Marshaller
(python 3) or xmlrpclib.Marshaller
(python 2). This class can serialize any object with __dict__
attribute, so Django model instances can be returned directly by a RPC Method.
This will work with XML-RPC, but not with JSON-RPC, that's why this kind of use is not supported officially. It is your responsibility to serialize your data to something supported (basic types, list, dict, see documentation for a full list).
I am trying to access Django Model, but it gave me an InternalError. what's happening on server side is simple retrieve a user model and return to the client.
I would like to try using Django XMLSerializer but have no idea how to configure.