Java Reference
In-Depth Information
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Once you have used SAAJ to create a SOAP message structure, you can send requests
and receive responses using a SOAPConnection object. SAAJ connections are based on the
java.net.URL class, which is extendable to support any network protocol.
Like email messages, SOAP envelopes may also contain attachments of any type of document
(XML, binary image, or any valid MIME type). The SAAJ API allows you to work with such
attachments as well.
You can read more about SAAJ at https://saaj.dev.java.net .
Relation to JAX-M
You may have heard of the JAX-M API. The Java API for XML Messaging was released
in December 2001 as JSR-67. By June of 2002, the SAAJ API was born as a spin-off
project from that original JAX-M 1.0 specification. The classes in JAX-M are all in the
javax.xml.messaging package. JAX-M is no longer maintained.
SAAJ and JAX-WS
This chapter shows you how to perform common and useful tasks with the SAAJ API. Be-
cause it is a foundational layer, I thought it would be helpful to illustrate how to work with it,
and it should help you get familiar with SOAP exchanges, so you'll know what's happening
under the hood once you start working with JAX-WS later in this topic. That having been said,
nowadays it's frequently not necessary to work with SOAP at this lower level, and most of the
things you'd want to do in SAAJ are all wrapped as domain objects for you in JAX-WS.
From a practical standpoint, using SAAJ means that you don't use tools such as wsimport or
wsdl2java . Those are for use with JAX-WS, and are the means by which a client can generate
domain objects and operate almost as if they weren't using web services at all. With SAAJ,
you have no domain view of a service. You're really working with the plumbing. Develop-
ment with JAX-WS can be much quicker and easier, and generally doesn't cause you any loss
in control. But JAX-WS is a convenience layer, and it can be comforting to know that if you
wield some command of SAAJ, you'll be ready to do anything that a WSDL interface requires
of you.
Search WWH ::




Custom Search