Any news about soap handling in Java?
I've worked with Axis and Saaj for a few years, then I switched to spring-ws, which I prefer because it's more xml-oriented. Then I switched all my projects to axiom due to a serious performance problem with saaj. I've experienced some problems again later, especially related to namespace handling (AXIOM-114 and SWS-502), anyway I've been working with spring-ws and axiom for two years.
Since I'm not completely satisfied, I'm actually looking for any other libraries. Any suggestions?
I know google is my best friend, but this is a delicate matter, so I'd like to know your experience. Actually, what's the best library to handle soap messages in Java?
I could write my own library based on my needs, but I think this is not too easy and I don't like to reinvent the wheel. I just would like to rely on a library which 开发者_开发百科correctly handles well formed xml, namespaces declaration, multiple levels of nested xml, and so on.
I'm actually looking for any other libraries. Any suggestions?
Well, SAAJ is still SUN's specification to handle SOAP (with attachments).
The reference implementation uses DOM so if you exchange big messages you would see memory issues.
Other frameworks that support soap-based web services besides axis and spring (that you have already worked with) is cxf.
Axis uses axiom for the xml handling and has an implementation of SAAJ that I think it is not DOM-based. So better memory usage for large messages is expected.
CXF uses by default the build-in java saaj implementation but can also support axis2-saaj
CXF FAQ
Last but not least is the JAX-WS (also relies on SAAJ).
Both CXF and JAX-WS allow you to work directly on the xml level.
This is pretty much the most popular frameworks for soap web services in java (If I forgot something I hope someone will come in and inform).
what is the best library to handle soap messages in Java?
Hard to tell since this is pretty broad question.
Generally speaking the most popular frameworks are Axis2 and CXF (this is my personal understanding).
IMHO all the libraries have the problem that they are too "sensitive" on input i.e. namespaces etc.
On occassion that the developer needs a more relaxed parsing, this is not easy to get.
JAX-WS (and the reference implementation, aka Metro) uses data binding and stub generation to make SOAP calls, similar to how .NET generally does it.
JAX-WS is probably the recommended way to go unless you have specific needs that make data binding unfeasible.
精彩评论