Java Reference
In-Depth Information
APIisassignedpackage
javax.xml.bind
andvarioussubpackages.Java7
supports JAXB 2.2.4.
•
Soap with Attachments API for Java (SAAJ)
: The API for creating, sending,
andreceivingSOAPmessageswith/withoutattachments.AccordingtoJitendra
Kotamraju's “No SAAJ RI dependency in JAX-WS RI” blog post at
ht-
no_saaj_ri_depe_1.html
, JAX-WS's dependency on SAAJ for SOAP
messages was removed in the reference implementation of JAX-WS 2.1.3
the
javax.xml.soap
package. Java 7 supports SAAJ 1.3.
IwillexploreJAX-WSandSAAJinthischapter,but(forbrevity)won'tbeexploring
JAXB.IfyouwantadetailedtutorialonthisAPI,Irecommendthatyoucheckoutthe
Web Service Annotations
Java6introducedseveralwebserviceannotationtypesthatfacilitatewebservicedevel-
opment,bylettingyoudescribewebservicesdeclarativelyviametadata—see
Chapter
3
for an introduction to annotations. You can still develop web services without these
annotation types, but you'll soon appreciate their convenience if you decide not to use
them.
MostwebserviceannotationtypesareeitherpartoftheWebServicesMetaDataAPI
javax.jws.soap
, or belong to the
javax.xml.ws
package. The
javax.jws
package provides the following annotation types:
•
HandlerChain
associatesthewebservicewithanexternallydefinedhandler
chain.I'lldiscusshandlerchainsfromtheclientperspectivelaterinthischapter.
•
Oneway
indicates that a given
@WebMethod
annotation has only an input
message and no output message.
•
WebMethod
customizes a method that is exposed as a web service operation.
•
WebParam
customizes the mapping of an individual parameter to a WSDL
message
element's
part
element.
•
WebResult
customizesthemappingofthereturnvaluetoaWSDL
message
element's
part
element.
•
WebService
marksaJavaclassasimplementingawebservice,oraJavain-
terface as defining a service endpoint interface.