Java Reference
In-Depth Information
pondstotheSOAP1.1namespacethatprovidestheschemaforSOAPenvelopes.The
xsd
and
xsi
prefixescorrespondtotheXMLSchemastructuresandXMLSchemaIn-
stancenamespaces,andareusedtodenotetheXMLSchematypethatdescribesthekind
of data being passed to
getTitle()
(a string) via the
isbn
element.
Theempty
Header
elementsignifiesthatthereisnoSOAPheader.Incontrast,the
Body
element identifies a single
getTitle
operation request.
The
getTitle
element is namespace-qualified, as recommended by the SOAP
1.1 and 1.2 specifications. In contrast, the
isbn
child element of
getTitle
is not
namespace-qualified because it inherits
getTitle
's namespace —the SOAP 1.1 and
1.2 specifications do not mandate that such child elements be namespace-qualified.
SAAJ API Overview
SAAJ is a small API that lets you perform the following tasks:
• Create an endpoint-to-endpoint connection
• Create a SOAP message
• Create an XML fragment
• Add content to the header of a SOAP message
• Add content to the body of a SOAP message
• Create attachment parts and add content to them
• Access/add/modify parts of a SOAP message
• Create/add/modify SOAP fault information
• Extract content from a SOAP message
• Send a SOAP request-response message
SAAJ is associated with the
javax.xml.soap
package, which contains 14 in-
terfaces and 13 classes. Various interfaces and classes extend their counterparts in the
org.w3c.dom
package,implyingthatpartofaSOAPmessageisorganizedasatree
of nodes.
ThefollowingclassesandinterfacesareusedtospecifythestructureofaSOAPmes-
sage:
•
SOAPMessage
represents the entire SOAP message. It contains a single
SOAPPart
instance and zero or more
AttachmentPart
instances.
•
SOAPPart
containsa
SOAPEnvelope
instance,whichrepresentstheactual
SOAP
Envelope
element.