Version 4

    JAX-WS Annotations

    For details, see JSR-224 - Java API for XML-Based Web Services (JAX-WS) 2.0

     

    javax.xml.ws.ServiceMode

    The ServiceMode annotation is used to specify the mode for a provider class, i.e. whether a provider wants to have access to protocol message payloads (e.g. a SOAP body) or the entire protocol messages (e.g. a SOAP envelope).

     

    javax.xml.ws.WebFault

    The WebFault annotation is used when mapping WSDL faults to Java exceptions, see section 2.5. It is used to capture the name of the fault element used when marshalling the JAXB type generated from the global element referenced by the WSDL fault message. It can also be used to customize the mapping of service specific exceptions to WSDL faults.

     

    javax.xml.ws.RequestWrapper

    The RequestWrapper annotation is applied to the methods of an SEI. It is used to capture the JAXB generated request wrapper bean and the element name and namespace for marshalling / unmarshalling the bean. The default value of localName element is the operationName as defined in WebMethod annotation and the default value for the targetNamespace element is the target namespace of the SEI.When starting from Java, this annotation is used to resolve overloading conflicts in document literal mode. Only the className element is required in this case.

     

    javax.xml.ws.ResponseWrapper

    The ResponseWrapper annotation is applied to the methods of an SEI. It is used to capture the JAXB generated response wrapper bean and the element name and namespace for marshalling / unmarshalling the bean. The default value of the localName element is the operationName as defined in the WebMethod appended with ”Response” and the default value of the targetNamespace element is the target namespace of the SEI. When starting from Java, this annotation is used to resolve overloading conflicts in document literal mode. Only the className element is required in this case.

     

    javax.xml.ws.WebServiceClient

    The WebServiceClient annotation is specified on a generated service class (see 2.7). It is used to associate a class with a specific Web service, identify by a URL to a WSDL document and the qualified name of a wsdl:service element.

     

    javax.xml.ws.WebEndpoint

    The WebEndpoint annotation is specified on the getPortName() methods of a generated service class (see 2.7). It is used to associate a get method with a specific wsdl:port, identified by its local name (a NCName).

     

    javax.xml.ws.WebServiceProvider

    The WebServiceProvider annotation is specified on classes that implement a strongly typed javax- .xml.ws.Provider. It is used to declare that a class that satisfies the requirements for a provider (see 5.1) does indeed define a Web service endpoint, much like the WebService annotation does for SEI-based endpoints.

    The WebServiceProvider and WebService annotations are mutually exclusive.

     

    javax.xml.ws.BindingType

    The BindingType annotation is applied to an endpoint implementation class. It specifies the binding to use when publishing an endpoint of this type.

    The default binding for an endpoint is the SOAP 1.1/HTTP one

     

    javax.xml.ws.WebServiceRef

    The WebServiceRef annotation is used to declare a reference to a Web service. It follows the resource pattern exemplified by the javax.annotation.Resource annotation in JSR-250 [32]. The WebServiceRef annotation is required to be honored when running on the Java EE 5 platform, where it is subject to the common resource injection rules described by the platform specification [33].

     

    javax.xml.ws.WebServiceRefs

    The WebServiceRefs annotation is used to declare multiple references to Web services on a single class. It is necessary to work around the limition against specifying repeated annotations of the same type on any given class, which prevents listing multiple javax.ws.WebServiceRef annotations one after the other. This annotation follows the resource pattern exemplified by the javax.annotation.Resources annotation in JSR-250.

    Since no name and type can be inferred in this case, each WebServiceRef annotation inside a WebServiceRefs MUST contain name and type elements with non-default values. The WebServiceRef annotation is required to be honored when running on the Java EE 5 platform, where it is subject to the common resource injection rules described by the platform specification.

     

    javax.xml.ws.Action

    The Action annotation is applied to the methods of a SEI. It used to generate the wsa:Action on wsdl:input and wsdl:output of each wsdl:operation mapped from the annotated methods.

     

    javax.xml.ws.FaultAction

    The FaultAction annotation is used within the Action annotation to generate the wsa:Action element on the wsdl:fault element of each wsdl:operation mapped from the annotated methods.

     

    Annotations Defined by JSR-181

    JSR-181 defines the syntax and semantics of Java Web Service (JWS) metadata and default values.

    For details, see JSR 181 - Web Services Metadata for the Java Platform

     

    javax.jws.WebService

    Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.

     

    javax.jws.WebMethod

    Customizes a method that is exposed as a Web Service operation.

     

    javax.jws.OneWay

    Indicates that the given web method has only an input message and no output. Typically, a oneway method returns the thread of control to the calling application prior to executing the actual business method. A JSR-181 processor is REQUIRED to report an error if an operation marked @Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.

     

    javax.jws.WebParam

    Customizes the mapping of an individual parameter to a Web Service message part and XML element.

     

    javax.jws.WebResult

    Customizes the mapping of the return value to a WSDL part and XML element.

     

    javax.jws.SOAPBinding

    Specifies the mapping of the Web Service onto the SOAP message protocol.

    The SOAPBinding annotation has a target of TYPE and METHOD. The annotation may be placed on a method if and only if the SOAPBinding.style is DOCUMENT. Implementations MUST report an error if the SOAPBinding annotation is placed on a method with a SOAPBinding.style of RPC. Methods that do not have a SOAPBinding annotation accept the SOAPBinding behavior defined on the type.

     

    javax.jws.HandlerChain

    The @HandlerChain annotation associates the Web Service with an externally defined handler chain.

    It is an error to combine this annotation with the @SOAPMessageHandlers annotation.

    The @HandlerChain annotation MAY be present on the endpoint interface and service implementation bean. The service implementation bean's @HandlerChain is used if @HandlerChain is present on both.

    The @HandlerChain annotation MAY be specified on the type only. The annotation target includes METHOD and FIELD for use by JAX-WS-2.0.