xml-rpc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike marsh <sanchosmas...@yahoo.com>
Subject Re: need help: cannot marshal <type 'long int'>
Date Fri, 20 Sep 2002 17:17:20 GMT
Tim,

Thanks for your help.  I acknowledge your point--it IS
a limitation of the server.  Unfortunately, the other
folks around me are python gurus.  There are three
projects and three developers:

Zope Database (python)
Database Browser1 (python)
Database Browser2 (java)

I am implementing some great functionality into a
database browser2.  Zope and database browser1 both
use the same python module for xmlrpc, which obviously
deviates from the xmlrpc standard.  My java browser2
uses org.apache.xmlrpc.*, which obviously implements
the standard.

I'm not asking to have someone implement a change in
the release distribution to XmlRpc.java; I just want
some help me figure out how to change my copy so that
it can talk the bastardized xmlrpc that's being spoken
around here.

If you could point out to me where a parsed xmlrpc
type {base64, i4/int, boolean, string, struct, array,
dateTime.iso8601, double}, then I suppose that I could
add 'long int'.

thanks,
mike
--- Tim Peierls <tim@peierls.net> wrote:
> mike marsh wrote:
> > I need to connect to a Zope database via XmlRpc.
> > Someone else maintains the xmlrpc methods and code
> on
> > the Zope server.  I try calling a particular
> method,
> > but an XmlRpcException gets thrown.  The exception
> > string says "cannot marshal <type 'long int'>".  I
> > suppose I need an XmlRpc parser that can interpret
> > <long int> and create a Long object.  
> 
> This is a limitation of the server, not of your
> client,
> so mucking with the client side parsing won't help
> you.
> 
> The XML-RPC spec (http://xmlrpc.org/spec) doesn't
> allow
> long integer values. The best you can do in general
> is 
> encode the long value as a string with 
> 
>     long value = ...;
>     String encodedValue = Long.toString(value);
> 
> and decode returned string values as longs with
> 
>     String value = ...;
>     long decodedValue;
>     try {
>         decodedValue = Long.parseLong(value);
>     }
>     catch (NumberFormatException e) {
>         decodedValue = 0; // or some sentinel value
>     }
> 
> But this all depends on the server doing the right
> thing
> with string-encoded long values. Check with the
> database 
> maintainer to find out how the Zope database can be
> used 
> via XML-RPC with non-XML-RPC types.
> 
> --tim
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

Mime
View raw message