users@jax-rpc.java.net

Re: Client side objects not serializable

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Wed, 07 Sep 2005 13:05:46 -0700

Clinton,
In JAX-RPC the only way you can get this to work is to modify the
generated AccountAge class and make it Serializable.

However, JAX-WS, the follow on to JAX-RPC supports the generation of
Serializable beans via a JAXB customization. Have you tried JAX-WS?

Clinton wrote:

>Hi Doug
>
>I started on the server side with Java classes which included a Serializable
>object/bean called AccountAge which just contained primitives. This was then
>deployed, and the WSDL document that was generated contained a complexType
>element describing the AccountAge object as follows:
>
><types>
> <schema targetNamespace="http://dorado/types/"
>xmlns:tns="http://dorado/types/"
>xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>xmlns="http://www.w3.org/2001/XMLSchema">
> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> <complexType name="AccountAge">
> <sequence>
> <element name="balance120" type="int"/>
> <element name="balance150" type="int"/>
> <element name="balance180" type="int"/>
> <element name="balance30" type="int"/>
> <element name="balance60" type="int"/>
> <element name="balance90" type="int"/>
> <element name="balanceCurrentCash" type="int"/>
> <element name="balanceCurrentTerms" type="int"/>
> <xsd:any maxOccurs="unbounded"/>
> </sequence></complexType></schema></types>
>
>Then on the client side I imported the WSDL file and used it to create my
>"Client side artifacts" which included the AccountAge object, but this generated
>object was now no longer Serializable.
>
>So I am not getting any errors(serverside or clientside) as far as the calling
>of the rpc is concerned, the server is responding correctly and returning a
>valid AccountAge object, but this object is now no longer Serializable, and
>since my client is infact an EJB ... I need a Serializable object to be able to
>return to my applications "true" client.
>
>So in this multi tiered app, the client requests his account age, this request
>goes to an EJB, which in turn does the rpc to the Web service. The Web service
>responds with the AccountAge bean, but then the EJB cannot pass this bean onto
>the client because RMI needs to use Serializable objects.
>
>Hope this is clear
>
>Thanks again
>Clinton
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
>For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
>

-- 
 - Doug