[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    Re: Custom data types with TypeConverter
From:       "Stefan Gmeiner" <stefangm42 () gmail ! com>
Date:       2008-09-08 7:00:06
Message-ID: d0ae0f040809080000u461c5d2m72c4914d84f29019 () mail ! gmail ! com
[Download RAW message or body]

2008/9/5 Jochen Wiedmann <jochen.wiedmann@gmail.com>:

> The TypeConverter is the wrong approach. Use a custom TypeFactory and
> take the JAXBTypeFactory as an example.

I don't know if I am right but the TypeFactory could only create
objects from custom XML types. If I want to use the standard
<struct>-Tag from XML-RPC spec I need to know the requested target
type for the parsing which is unknown to the TypeParser.

For example:

I call a method with a JavaBean instance as parameter which contains
the properties "number" and "text". The JavaBean is serialized by
TypeSerializer to the following XML-RPC struct:

<struct>
   <member>
      <name>number</name>
      <value><i4>42</i4></value>
      </member>
   <member>
      <name>text</name>
      <value>foo</value>
      </member>
   </struct>

If the server receive this request the TypeParser has to know which
JavaBean instance it has to create before assigning the values to the
properties. But the TypeParser gets only the XML document without an
hint what class the result object should be.

BTW, what is the purpose of the  TypeConverter interface?

Stefan
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic