Академический Документы
Профессиональный Документы
Культура Документы
@WebService
• The “@WebService” should be placed on an interface and a class that is intended
to be used as a service. It has the following attributes.
name: Specifies the name of the service interface and is mapped to the name
attribute of the wsdl:portType element in a WSDL contract document.
targetNamespace: Specifies the target namespace under which the service is
defined.(Default value is package name).
serviceName: Specifies the name of the published service. This property is
mapped to the name attribute of the wsdl:service element in WSDL document.
(Default value is name of SEI implementation class. This attribute is used in
implementation class).
wsdlLocation: Specifies the URI at which the service’s WSDL contract is stored.
(Default value is the URI at which the service is deployed).
endpointInterface: Specifies the full name of the SEI that the implementation
class implements.(This attribute is used in implementation class).
portName: The name of the endpoint at which the service is published and is
mapped to the name attribute of the wsdl:port element in WSDL contract
document.(Default value is the append Port to the name of the service’s
implementation class. This is used in implementation class).
• The service implementation class is annotated with @webservice and can include
additional attributes such as endpointInterface, portName , serviceName etc.
The @SOAPBinding annotation
• By default the JAX-WS runtime engine uses the
wrapped doc/literal SOAP binding if you don’t specify
any. To specify the required SOAP binding you can use
the @SOAPBinding annotation. You can
add @SOAPBinding annotation to the SEI and its
methods. The latter takes precedence if you use both.
You can read more about SOAP Binding styles. The
following are the attributes of @SOAPBinding
annotation.
• style: The values can be either DOCUMENT or RPC
• use: The values can be LITERAL or ENCODED
• parameterStyle: The value can be BARE or WRAPPED.
The @WebMethod annotation
• You need to add the @WebMethod annotation provides
the information that is normally represented in the
wsdl:operation element in WSDL. This indicates the
operation to which the method is associated.
• operationName: Indicates the value of the associated
wsdl:operation element’s name. (Default value is the
name of the method).
• action: This attribute specifies the value of the soapAction
attribute of the soap:operation element for the method in
WSDL. (Default value is an empty string).
• exclude: Specifies whether the method should be
excluded from the service interface.(Default is false. But it
is recommended that the SEI ideally should contain only
the required methods which are required to be published).
The @RequestWrapper and
@ResponseWrapper annotations
• These annotations are placed on the methods in
service endpoint interface.
The @RequestWrapperspecifies the Java class that
implements the wrapper bean for the method
parameters that are included in the request message
sent in a remote invocation and
the @ResponseWrapper specifies the Java class that
implements the wrapper bean for the method
parameters that are included in the response message
sent in a remote invocation.
These annotations have localName,
targetNamespace and className attributes and
only classNameis mandatory.
The @WebFault annotation