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?
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?
posted 11 years ago
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.
posted 11 years ago
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))
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
We can walk to school together. And we can both read this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database