SOAP
In the first chapter, we discussed several distributed object protocols and compared them to SOAP. Although it is not possible to cover all protocols, we now have a good idea of where SOAP stands: it is a
simple XML-based protocol that supports RPC and messaging, primarily over HTTP. In this chapter,
we will look at SOAP in more detail.
To broaden our understanding of SOAP and how the Apache framework implements this protocol, we will follow the organization of the SOAP specification. However, this chapter is meant to be an
introduction to SOAP, not a reference. For an authoritative guide, you should always refer back to the
SOAP 1.1 specification.
The SOAP 1. 1 specification can be found at http://www.w3c.org/TR/SOAP/, and the salient
points are contained in Appendix A.
While we are looking through the SOAP specification, we will point out features that are either partially
supported or not implemented in the Apache SOAP framework. The comprehensive list of what is and
is not supported can be found at http://xml.apache.org/soap/features.html. The list of known
interoperability issues with the Apache SOAP framework can be found at http://xml.apache.org/soap/docs/guide/interop.html.
Before getting into the specifics of SOAP, we will first have a look at the technologies that constitute
its foundation.
We will then describe the anatomy of a SOAP packet:
- The SOAP envelope
- The SOAP header
- The SOAP body
- The SOAP fault
We will primarily focus on HTTP as the transport for SOAP packets.
We will then talk more specifically about the SOAP header and the SOAP envelope – this carries a
request, a response, or a fault – and then we will discuss each of these in detail. In the course of this
discussion, we will introduce the important topic of encoding and XML metadata.
Core Technologies
One of the design goals of SOAP is to be an open technology, from both a platform and a programming
language point of view. The SOAP architects decided to meet this requirement by leveraging as many
existing technologies as possible rather than inventing new ones.
For you, the SOAP developer, this means that you must be familiar with a variety of web technologies
before being able to understand the SOAP specification. In no particular order, those technologies are:
- HTTP
- XML
- XML Namespaces
- XML Schemas
In addition, you must also be familiar with the prerequisites that we mentioned in the introduction to
this book: basic object-oriented concepts and Java. We will introduce these core web technologies in the
following sections. If you are already familiar with some or all of them, feel free to skip those sections
and go directly to the SOAP section.
We will first talk about the protocol closest to the bits that travel over the wire: HTTP.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|