Apr 18th, 2011, 05:26 PM
So I'm trying to do some unification work on an existing project that I just got thrown into. SOAP messages are being constructed and then sent along to their various destinations via Apache Camel routes.
Anyway, parts of the code create and work with SOAP messages using the implementation found in the javax.xml.soap package. Other parts of the code are using the libraries in the org.springframework.ws.soap.saaj package. Everything is pretty disparate right now, and I'm trying to refactor the code to make it uniform, and to then utilize a messagefactory object as a spring bean.
My question is... why would I choose one implementation over the other? And a better question might be... why don't they share a common interface so that I can swap in different implementation beans via spring xml configuration?
Apr 18th, 2011, 05:52 PM
MessageFactories do share a common interface (WebServiceMessageFactory) and you can choose the implementation you want to use by configuring the appropriate been in the application context.
For more details check out http://static.springsource.org/sprin...sage-factories
Apr 18th, 2011, 06:06 PM
Thanks for that link. It was actually very helpful, including for a few other things I was thinking about.
Anyway, what I meant about common interfaces is this... How come, for example, the SaajSoapMessageFactory doesn't share a common interface with the implementation found in the javax.xml.soap package? Is the second one old or becoming deprecated? Or are there any specific reasons to not use it with Spring?