You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by Jacek Prucia <ja...@kupic.pl> on 2006/07/26 10:31:06 UTC

Custom type serializer

    Hello dev'ers!

  Quite recently I found interesting feature in XML-RPC 3, but I'm not sure how
to use it correctly. My XML-RPC service transforms an POJO into multilevel
struct/array thing. Right now this involves manual build of Map's and List's,
so they are correctly translated to standard XML-RPC data types. However, this
as you might imagine is a bit annoying. Ideally, I would like to simply return
object and have XML-RPC transform it into multilevel struct/array for me. It 
apears, that I just need to implement TypeSerializer interface. The question 
however remains: how to dynamically register it with XML-RPC server? Do I have 
to create my own TypeFactory implementation? If so, how to associate it with 
XmlRpcServer?

regards,
-- 
Jacek Prucia




---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org


Re: Custom type serializer

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 7/26/06, Jacek Prucia <ja...@kupic.pl> wrote:

>   Quite recently I found interesting feature in XML-RPC 3, but I'm not sure how
> to use it correctly. My XML-RPC service transforms an POJO into multilevel
> struct/array thing. Right now this involves manual build of Map's and List's,
> so they are correctly translated to standard XML-RPC data types. However, this
> as you might imagine is a bit annoying. Ideally, I would like to simply return
> object and have XML-RPC transform it into multilevel struct/array for me. It
> apears, that I just need to implement TypeSerializer interface. The question
> however remains: how to dynamically register it with XML-RPC server? Do I have
> to create my own TypeFactory implementation? If so, how to associate it with
> XmlRpcServer?

Yes, you have to derive a subclass of TypeFactoryImpl. See the
org.apache.xmlrpc.jaxb package for an example. Your custom type
factory must simply be configured with the respective property of
XmlRpcClient or XmlRpcServer object.

Jochen

-- 
Whenever you find yourself on the side of the
majority, it is time to pause and reflect.
(Mark Twain)

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org