InfoQ

News

SAAJ - Fine in Theory, Broken in Practice?

Posted by Stefan Tilkov on May 19, 2008 10:42 AM

Community
Java,
SOA
Topics
Web Services
Tags
SOAP,
XML,
Spring,
Spring Web Services

SAAJ, the SOAP with Attachments API for Java™, is the standard API used by Java Web services developers to work directly with a SOAP message. Since version 1.2, the SAAJ javax.xml.soap interfaces extend the appropriate DOM interfaces, enabling developers to use standard JAXP processing to create or work with an XML payload that is sent or received using SOAP.

Unfortunately, many application servers seem to support SAAJ 1.2 only half-heartedly. Spring Web Services lead developer Arjen Poutsma has written a small test that uses SAAJ to create a SOAP message and DOM to create the body, and Geronimo, JBoss, OC4J and Weblogic all failed to process it correctly (see Arjen’s blog post for the table with details).

Developers who prefer to work with XML directly instead of relying on a databinding technology (such as JAXB, XMLBeans or Castor) have a wide variety of choices in terms of which XML API they want to use (including JDOM, XOM, dom4j, or the Axis2 Axiom library). Sadly, the only one of these that is standardized is DOM, which apart from being cumbersome to use does not provide the portability one would expect in this case.

What is your preferred way to work with SOAP messages in Java? Did you run into the problem Arjen describes?

No comments

Reply

Exclusive Content

Rationalizing the Presentation Tier

Thin client paradigm characterized by web applications is a kludge that needs to be repudiated. Old compromises are no longer needed and it's time to move the presentation tier to where it belongs.

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.