|
Solve SOA Integration Problems with SAAJ
The SAAJ API proves its mettle in the SOA and integration space
by Anbarasu Krishnaswamy
October 13, 2004
As service-oriented architecture (SOA) and service-oriented integration (SOI) see widespread adoption, one need has become obvious: businesses need to integrate systems and allow consumers to access services using a standards-based approach. SOA is an architecture paradigm where reusable business logic is exposed as a collection of services with standards-based, well-defined interfaces and accessed in a loosely coupled fashion. SOA has gained popularity in solving enterprise integration problems because of vendor support of the Web services standards and the relative ease of integrating disparate systems using this standards-based software.
Java-based middleware and enterprise application integration (EAI) products have been available for a while now, and many companies use this technology in some form or another. Although services are being developed and provided on the Java platform, there is also a subtle need to consume services from Java-based applications. SOAP with Attachments API for Java (SAAJ) helps the consumption of services by offering a standard API to access services.
Several Java-based APIs are available to access services. Some of these include SAAJ, Java API for XML-based RPC (JAX-RPC), and the Web Services Invocation Framework (WSIF). SAAJ provides APIs to build service consumers as well as providers. Let's take a look at how to use SAAJ to develop consumers of Web services in SOA. We will demonstrate a WebLogic Integration composite process that orchestrates a service to get zip code by city, a service to get the temperature for the zip code, and a sample SAAJ client that consumes that service.
What is SAAJ?
SAAJ is an API specification to implement XML-based messaging using the SOAP protocol in loosely coupled software systems. As the name suggests, it supports SOAP messages with attachments.
Many of you have heard about Java API for XML Messaging (JAXM) and may be wondering what happened to it. The idea behind JAXM 1.0 was to enable developers to write business applications that support messaging standards based on SOAP by providing messaging and SOAP APIs. As JAXM evolved to version 1.1, the SOAP APIs (javax.xml.soap) were separated into SAAJ 1.1 specifications and JAXM 1.1, which contains only messaging-based APIs (javax.xml.messaging). The current version of SAAJ is 1.2. WebLogic Server 8.1 SP2 supports SAAJ 1.1 specifications.
SAAJ 1.2 API primarily has the javax.xml.soap package, which provides abstraction for SOAP messages with Multipurpose Internet Mail Extensions (MIME) attachments. This API provides methods to create point-to-point connections to end points, to create and manipulate SOAP messages and attachments, and to receive and manipulate SOAP faults.
Although you have several technology choices when developing enterprise applications, some are better suited for specific problems. It is important to choose the right tool.
What are some reasons for choosing SAAJ? It is naturally suited for document-based Web services that are either synchronous or asynchronous. It is also simple to use, it helps you integrate with any Web service from the Java world, and it extends natural support for document-style Web service communication. It also supports XML messaging over a standards-based interface and is, itself, widely supported by vendors.
Back to top
|