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 Faheem Sohail <fa...@techlogix.com> on 2007/02/12 08:32:44 UTC

Hibernate and Axis

I am using try to expose hibernate generated BOs via webservices to Java
webservice clients. I want to use the same BOs on both the server and
client side. However, apache axis's java2wsdl converts Set to Object[]
thus creating a new object on the client side. Also, in most cases, the
webservice doesn't deploy at all if it has a Set definition in it. I
want to avoid writing a DTO layer. Any ideas?
 
 

Re: Hibernate and Axis

Posted by Kris Latham <kr...@gmail.com>.
I avoid a DTO layer in web applications, but I ended up using a DTO
layer for Hibernate with Axis2.

It turned out to be faster to do it that way than try to do a
work-around.  For my setup, the Hibernate BOs get mapped into DTOs,
and the DTOs are passed back to the web service layer which then
copies the data into XML Beans.  That's two copies of data being made,
but I end up with a business logic/persistence layer that is massively
reusable and neatly wrapped up in a jar file.

You could pass back Hibernate BOs directly, and just use XML Beans as
your DTOs.. but I think you will still have to make copies of the
persisted objects to avoid problems with those objects having their
session closed.  (I.e. still be able to use lazy loading if you
already are)

If you start putting Hibernate specific logic into your web service
layer code, I think you will regret it later.

On 2/12/07, Anne Thomas Manes <at...@gmail.com> wrote:
> Write a DTO layer. Web services is a loosely coupled system. You
> should not be attempting to use the same BOs on client and server.
>
> On 2/12/07, Faheem Sohail <fa...@techlogix.com> wrote:
> >
> >
> >
> >
> > I am using try to expose hibernate generated BOs via webservices to Java
> > webservice clients. I want to use the same BOs on both the server and client
> > side. However, apache axis's java2wsdl converts Set to Object[] thus
> > creating a new object on the client side. Also, in most cases, the
> > webservice doesn't deploy at all if it has a Set definition in it. I want to
> > avoid writing a DTO layer. Any ideas?
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


Re: Hibernate and Axis

Posted by Anne Thomas Manes <at...@gmail.com>.
Write a DTO layer. Web services is a loosely coupled system. You
should not be attempting to use the same BOs on client and server.

On 2/12/07, Faheem Sohail <fa...@techlogix.com> wrote:
>
>
>
>
> I am using try to expose hibernate generated BOs via webservices to Java
> webservice clients. I want to use the same BOs on both the server and client
> side. However, apache axis's java2wsdl converts Set to Object[] thus
> creating a new object on the client side. Also, in most cases, the
> webservice doesn't deploy at all if it has a Set definition in it. I want to
> avoid writing a DTO layer. Any ideas?
>
>
>
>

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