Java Reference
In-Depth Information
Figure 11-8. A three-dimensional pie chart image is returned from Google's RESTful Charts web
service.
Note Visit http://www.programmableweb.com/apis/directory/ to
discover additional examples of RESTful and SOAP-based web services.
Advanced Web Service Topics
NowthatthebasicsofcreatingandaccessingSOAP-basedandRESTfulwebservices
areoutoftheway,you'reprobablyreadyformoreadvancedmaterial.Thissectionin-
troduces five advanced web service topics.
YoufirstreceiveanintroductiontotheSAAJAPIforworkingwithSOAP-basedweb
services at a lower level. You then learn how to create a JAX-WS handler to log the
flowofSOAPmessages.Next,youlearnhowtocreateandinstallacustomlightweight
HTTPservertoperformauthentication,andalsolearnhowtocreateaRESTfulwebser-
vicethatreturnsattachments (e.g.,aJPEGimage)toitsclients. Finally,youdigdeep-
erintoJAX-WSbyexploringtheinterplaybetweenprovidersanddispatchclients,and
learnhowtocreate adispatch client thataccesses the Source instance returnedfrom
awebserviceprovider's invoke() methodviaadifferent Source instanceinanal-
ternate Library client application.
Working with SAAJ
SoapwithAttachmentsAPIforJava(SAAJ)istheJavaAPIforcreating,sending,and
receiving SOAP messages that may or may not have MIME-typed attachments. SAAJ
is a lower-level alternative to JAX-WS for sending and receiving SOAP messages.
AfterpresentinganoverviewofSOAPmessagearchitecture,Itakeyouonatourof
SAAJ. When this tour finishes, I present an application that uses this API to access a
SOAP-based web service for converting between integer values and Roman numerals.
This application reinforces your understanding of SAAJ.
SOAP Message Architecture
A SOAP message is an XML document sent from an initial SOAP sender node to an
ultimateSOAPreceivernode,mostlylikelypassingthroughintermediateSOAPsender/
receivernodesalongitspath.ASOAPnodeisprocessinglogicthatoperatesonaSOAP
message.
Search WWH ::




Custom Search