471,579 Members | 1,260 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,579 software developers and data experts.

xmlrpclib: how to marshal special instances

Hi!
We have an application server (Zope) and make heavy use of
xml-rpc. One problem arised, when we tried to return a zope.DateTime
instance. xmlrpclib (naturally) knows nothing about zope.DateTime and
marshalls it as instance, which gives a structure (of zope.DateTime
attributes) on the client side (which isnt very usable).

It seems we have two possibilities:

1) Convert all zope.DateTime instances to xmlrpclib.DateTime instances
in our appserver program. (This would be a burden for every
appserver programmer.)

2) Tell xmlrpclib how to marshal zope.DateTime instances as
xmlrpclib.DateTime objects.

We are in favour of 2, and would like to patch Zope, so that
zope.DateTime objects automatically recieve as xmlrpc date types on
the client side.

Schematically:

import xmlrpclib

# zope.DateTime must have an "encode" method
xmlrpclib.WRAPPERS = xmlrpclib.WRAPPERS + (zope.DateTime,)

However, we do not know, if the WRAPPERS tuple is an "official" API,
and if we should use it that way. (We'd like to know before we try to
get a patch into the Zope core...)

Or, are there other (better!) ways to solve the problem (marshal
zope.DateTime as xml-rpc date without modifying xmlrpclib)?
Thanks!
\wlang{}

--
Wi****************@wu-wien.ac.at Fax: +43/1/31336/9207
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria
Oct 17 '05 #1
0 1449

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sashan | last post: by
2 posts views Thread by p2esp | last post: by
reply views Thread by Roger Binns | last post: by
1 post views Thread by Gabriel PASTOR | last post: by
3 posts views Thread by writeson | last post: by
5 posts views Thread by Jonathan Ballet | last post: by
2 posts views Thread by squid | last post: by
reply views Thread by Arno Stienen | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.