Forums Register Login

JAXB with JAX-RPC1.1+ EJB

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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).
+Pie Number of slices to send: Send
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
An elephant? An actual elephant. Into the apartment. How is the floor still here. Hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1420 times.
Similar Threads
Does jaxws 2.0 use JAXB for java object serialization?
java objects to xml streams in pipe
Problem with Jaxb marshalling inside EJB
JAXB - Ordering of elements in generated XML
scdjws query
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:19:37.