background image

Overview of SAAJ

<< 5. SOAP with Attachments API for Java | What Is in a Message >>
<< 5. SOAP with Attachments API for Java | What Is in a Message >>
118
SOAP
WITH
A
TTACHMENTS
API
FOR
J
AVA
Note: The
javax.xml.messaging
package, defined in the Java API for XML Mes-
saging (JAXM) 1.1 specification, is not part of the Java EE platform and is not dis-
cussed in this chapter. The JAXM API is available as a separate download from
http://java.sun.com/xml/jaxm/
.
This chapter starts with an overview of messages and connections, giving some
of the conceptual background behind the SAAJ API to help you understand why
certain things are done the way they are. Next, the tutorial shows you how to use
the basic SAAJ API, giving examples and explanations of the commonly used
features. The code examples in the last part of the tutorial show you how to build
an application.
Overview of SAAJ
This section presents a high-level view of how SAAJ messaging works and
explains concepts in general terms. Its goal is to give you some terminology and
a framework for the explanations and code examples that are presented in the
tutorial section.
The overview looks at SAAJ from two perspectives: messages and connections.
Messages
SAAJ messages follow SOAP standards, which prescribe the format for mes-
sages and also specify some things that are required, optional, or not allowed.
With the SAAJ API, you can create XML messages that conform to the SOAP
1.1 or 1.2 specification and to the WS-I Basic Profile 1.1 specification simply by
making Java API calls.
The Structure of an XML Document
An XML document has a hierarchical structure made up of elements, subele-
ments, subsubelements, and so on. You will notice that many of the SAAJ
classes and interfaces represent XML elements in a SOAP message and have the
word element or SOAP (or both) in their names.
An element is also referred to as a node. Accordingly, the SAAJ API has the
interface
Node
, which is the base class for all the classes and interfaces that rep-