You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mike Zatko <mz...@boscovs.com> on 2005/04/04 21:51:07 UTC

Axis design question and serializers

I have a facade that I want to open up as a webservice and one of the 
methods in the facade returns a rather complex bean. (It is an Order 
object which contains collections of SubOrders and OrderItems and so on) 
I use the Java2WSDL application and generate a wsdl based off of this 
facade.  Then I take the wsdl and use the WSDL2Java tool which builds 
all the server code as well as regenerates my beans into soap friendly 
form. This leaves me with essentially two sets of the same beans in 
different form.

Now, in order for this system to work, I would have to implement a 
translation layer to make new soap friendly beans out of my normal beans 
and vice versa. This method doesn't seem right, so I've been looking at 
the BeanSerializer. I am guessing that the BeanSerializer would allow me 
to use my normal beans with axis, and have them serialized to the soap 
friendly version on the fly. So, my first question, is what I am saying 
correct?

My second question is that I cannot find any documentation on 
serializing. The user guide has an incomplete section on this and the 
encoding example is somewhat daunting for an axis newbie. I am sorta in 
a cloudy position on what I should be doing, so any help would be 
appreciated. Thanks.

Re: Axis design question and serializers

Posted by Anne Thomas Manes <at...@gmail.com>.
It's a bad idea to try to expose collections through SOAP. Create a
facade for your facade that exposes arrays rather than collections.

Anne

On Apr 4, 2005 3:51 PM, Mike Zatko <mz...@boscovs.com> wrote:
> I have a facade that I want to open up as a webservice and one of the
> methods in the facade returns a rather complex bean. (It is an Order
> object which contains collections of SubOrders and OrderItems and so on)
> I use the Java2WSDL application and generate a wsdl based off of this
> facade.  Then I take the wsdl and use the WSDL2Java tool which builds
> all the server code as well as regenerates my beans into soap friendly
> form. This leaves me with essentially two sets of the same beans in
> different form.
> 
> Now, in order for this system to work, I would have to implement a
> translation layer to make new soap friendly beans out of my normal beans
> and vice versa. This method doesn't seem right, so I've been looking at
> the BeanSerializer. I am guessing that the BeanSerializer would allow me
> to use my normal beans with axis, and have them serialized to the soap
> friendly version on the fly. So, my first question, is what I am saying
> correct?
> 
> My second question is that I cannot find any documentation on
> serializing. The user guide has an incomplete section on this and the
> encoding example is somewhat daunting for an axis newbie. I am sorta in
> a cloudy position on what I should be doing, so any help would be
> appreciated. Thanks.
>