473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

xmlrpclib: how to marshal special instances

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.


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)?

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Larry | last post by:
I've had a production system running for a long time that uses xmlrpclib with timeoutsocket, and with my recent upgrade to 2.3 it's no longer able to use xmlrpclib with the xmlrpc servers I...
by: sashan | last post by:
Hi I'm having trouble using xmlrpclib. I register a function (or class) with the SimpleXMLRPCServer and initiate the server. I then create a ServerProxy object and connect to the xml-rpc...
by: p2esp | last post by:
Hello, I'm using the xmlrpclib module to contact an XMLRPC server that takes a long time to send results back. My client timeouts. The question is whether there is a way to have an xmlrpclib...
by: Roger Binns | last post by:
This was a fun problem to track down. The xmlrpclib._Method object should do something about __str__/__repr__. I have some code that prints out variables when an exception happens, and if...
by: Gabriel PASTOR | last post by:
I'm trying to send object using xmlrpclib, but it seems that classes inheriting from object cannot be marshalled. Here is an example: -------- server.py -------- import xmlrpclib,...
by: writeson | last post by:
Hi, I tried the xmlrpclib examples from the Python Cookbook and had a problem. The example works fine so long as the server and client are on the same machine. But as soon as I try to run the...
by: Jonathan Ballet | last post by:
Hello, I have developped a XMLRPC server, which runs under Gnu/Linux with python2.3. This server receives method calls from Windows client. The server got some parameters which are string,...
by: squid | last post by:
First off, I'm a python neophyte, but I'm fairly experienced with Java, C and PHP. I've been trying to use the xmlrpclib to perform remote calls against a service, and it works nicely. However,...
by: Arno Stienen | last post by:
Perhaps I should be a bit more specific. When using this code to connect to a remote XML-RPC server (C++, xmlrpc++0.7 library): import xmlrpclib server =...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.