This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JAXB with JAX-RPC1.1+ EJB  RSS feed

 
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
 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!