File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes WebService for JPA Domain model dilemma Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WebService for JPA Domain model dilemma" Watch "WebService for JPA Domain model dilemma" New topic

WebService for JPA Domain model dilemma

Vrunda Bapat

Joined: Jul 16, 2007
Posts: 3
This is a WebService Design question really.
I have a Domain model - with Spring (3.2) - Hibernate(3.2)-doing it's Spring injected JPA magic to create Entity objects with one to many relationship.
e.g . - Manager has one to many Relationship with Employee
I need to expose some functionality as a WebService.
So I introduced Facade to expose entity beans as WebService.
I am new to Web Services -
For Web Service my choice is AXIS2 - SOAP - Jibx(for complex objects mapping into XML)
  • When SOAP response is simple Object -Web Service rerurns the response
    Problem is with Complex Object returns (Object within Object- generated with relational mapping)
    For Complex Object return - SOAP response is null
    Tried converting List(or collection objects) to Array

  • Still for Complex Objects(generated with relational mapping) return - no response!

    Now my real question is - Is it a good idea to expose JPA entity beans (even via Facade) as a WebService?
    If not , why?
    If yes, what do I need to do to marshall/Unmarshall my complex java objects to produce XML mapping?
    Shouln't use of JibX help with mapping the Java Objects to XML schema , in this case?
    Please throw some light.


    I agree. Here's the link:
    subject: WebService for JPA Domain model dilemma
    It's not a secret anymore!