• Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB with JAX-RPC1.1+ EJB

 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JAXB frame work to marshall and unmarshal the xml document and its being done in my stateless session ejb( when method is invoked) is it the right way to implement or should I unmarshall/marshall before hand if so how?

Thanks All
E
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does the session bean exist?
It would be pretty inconvenient for an EJB client with Java object parameters to be forced to convert them to XML first.
Is that situation likely to arise?

If you don't have any EJB clients why choose implement a web service as an EJB endpoint?
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Peer,

I chose EJB endpoint because , it offers lifecycle management( I donot have to write them) for the bean and also transaction support for JDBC. In my case the .net client calling this ejb based endpoint using SOAP.

Thanks
E
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you do not plan to have EJB clients I guess it's OK to do the unmarshalling/marshalling inside the bean though personally I would be inclined to look for a method to do it outside of the SLSB.

Declarative transaction control is of course one of the reasons for choosing an ejb - however Spring was created (initially as Interface21) to give you another option (I think they also have JDBC templates).

If it turns out that you need more "control" you can always implement the endpoint as a servlet endpoint that does the unmarshalling/marshalling and then calls your regular SLSB. Servlet-based endpoints have the one advantage that you should be able to get a hold of the HTTP-headers if the need arises.

(I hope you are not counting on the transactions spanning multiple WS calls - that would require WS-Coordination/WS-Transaction support (Web services transactions))

Servlet based endpoints have service lifecycle management methods - to get access to them you need to implement the javax.xml.rpc.server.ServiceLifecycle interface (ServiceLifecycle).
 
Ephraim Paka
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peer,

I know I would want to do it out side the SLSB( like in Handlers), but its one the solutions/patterns that SUN web site proposed. Also my services are pretty statesless , non-chatty, discrete single transaction calls , thats one of the reasons I chose JDBC ( I may go with iBatis). I like spring FW and used it with iBatis but in my case I donot think its necessary

Thanks
E
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!