Announcement Announcement Module
No announcement yet.
MessageFactory Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MessageFactory

    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 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?



  • #2
    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


    • #3
      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?