[ale] OT: xml-rpc question

Jason Day jasonday at worldnet.att.net
Wed Dec 4 12:53:56 EST 2002


On Tue, Dec 03, 2002 at 01:07:28PM -0500, John Wells wrote:
> The jax-rpc docs state that it only supports a subset of types (vector
> included), but I was wondering, can you wrap an custom type in a Vector
> and then cast it on the service side?  In other words, can you get around
> the type limitation by encapsulating a custom type in a Vector, as long as
> both the client and the server know about the type?  I'm not quite sure
> how a vector's data is "serialized" into xml, but since the actual
> contents of the Vector are generically represented as objects, it would
> seem you could wrap in a vector and cast to appropriate type on the server
> side.

It depends on what your custom type is.  JAX-RPC does support custom
classes (Sun calls them application classes), as long as they conform to
some simple rules.  According to the tutorial
(http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXRPC4.html):

-----
To be supported by JAX-RPC, an application class must conform to the
following rules:

    * It must have a public default constructor.
    * It must not implement (either directly or indirectly) the
      java.rmi.Remote interface.
    * Its fields must be supported JAX-RPC types.
-----

So as long as your custom type follows these rules, it will work fine
(and I have used custom classes with JAX-RPC myself, it does work).
Wrapping a non-conforming object in a Vector (or any other container,
for that matter) won't work, though.

Hope this helps,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list