You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rpc-user@xml.apache.org by mike marsh <sa...@yahoo.com> on 2002/09/20 06:02:51 UTC
cannot marshal ...
I learned about XMLRPC only a few days ago, so if it
sounds like I don't know what I'm talking about
then...I don't.
MY QUESTION:
I think I want to know how to make my XmlRpcClient
understand <value><long int> 1524335 </long
int></value>.
MY SITUATION:
I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how to
modifiy org.apache.xml.XmlRpc.java?
Below is some more info that may help explain my
problem.
Thanks in advance,
mike
STACK TRACE:
My code generates the following stack trace.
org.apache.xmlrpc.XmlRpcException: Unexpected Zope
exception: cannot marshal <type 'long int'> objects
at
org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
at
org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
at
ncmi.dbclient.DBClient.query(DBClient.java:42)
at ncmi.dbclient.Browser.main(Browser.java:91)
Client calling procedure
'EMDB.Groups.Group_1.Project_59.Microscopy.values'
with parameters []
Beginning parsing XML input stream
startElement: methodResponse
startElement: value
startElement: struct
startElement: member
startElement: name
endElement: name
startElement: value
startElement: int
endElement: int
endElement: value
endElement: member
startElement: member
startElement: name
endElement: name
startElement: value
startElement: string
endElement: string
endElement: value
endElement: member
endElement: struct
endElement: value
endElement: fault
endElement: methodResponse
DEBUG:
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Re: cannot marshal ...
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Well, shame on the Zope developers :)
Seriously, if you are interested in changing the code your best bet is to:
1) subscribe to the Xml-Rpc-Dev mailing list,
2) get the latest code from CVS, and
3) start hacking
You might start with the XmlRpc base class, as that is where the data
types are defined.
Ryan Hoegg
ISIS Networks
mike marsh wrote:
>Hi Ryan,
>
>Part of the problem is that I don't do the maintenance
>of the Zope server code. Someone else does that.
>Another person is using a python XmlRpc client to
>connect to the Zope server, and his code can interpret
>the "long int" without a problem.
>
>I read the XmlRpc Types page on the xml.apache.org
>website. And I see that there is no definition for
>"long int". I suppose that Zope's XmlRpc server has
>extended the spec to include "long int", so I need to
>know how to hack the XmlRpc classes so that they can
>parse "long int".
>
>thanks,
>mike
>
>--- Ryan Hoegg <rh...@isisnetworks.net> wrote:
>
>
>>Hi Mike,
>>
>>You may want to read the XML-RPC spec at
>>http://www.xmlrpc.com/spec for
>>more information on the data types supported by
>>XML-RPC. In the "Scalar
>><value>s" section, it says that integers are "four
>>byte signed integers"
>>and are denoted by <i4> or <int>. Further down in
>>the 1/21/99 update,
>>specific questions about allowable ranges for int
>>and double are
>>mentioned. It says that int is strictly defined as
>>32 bit, while double
>>is "implementation-dependent".
>>
>>It seems to me that your options are to somehow pack
>>your large numbers
>>into the other data types (string or several ints)
>>or to use a different
>>web services protocol like SOAP.
>>
>>If it was my project I might try using the packed
>>int approach, i.e. 4
>>32 bit ints are packed to make a single 128 bit int.
>> You could put them
>>in a struct or a vector, the advantage of the struct
>>being that you can
>>explicitly name them "int-byte1", "int-byte2", etc.
>>
>>--
>>Ryan Hoegg
>>ISIS Networks
>>
>>mike marsh wrote:
>>
>>
>>
>>>I learned about XMLRPC only a few days ago, so if
>>>
>>>
>>it
>>
>>
>>>sounds like I don't know what I'm talking about
>>>then...I don't.
>>>
>>>MY QUESTION:
>>>I think I want to know how to make my XmlRpcClient
>>>understand <value><long int> 1524335 </long
>>>int></value>.
>>>
>>>MY SITUATION:
>>>I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how
>>>
>>>
>>to
>>
>>
>>>modifiy org.apache.xml.XmlRpc.java?
>>>
>>>Below is some more info that may help explain my
>>>problem.
>>>
>>>Thanks in advance,
>>>mike
>>>
>>>STACK TRACE:
>>>My code generates the following stack trace.
>>>org.apache.xmlrpc.XmlRpcException: Unexpected Zope
>>>exception: cannot marshal <type 'long int'> objects
>>> at
>>>
>>>
>>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
>>
>>
>>> at
>>>
>>>
>>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
>>
>>
>>> at
>>>ncmi.dbclient.DBClient.query(DBClient.java:42)
>>> at
>>>
>>>
>>ncmi.dbclient.Browser.main(Browser.java:91)
>>
>>
>>>Client calling procedure
>>>'EMDB.Groups.Group_1.Project_59.Microscopy.values'
>>>with parameters []
>>>Beginning parsing XML input stream
>>>startElement: methodResponse
>>>startElement: value
>>>startElement: struct
>>>startElement: member
>>>startElement: name
>>>endElement: name
>>>startElement: value
>>>startElement: int
>>>endElement: int
>>>endElement: value
>>>endElement: member
>>>startElement: member
>>>startElement: name
>>>endElement: name
>>>startElement: value
>>>startElement: string
>>>endElement: string
>>>endElement: value
>>>endElement: member
>>>endElement: struct
>>>endElement: value
>>>endElement: fault
>>>endElement: methodResponse
>>>DEBUG:
>>>
Re: cannot marshal ...
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Well, shame on the Zope developers :)
Seriously, if you are interested in changing the code your best bet is to:
1) subscribe to the Xml-Rpc-Dev mailing list,
2) get the latest code from CVS, and
3) start hacking
You might start with the XmlRpc base class, as that is where the data
types are defined.
Ryan Hoegg
ISIS Networks
mike marsh wrote:
>Hi Ryan,
>
>Part of the problem is that I don't do the maintenance
>of the Zope server code. Someone else does that.
>Another person is using a python XmlRpc client to
>connect to the Zope server, and his code can interpret
>the "long int" without a problem.
>
>I read the XmlRpc Types page on the xml.apache.org
>website. And I see that there is no definition for
>"long int". I suppose that Zope's XmlRpc server has
>extended the spec to include "long int", so I need to
>know how to hack the XmlRpc classes so that they can
>parse "long int".
>
>thanks,
>mike
>
>--- Ryan Hoegg <rh...@isisnetworks.net> wrote:
>
>
>>Hi Mike,
>>
>>You may want to read the XML-RPC spec at
>>http://www.xmlrpc.com/spec for
>>more information on the data types supported by
>>XML-RPC. In the "Scalar
>><value>s" section, it says that integers are "four
>>byte signed integers"
>>and are denoted by <i4> or <int>. Further down in
>>the 1/21/99 update,
>>specific questions about allowable ranges for int
>>and double are
>>mentioned. It says that int is strictly defined as
>>32 bit, while double
>>is "implementation-dependent".
>>
>>It seems to me that your options are to somehow pack
>>your large numbers
>>into the other data types (string or several ints)
>>or to use a different
>>web services protocol like SOAP.
>>
>>If it was my project I might try using the packed
>>int approach, i.e. 4
>>32 bit ints are packed to make a single 128 bit int.
>> You could put them
>>in a struct or a vector, the advantage of the struct
>>being that you can
>>explicitly name them "int-byte1", "int-byte2", etc.
>>
>>--
>>Ryan Hoegg
>>ISIS Networks
>>
>>mike marsh wrote:
>>
>>
>>
>>>I learned about XMLRPC only a few days ago, so if
>>>
>>>
>>it
>>
>>
>>>sounds like I don't know what I'm talking about
>>>then...I don't.
>>>
>>>MY QUESTION:
>>>I think I want to know how to make my XmlRpcClient
>>>understand <value><long int> 1524335 </long
>>>int></value>.
>>>
>>>MY SITUATION:
>>>I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how
>>>
>>>
>>to
>>
>>
>>>modifiy org.apache.xml.XmlRpc.java?
>>>
>>>Below is some more info that may help explain my
>>>problem.
>>>
>>>Thanks in advance,
>>>mike
>>>
>>>STACK TRACE:
>>>My code generates the following stack trace.
>>>org.apache.xmlrpc.XmlRpcException: Unexpected Zope
>>>exception: cannot marshal <type 'long int'> objects
>>> at
>>>
>>>
>>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
>>
>>
>>> at
>>>
>>>
>>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
>>
>>
>>> at
>>>ncmi.dbclient.DBClient.query(DBClient.java:42)
>>> at
>>>
>>>
>>ncmi.dbclient.Browser.main(Browser.java:91)
>>
>>
>>>Client calling procedure
>>>'EMDB.Groups.Group_1.Project_59.Microscopy.values'
>>>with parameters []
>>>Beginning parsing XML input stream
>>>startElement: methodResponse
>>>startElement: value
>>>startElement: struct
>>>startElement: member
>>>startElement: name
>>>endElement: name
>>>startElement: value
>>>startElement: int
>>>endElement: int
>>>endElement: value
>>>endElement: member
>>>startElement: member
>>>startElement: name
>>>endElement: name
>>>startElement: value
>>>startElement: string
>>>endElement: string
>>>endElement: value
>>>endElement: member
>>>endElement: struct
>>>endElement: value
>>>endElement: fault
>>>endElement: methodResponse
>>>DEBUG:
>>>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
mike marsh <sa...@yahoo.com> writes:
> Hi Ryan,
>
> Part of the problem is that I don't do the maintenance
> of the Zope server code. Someone else does that.
> Another person is using a python XmlRpc client to
> connect to the Zope server, and his code can interpret
> the "long int" without a problem.
>
> I read the XmlRpc Types page on the xml.apache.org
> website. And I see that there is no definition for
> "long int". I suppose that Zope's XmlRpc server has
> extended the spec to include "long int", so I need to
> know how to hack the XmlRpc classes so that they can
> parse "long int".
Ahh. The Zope serving is not conformant to the XML-RPC specification,
as it does not define a "long int" type. If you can't fix the server
code, Ryan suggestion of extending the latest code from our CVS tree
is your best workaround.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
mike marsh <sa...@yahoo.com> writes:
> Hi Ryan,
>
> Part of the problem is that I don't do the maintenance
> of the Zope server code. Someone else does that.
> Another person is using a python XmlRpc client to
> connect to the Zope server, and his code can interpret
> the "long int" without a problem.
>
> I read the XmlRpc Types page on the xml.apache.org
> website. And I see that there is no definition for
> "long int". I suppose that Zope's XmlRpc server has
> extended the spec to include "long int", so I need to
> know how to hack the XmlRpc classes so that they can
> parse "long int".
Ahh. The Zope serving is not conformant to the XML-RPC specification,
as it does not define a "long int" type. If you can't fix the server
code, Ryan suggestion of extending the latest code from our CVS tree
is your best workaround.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by mike marsh <sa...@yahoo.com>.
Hi Ryan,
Part of the problem is that I don't do the maintenance
of the Zope server code. Someone else does that.
Another person is using a python XmlRpc client to
connect to the Zope server, and his code can interpret
the "long int" without a problem.
I read the XmlRpc Types page on the xml.apache.org
website. And I see that there is no definition for
"long int". I suppose that Zope's XmlRpc server has
extended the spec to include "long int", so I need to
know how to hack the XmlRpc classes so that they can
parse "long int".
thanks,
mike
--- Ryan Hoegg <rh...@isisnetworks.net> wrote:
> Hi Mike,
>
> You may want to read the XML-RPC spec at
> http://www.xmlrpc.com/spec for
> more information on the data types supported by
> XML-RPC. In the "Scalar
> <value>s" section, it says that integers are "four
> byte signed integers"
> and are denoted by <i4> or <int>. Further down in
> the 1/21/99 update,
> specific questions about allowable ranges for int
> and double are
> mentioned. It says that int is strictly defined as
> 32 bit, while double
> is "implementation-dependent".
>
> It seems to me that your options are to somehow pack
> your large numbers
> into the other data types (string or several ints)
> or to use a different
> web services protocol like SOAP.
>
> If it was my project I might try using the packed
> int approach, i.e. 4
> 32 bit ints are packed to make a single 128 bit int.
> You could put them
> in a struct or a vector, the advantage of the struct
> being that you can
> explicitly name them "int-byte1", "int-byte2", etc.
>
> --
> Ryan Hoegg
> ISIS Networks
>
> mike marsh wrote:
>
> >I learned about XMLRPC only a few days ago, so if
> it
> >sounds like I don't know what I'm talking about
> >then...I don't.
> >
> >MY QUESTION:
> >I think I want to know how to make my XmlRpcClient
> >understand <value><long int> 1524335 </long
> >int></value>.
> >
> >MY SITUATION:
> >I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how
> to
> >modifiy org.apache.xml.XmlRpc.java?
> >
> >Below is some more info that may help explain my
> >problem.
> >
> >Thanks in advance,
> >mike
> >
> >STACK TRACE:
> >My code generates the following stack trace.
> >org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> >exception: cannot marshal <type 'long int'> objects
> > at
>
>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> > at
>
>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> > at
> >ncmi.dbclient.DBClient.query(DBClient.java:42)
> > at
> ncmi.dbclient.Browser.main(Browser.java:91)
> >
> >Client calling procedure
> >'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> >with parameters []
> >Beginning parsing XML input stream
> >startElement: methodResponse
> >startElement: value
> >startElement: struct
> >startElement: member
> >startElement: name
> >endElement: name
> >startElement: value
> >startElement: int
> >endElement: int
> >endElement: value
> >endElement: member
> >startElement: member
> >startElement: name
> >endElement: name
> >startElement: value
> >startElement: string
> >endElement: string
> >endElement: value
> >endElement: member
> >endElement: struct
> >endElement: value
> >endElement: fault
> >endElement: methodResponse
> >DEBUG:
> >
>
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Re: cannot marshal ...
Posted by mike marsh <sa...@yahoo.com>.
Hi Ryan,
Part of the problem is that I don't do the maintenance
of the Zope server code. Someone else does that.
Another person is using a python XmlRpc client to
connect to the Zope server, and his code can interpret
the "long int" without a problem.
I read the XmlRpc Types page on the xml.apache.org
website. And I see that there is no definition for
"long int". I suppose that Zope's XmlRpc server has
extended the spec to include "long int", so I need to
know how to hack the XmlRpc classes so that they can
parse "long int".
thanks,
mike
--- Ryan Hoegg <rh...@isisnetworks.net> wrote:
> Hi Mike,
>
> You may want to read the XML-RPC spec at
> http://www.xmlrpc.com/spec for
> more information on the data types supported by
> XML-RPC. In the "Scalar
> <value>s" section, it says that integers are "four
> byte signed integers"
> and are denoted by <i4> or <int>. Further down in
> the 1/21/99 update,
> specific questions about allowable ranges for int
> and double are
> mentioned. It says that int is strictly defined as
> 32 bit, while double
> is "implementation-dependent".
>
> It seems to me that your options are to somehow pack
> your large numbers
> into the other data types (string or several ints)
> or to use a different
> web services protocol like SOAP.
>
> If it was my project I might try using the packed
> int approach, i.e. 4
> 32 bit ints are packed to make a single 128 bit int.
> You could put them
> in a struct or a vector, the advantage of the struct
> being that you can
> explicitly name them "int-byte1", "int-byte2", etc.
>
> --
> Ryan Hoegg
> ISIS Networks
>
> mike marsh wrote:
>
> >I learned about XMLRPC only a few days ago, so if
> it
> >sounds like I don't know what I'm talking about
> >then...I don't.
> >
> >MY QUESTION:
> >I think I want to know how to make my XmlRpcClient
> >understand <value><long int> 1524335 </long
> >int></value>.
> >
> >MY SITUATION:
> >I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how
> to
> >modifiy org.apache.xml.XmlRpc.java?
> >
> >Below is some more info that may help explain my
> >problem.
> >
> >Thanks in advance,
> >mike
> >
> >STACK TRACE:
> >My code generates the following stack trace.
> >org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> >exception: cannot marshal <type 'long int'> objects
> > at
>
>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> > at
>
>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> > at
> >ncmi.dbclient.DBClient.query(DBClient.java:42)
> > at
> ncmi.dbclient.Browser.main(Browser.java:91)
> >
> >Client calling procedure
> >'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> >with parameters []
> >Beginning parsing XML input stream
> >startElement: methodResponse
> >startElement: value
> >startElement: struct
> >startElement: member
> >startElement: name
> >endElement: name
> >startElement: value
> >startElement: int
> >endElement: int
> >endElement: value
> >endElement: member
> >startElement: member
> >startElement: name
> >endElement: name
> >startElement: value
> >startElement: string
> >endElement: string
> >endElement: value
> >endElement: member
> >endElement: struct
> >endElement: value
> >endElement: fault
> >endElement: methodResponse
> >DEBUG:
> >
>
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Re: cannot marshal ...
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi Mike,
You may want to read the XML-RPC spec at http://www.xmlrpc.com/spec for
more information on the data types supported by XML-RPC. In the "Scalar
<value>s" section, it says that integers are "four byte signed integers"
and are denoted by <i4> or <int>. Further down in the 1/21/99 update,
specific questions about allowable ranges for int and double are
mentioned. It says that int is strictly defined as 32 bit, while double
is "implementation-dependent".
It seems to me that your options are to somehow pack your large numbers
into the other data types (string or several ints) or to use a different
web services protocol like SOAP.
If it was my project I might try using the packed int approach, i.e. 4
32 bit ints are packed to make a single 128 bit int. You could put them
in a struct or a vector, the advantage of the struct being that you can
explicitly name them "int-byte1", "int-byte2", etc.
--
Ryan Hoegg
ISIS Networks
mike marsh wrote:
>I learned about XMLRPC only a few days ago, so if it
>sounds like I don't know what I'm talking about
>then...I don't.
>
>MY QUESTION:
>I think I want to know how to make my XmlRpcClient
>understand <value><long int> 1524335 </long
>int></value>.
>
>MY SITUATION:
>I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how to
>modifiy org.apache.xml.XmlRpc.java?
>
>Below is some more info that may help explain my
>problem.
>
>Thanks in advance,
>mike
>
>STACK TRACE:
>My code generates the following stack trace.
>org.apache.xmlrpc.XmlRpcException: Unexpected Zope
>exception: cannot marshal <type 'long int'> objects
> at
>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> at
>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> at
>ncmi.dbclient.DBClient.query(DBClient.java:42)
> at ncmi.dbclient.Browser.main(Browser.java:91)
>
>Client calling procedure
>'EMDB.Groups.Group_1.Project_59.Microscopy.values'
>with parameters []
>Beginning parsing XML input stream
>startElement: methodResponse
>startElement: value
>startElement: struct
>startElement: member
>startElement: name
>endElement: name
>startElement: value
>startElement: int
>endElement: int
>endElement: value
>endElement: member
>startElement: member
>startElement: name
>endElement: name
>startElement: value
>startElement: string
>endElement: string
>endElement: value
>endElement: member
>endElement: struct
>endElement: value
>endElement: fault
>endElement: methodResponse
>DEBUG:
>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> At 03:14 PM 9/27/2002 -0700, you wrote:
> > > My question is how can I make a more structured
> > > "thingie" like for example a vector of vectors to be an argument or a
> > > return value ?
> >
> >Yes, you can do that. Read the documentation for answers.
>
> Well, can you be more specific? I don't see much about this issue
> except for one vague sentence
>
> in the XML-RPC type description page. Do you mean I have to write
> myself a new XmlRpcHandler?
I don't know enough about your use case to answer that definitively.
Writing handlers is easy -- take a gander at the source code for any
of the existing ones for an example.
> The only thing that is different between <int> type and
> <MySalesInvoice> is how to convert MySalesInvoice to/from
> XML to an object. Shouldn't there be a way to just plugin this piece
> into the standard handler?
I don't know what you mean by "standard handler."
Read the XML-RPC spec: http://www.xml-rpc.com/spec
Custom XML types are not supported. Your handler can map to and from
XML-RPC native types to your custom classes.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> At 03:14 PM 9/27/2002 -0700, you wrote:
> > > My question is how can I make a more structured
> > > "thingie" like for example a vector of vectors to be an argument or a
> > > return value ?
> >
> >Yes, you can do that. Read the documentation for answers.
>
> Well, can you be more specific? I don't see much about this issue
> except for one vague sentence
>
> in the XML-RPC type description page. Do you mean I have to write
> myself a new XmlRpcHandler?
I don't know enough about your use case to answer that definitively.
Writing handlers is easy -- take a gander at the source code for any
of the existing ones for an example.
> The only thing that is different between <int> type and
> <MySalesInvoice> is how to convert MySalesInvoice to/from
> XML to an object. Shouldn't there be a way to just plugin this piece
> into the standard handler?
I don't know what you mean by "standard handler."
Read the XML-RPC spec: http://www.xml-rpc.com/spec
Custom XML types are not supported. Your handler can map to and from
XML-RPC native types to your custom classes.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
At 03:14 PM 9/27/2002 -0700, you wrote:
> > My question is how can I make a more structured
> > "thingie" like for example a vector of vectors to be an argument or a
> > return value ?
>
>Yes, you can do that. Read the documentation for answers.
Well, can you be more specific? I don't see much about this issue except
for one vague sentence
in the XML-RPC type description page. Do you mean I have to write myself a
new XmlRpcHandler?
The only thing that is different between <int> type and <MySalesInvoice> is
how to convert MySalesInvoice to/from
XML to an object. Shouldn't there be a way to just plugin this piece into
the standard handler?
Stan Berka
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
At 03:14 PM 9/27/2002 -0700, you wrote:
> > My question is how can I make a more structured
> > "thingie" like for example a vector of vectors to be an argument or a
> > return value ?
>
>Yes, you can do that. Read the documentation for answers.
Well, can you be more specific? I don't see much about this issue except
for one vague sentence
in the XML-RPC type description page. Do you mean I have to write myself a
new XmlRpcHandler?
The only thing that is different between <int> type and <MySalesInvoice> is
how to convert MySalesInvoice to/from
XML to an object. Shouldn't there be a way to just plugin this piece into
the standard handler?
Stan Berka
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> At 01:57 PM 9/27/2002 -0700, Daniel Rall <dl...@finemaltcoding.com> wrote:
>
> >The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
> >(e.g. Vector). You could use this to supply a different mapping for
> ><int>, say to BigInteger.
>
> Ooooh! I thought of something else. My question is how can I make a
> more structured
>
> "thingie" like for example a vector of vectors to be an argument or a
> return value ?
Yes, you can do that. Read the documentation for answers.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> At 01:57 PM 9/27/2002 -0700, Daniel Rall <dl...@finemaltcoding.com> wrote:
>
> >The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
> >(e.g. Vector). You could use this to supply a different mapping for
> ><int>, say to BigInteger.
>
> Ooooh! I thought of something else. My question is how can I make a
> more structured
>
> "thingie" like for example a vector of vectors to be an argument or a
> return value ?
Yes, you can do that. Read the documentation for answers.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
At 01:57 PM 9/27/2002 -0700, Daniel Rall <dl...@finemaltcoding.com> wrote:
>The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
>(e.g. Vector). You could use this to supply a different mapping for
><int>, say to BigInteger.
Ooooh! I thought of something else. My question is how can I make a more
structured
"thingie" like for example a vector of vectors to be an argument or a
return value ?
Stan Berka
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
At 01:57 PM 9/27/2002 -0700, Daniel Rall <dl...@finemaltcoding.com> wrote:
>The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
>(e.g. Vector). You could use this to supply a different mapping for
><int>, say to BigInteger.
Ooooh! I thought of something else. My question is how can I make a more
structured
"thingie" like for example a vector of vectors to be an argument or a
return value ?
Stan Berka
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> Daniel,
>
> At 01:28 PM 9/27/2002 -0700, Daniel Rall wrote:
>
> >No need to hack! You can either send that integer data as a string
> >and parse it appropriately in your handler on the server side, or
> >implement the new TypeFactory interface from Andrew Evers which I
> >integrated into CVS today.
>
> That sounds very good! How does TypeFactory work? If I implement
> it, can I have XML-RPC understand on both ends an argument type
> and/or return type of my choice? Any info available?
There's only JavaDoc so far. Take a gander at the TypeFactory.java
and XmlRpc.java classes (search for "typeFactory" in the latter):
http://cvs.apache.org/viewcvs/xml-rpc/src/java/org/apache/xmlrpc/
The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
(e.g. Vector). You could use this to supply a different mapping for
<int>, say to BigInteger.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
Stan Berka <sb...@poptal.com> writes:
> Daniel,
>
> At 01:28 PM 9/27/2002 -0700, Daniel Rall wrote:
>
> >No need to hack! You can either send that integer data as a string
> >and parse it appropriately in your handler on the server side, or
> >implement the new TypeFactory interface from Andrew Evers which I
> >integrated into CVS today.
>
> That sounds very good! How does TypeFactory work? If I implement
> it, can I have XML-RPC understand on both ends an argument type
> and/or return type of my choice? Any info available?
There's only JavaDoc so far. Take a gander at the TypeFactory.java
and XmlRpc.java classes (search for "typeFactory" in the latter):
http://cvs.apache.org/viewcvs/xml-rpc/src/java/org/apache/xmlrpc/
The mapping if from XML-RPC type (e.g. <struct>, etc.) to Java type
(e.g. Vector). You could use this to supply a different mapping for
<int>, say to BigInteger.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
Daniel,
At 01:28 PM 9/27/2002 -0700, Daniel Rall wrote:
> > And I need to know how to hack the XmlRpc classes so
> > that they can read "long int" data.
>
>No need to hack! You can either send that integer data as a string
>and parse it appropriately in your handler on the server side, or
>implement the new TypeFactory interface from Andrew Evers which I
>integrated into CVS today.
That sounds very good! How does TypeFactory work? If I implement it, can
I have XML-RPC
understand on both ends an argument type and/or return type of my
choice? Any info available?
Stan Berka
Stan Berka Programmer Annalyst
Portland, OR Pope & Talbot
(503) 552-4315 Fax (503) 2202726
Re: cannot marshal ...
Posted by Stan Berka <sb...@poptal.com>.
Daniel,
At 01:28 PM 9/27/2002 -0700, Daniel Rall wrote:
> > And I need to know how to hack the XmlRpc classes so
> > that they can read "long int" data.
>
>No need to hack! You can either send that integer data as a string
>and parse it appropriately in your handler on the server side, or
>implement the new TypeFactory interface from Andrew Evers which I
>integrated into CVS today.
That sounds very good! How does TypeFactory work? If I implement it, can
I have XML-RPC
understand on both ends an argument type and/or return type of my
choice? Any info available?
Stan Berka
Stan Berka Programmer Annalyst
Portland, OR Pope & Talbot
(503) 552-4315 Fax (503) 2202726
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
mike marsh <sa...@yahoo.com> writes:
> Thank you Mike. I think I overstated the problem. I
> don't know that the xml actually says "<value><long
> int> 1524335 </long int></value>". I just infered
> that from the exception message (which I show below).
>
> The xml that the server sends in reply is parsed okay
> by my web-browser and other xmlrpc clients. I think
> that "long int" is an extension to the xmlrpc spec.
> And I need to know how to hack the XmlRpc classes so
> that they can read "long int" data.
No need to hack! You can either send that integer data as a string
and parse it appropriately in your handler on the server side, or
implement the new TypeFactory interface from Andrew Evers which I
integrated into CVS today.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by Daniel Rall <dl...@finemaltcoding.com>.
mike marsh <sa...@yahoo.com> writes:
> Thank you Mike. I think I overstated the problem. I
> don't know that the xml actually says "<value><long
> int> 1524335 </long int></value>". I just infered
> that from the exception message (which I show below).
>
> The xml that the server sends in reply is parsed okay
> by my web-browser and other xmlrpc clients. I think
> that "long int" is an extension to the xmlrpc spec.
> And I need to know how to hack the XmlRpc classes so
> that they can read "long int" data.
No need to hack! You can either send that integer data as a string
and parse it appropriately in your handler on the server side, or
implement the new TypeFactory interface from Andrew Evers which I
integrated into CVS today.
--
Daniel Rall <dl...@finemaltcoding.com>
Re: cannot marshal ...
Posted by mike marsh <sa...@yahoo.com>.
Thank you Mike. I think I overstated the problem. I
don't know that the xml actually says "<value><long
int> 1524335 </long int></value>". I just infered
that from the exception message (which I show below).
The xml that the server sends in reply is parsed okay
by my web-browser and other xmlrpc clients. I think
that "long int" is an extension to the xmlrpc spec.
And I need to know how to hack the XmlRpc classes so
that they can read "long int" data.
thanx,
mike
--- Mike Kline <mk...@cs.autometric.com> wrote:
> Mike,
>
> You need to create well formed xml, there are many
> ways to do this
> for your sample. One simple way is:
>
> <value type="long int">1231231</value>
>
> which uses an attribute that tells the "type" of
> your value.
>
> It is then up to you to parse the returned value to
> determine the type to assigned it to.
>
>
> Mike K.
>
>
> mike marsh wrote:
> >
> > I learned about XMLRPC only a few days ago, so if
> it
> > sounds like I don't know what I'm talking about
> > then...I don't.
> >
> > MY QUESTION:
> > I think I want to know how to make my XmlRpcClient
> > understand <value><long int> 1524335 </long
> > int></value>.
> >
> > MY SITUATION:
> > I need to connect to a Zope database via XmlRpc.
> 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. Can someone tell me how
> to
> > modifiy org.apache.xml.XmlRpc.java?
> >
> > Below is some more info that may help explain my
> > problem.
> >
> > Thanks in advance,
> > mike
> >
> > STACK TRACE:
> > My code generates the following stack trace.
> > org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> > exception: cannot marshal <type 'long int'>
> objects
> > at
> >
>
org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> > at
> >
>
org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> > at
> > ncmi.dbclient.DBClient.query(DBClient.java:42)
> > at
> ncmi.dbclient.Browser.main(Browser.java:91)
> >
> > Client calling procedure
> > 'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> > with parameters []
> > Beginning parsing XML input stream
> > startElement: methodResponse
> > startElement: value
> > startElement: struct
> > startElement: member
> > startElement: name
> > endElement: name
> > startElement: value
> > startElement: int
> > endElement: int
> > endElement: value
> > endElement: member
> > startElement: member
> > startElement: name
> > endElement: name
> > startElement: value
> > startElement: string
> > endElement: string
> > endElement: value
> > endElement: member
> > endElement: struct
> > endElement: value
> > endElement: fault
> > endElement: methodResponse
> > DEBUG:
> >
> > __________________________________________________
> > Do you Yahoo!?
> > New DSL Internet Access from SBC & Yahoo!
> > http://sbc.yahoo.com
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Re: cannot marshal ...
Posted by mike marsh <sa...@yahoo.com>.
Thank you Mike. I think I overstated the problem. I
don't know that the xml actually says "<value><long
int> 1524335 </long int></value>". I just infered
that from the exception message (which I show below).
The xml that the server sends in reply is parsed okay
by my web-browser and other xmlrpc clients. I think
that "long int" is an extension to the xmlrpc spec.
And I need to know how to hack the XmlRpc classes so
that they can read "long int" data.
thanx,
mike
--- Mike Kline <mk...@cs.autometric.com> wrote:
> Mike,
>
> You need to create well formed xml, there are many
> ways to do this
> for your sample. One simple way is:
>
> <value type="long int">1231231</value>
>
> which uses an attribute that tells the "type" of
> your value.
>
> It is then up to you to parse the returned value to
> determine the type to assigned it to.
>
>
> Mike K.
>
>
> mike marsh wrote:
> >
> > I learned about XMLRPC only a few days ago, so if
> it
> > sounds like I don't know what I'm talking about
> > then...I don't.
> >
> > MY QUESTION:
> > I think I want to know how to make my XmlRpcClient
> > understand <value><long int> 1524335 </long
> > int></value>.
> >
> > MY SITUATION:
> > I need to connect to a Zope database via XmlRpc.
> 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. Can someone tell me how
> to
> > modifiy org.apache.xml.XmlRpc.java?
> >
> > Below is some more info that may help explain my
> > problem.
> >
> > Thanks in advance,
> > mike
> >
> > STACK TRACE:
> > My code generates the following stack trace.
> > org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> > exception: cannot marshal <type 'long int'>
> objects
> > at
> >
>
org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> > at
> >
>
org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> > at
> > ncmi.dbclient.DBClient.query(DBClient.java:42)
> > at
> ncmi.dbclient.Browser.main(Browser.java:91)
> >
> > Client calling procedure
> > 'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> > with parameters []
> > Beginning parsing XML input stream
> > startElement: methodResponse
> > startElement: value
> > startElement: struct
> > startElement: member
> > startElement: name
> > endElement: name
> > startElement: value
> > startElement: int
> > endElement: int
> > endElement: value
> > endElement: member
> > startElement: member
> > startElement: name
> > endElement: name
> > startElement: value
> > startElement: string
> > endElement: string
> > endElement: value
> > endElement: member
> > endElement: struct
> > endElement: value
> > endElement: fault
> > endElement: methodResponse
> > DEBUG:
> >
> > __________________________________________________
> > Do you Yahoo!?
> > New DSL Internet Access from SBC & Yahoo!
> > http://sbc.yahoo.com
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
Re: cannot marshal ...
Posted by Mike Kline <mk...@cs.autometric.com>.
Mike,
You need to create well formed xml, there are many ways to do this
for your sample. One simple way is:
<value type="long int">1231231</value>
which uses an attribute that tells the "type" of your value.
It is then up to you to parse the returned value to determine the type to assigned it to.
Mike K.
mike marsh wrote:
>
> I learned about XMLRPC only a few days ago, so if it
> sounds like I don't know what I'm talking about
> then...I don't.
>
> MY QUESTION:
> I think I want to know how to make my XmlRpcClient
> understand <value><long int> 1524335 </long
> int></value>.
>
> MY SITUATION:
> I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how to
> modifiy org.apache.xml.XmlRpc.java?
>
> Below is some more info that may help explain my
> problem.
>
> Thanks in advance,
> mike
>
> STACK TRACE:
> My code generates the following stack trace.
> org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> exception: cannot marshal <type 'long int'> objects
> at
> org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> at
> org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> at
> ncmi.dbclient.DBClient.query(DBClient.java:42)
> at ncmi.dbclient.Browser.main(Browser.java:91)
>
> Client calling procedure
> 'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> with parameters []
> Beginning parsing XML input stream
> startElement: methodResponse
> startElement: value
> startElement: struct
> startElement: member
> startElement: name
> endElement: name
> startElement: value
> startElement: int
> endElement: int
> endElement: value
> endElement: member
> startElement: member
> startElement: name
> endElement: name
> startElement: value
> startElement: string
> endElement: string
> endElement: value
> endElement: member
> endElement: struct
> endElement: value
> endElement: fault
> endElement: methodResponse
> DEBUG:
>
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
Re: cannot marshal ...
Posted by Mike Kline <mk...@cs.autometric.com>.
Mike,
You need to create well formed xml, there are many ways to do this
for your sample. One simple way is:
<value type="long int">1231231</value>
which uses an attribute that tells the "type" of your value.
It is then up to you to parse the returned value to determine the type to assigned it to.
Mike K.
mike marsh wrote:
>
> I learned about XMLRPC only a few days ago, so if it
> sounds like I don't know what I'm talking about
> then...I don't.
>
> MY QUESTION:
> I think I want to know how to make my XmlRpcClient
> understand <value><long int> 1524335 </long
> int></value>.
>
> MY SITUATION:
> I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how to
> modifiy org.apache.xml.XmlRpc.java?
>
> Below is some more info that may help explain my
> problem.
>
> Thanks in advance,
> mike
>
> STACK TRACE:
> My code generates the following stack trace.
> org.apache.xmlrpc.XmlRpcException: Unexpected Zope
> exception: cannot marshal <type 'long int'> objects
> at
> org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> at
> org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> at
> ncmi.dbclient.DBClient.query(DBClient.java:42)
> at ncmi.dbclient.Browser.main(Browser.java:91)
>
> Client calling procedure
> 'EMDB.Groups.Group_1.Project_59.Microscopy.values'
> with parameters []
> Beginning parsing XML input stream
> startElement: methodResponse
> startElement: value
> startElement: struct
> startElement: member
> startElement: name
> endElement: name
> startElement: value
> startElement: int
> endElement: int
> endElement: value
> endElement: member
> startElement: member
> startElement: name
> endElement: name
> startElement: value
> startElement: string
> endElement: string
> endElement: value
> endElement: member
> endElement: struct
> endElement: value
> endElement: fault
> endElement: methodResponse
> DEBUG:
>
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
Re: cannot marshal ...
Posted by Ryan Hoegg <rh...@isisnetworks.net>.
Hi Mike,
You may want to read the XML-RPC spec at http://www.xmlrpc.com/spec for
more information on the data types supported by XML-RPC. In the "Scalar
<value>s" section, it says that integers are "four byte signed integers"
and are denoted by <i4> or <int>. Further down in the 1/21/99 update,
specific questions about allowable ranges for int and double are
mentioned. It says that int is strictly defined as 32 bit, while double
is "implementation-dependent".
It seems to me that your options are to somehow pack your large numbers
into the other data types (string or several ints) or to use a different
web services protocol like SOAP.
If it was my project I might try using the packed int approach, i.e. 4
32 bit ints are packed to make a single 128 bit int. You could put them
in a struct or a vector, the advantage of the struct being that you can
explicitly name them "int-byte1", "int-byte2", etc.
--
Ryan Hoegg
ISIS Networks
mike marsh wrote:
>I learned about XMLRPC only a few days ago, so if it
>sounds like I don't know what I'm talking about
>then...I don't.
>
>MY QUESTION:
>I think I want to know how to make my XmlRpcClient
>understand <value><long int> 1524335 </long
>int></value>.
>
>MY SITUATION:
>I need to connect to a Zope database via XmlRpc. 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. Can someone tell me how to
>modifiy org.apache.xml.XmlRpc.java?
>
>Below is some more info that may help explain my
>problem.
>
>Thanks in advance,
>mike
>
>STACK TRACE:
>My code generates the following stack trace.
>org.apache.xmlrpc.XmlRpcException: Unexpected Zope
>exception: cannot marshal <type 'long int'> objects
> at
>org.apache.xmlrpc.XmlRpcClient$Worker.execute(XmlRpcClient.java:414)
> at
>org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:149)
> at
>ncmi.dbclient.DBClient.query(DBClient.java:42)
> at ncmi.dbclient.Browser.main(Browser.java:91)
>
>Client calling procedure
>'EMDB.Groups.Group_1.Project_59.Microscopy.values'
>with parameters []
>Beginning parsing XML input stream
>startElement: methodResponse
>startElement: value
>startElement: struct
>startElement: member
>startElement: name
>endElement: name
>startElement: value
>startElement: int
>endElement: int
>endElement: value
>endElement: member
>startElement: member
>startElement: name
>endElement: name
>startElement: value
>startElement: string
>endElement: string
>endElement: value
>endElement: member
>endElement: struct
>endElement: value
>endElement: fault
>endElement: methodResponse
>DEBUG:
>