@WebService |
This annotation marks either a Java class or a service endpoint interface (SEI)
as implementing a web service interface. Three
of the properties of the annotation can be used only with a service
endpoint implementation class for a JavaBeans endpoint.
These properties are serviceName, portName, and endpointInterface.
If the annotation references an SEI through the endpointInterface attribute,
then the SEI must also have the @WebService annotation.
By default,
all public methods in a class that specifies the @WebService annotation
are exposed in the web service.
|
- Annotation target: Type
- Properties:
- name
- The name of the wsdl:portType. The name property
maps to an SEI or a Java implementation
class. The default value is the unqualified name of the Java interface or class. (String)
- targetNamespace
- Specifies the XML namespace of the WSDL and XML elements that
are generated from the web service.
- If the @WebService.targetNamespace annotation is on a service
endpoint interface. The targetNamespace is used for the namespace
for the wsdl:portType (and associated XML elements).
- If the @WebService.targetNamespace annotation is on a service
implementation bean that does not reference a service endpoint interface
(through the endpointInterface annotation element), the targetNamespace
is used for both the wsdl:portType and the wsdl:service (and associated
XML elements).
- If the @WebService.targetNamespace annotation is on a service
implementation bean that does reference a service endpoint interface
(through the endpointInterface annotation element), the targetNamespace
is used for only the wsdl:service (and associated XML elements).
The default value is the namespace that is mapped from the
package name that contains the web service. (String)
- serviceName
- Specifies the service name of the web service: wsdl:service.
This property is not allowed on endpoint interfaces. The default value
is the simple name of the Java class
+ Service. (String)
- endpointInterface
- Specifies the qualified name of the service endpoint interface
that defines the services' abstract web service contract. If specified,
the service endpoint interface is used to determine the abstract WSDL
contract. (String)
- portName
- The wsdl:portName. The portName property
is the name of the endpoint port. The default value is WebService.name
+Port . (String)
- wsdlLocation
- Specifies the web address of the WSDL document that defines the
web service. The web address is either relative or absolute. (String)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({TYPE})
public @interface WebService{
String name() default “”;
String targetNamespace() default “”;
String serviceName() default “”';
String wsdlLocation() default “”;
String endpointInterface() default “”;
String portName() default “”;
};
|
@WebMethod |
This annotation denotes a method that is a web
service operation. You can apply this annotation to public methods
in a client or server Service Endpoint Interface (SEI), or in a service
endpoint implementation class for a JavaBeans endpoint.
The @WebMethod annotation is only supported
on classes that have the @WebService annotation.
|
- Annotation target: Method
- Properties:
- operationName
- Specifies the name of the wsdl:operation that
matches this method. The default value is the name of the Java method. (String)
- action
- Defines the action for this operation. For SOAP bindings, this
value determines the value of the SOAPAction header. (String)
- exclude
- Specifies whether to exclude a method from the web service. This
property can be used only with an implementation class. Used to stop
an inherited method from being exposed as part of this web service.
If this element is specified, other elements must not be specified
for the @WebMethod. This property is not allowed on endpoint interfaces.
The
default value is false. (Boolean)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({TYPE})
public @interface WebMethod{
String operationName() default “”;
String action() default “”;
boolean exclude() default false;
};
|
@Oneway |
This annotation denotes a method as a one-way
operation for a web service. It has an input message but no output
message. This annotation can be used only on methods that have no
return value. You can apply this annotation to public methods in
a client or server Service Endpoint Interface (SEI), or in a service
endpoint implementation class for a JavaBeans endpoint.
|
- Annotation target: Method
- There are no properties on the OneWay annotation.
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({TYPE})
public @interface OneWay{
};
|
@WebParam |
This annotation customizes the mapping of an
individual parameter to a web service message part and XML element. You
can apply this annotation to public methods in a client or server
Service Endpoint Interface (SEI), or in a service endpoint implementation
class for a JavaBeans endpoint.
|
- Annotation target: Parameter
- Properties:
- name
- If the operation is remote procedure call (RPC) style and the partName attribute
is not specified, then this is the name of the wsdl:part attribute
that represents the parameter. If the operation is document style
or the parameter maps to a header, then name is the
local name of the XML element that represents the parameter. This
attribute is required if the operation is document style, the parameter
style is BARE, and the mode is OUT or INOUT.
If the partName attribute is specified, then the name attribute
is ignored. (String)
- partName
- Defines the name of wsdl:part attribute that
represents this parameter. Use this only if the operation is RPC style,
or the operation is document style and the parameter style is BARE.
(String)
- targetNamespace
- Specifies the XML namespace of the XML element for the parameter.
It applies only for document bindings when the attribute maps to an
XML element. The default value is the targetNamespace for
the web service. (String)
- mode
- The value represents the direction that the parameter flows for
this method. Valid values are IN, INOUT,
and OUT. (String)
- header
- Specifies whether the parameter is in a message header rather
than a message body. The default value is false.
(Boolean)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({PARAMETER})
public @interface WebParam{
public enum Mode{
IN,
OUT,
INOUT
};
String name() default “”;
String partName() default "";
String targetNamespace() default “”;
Mode mode() default Mode.IN
boolean header() default false;
};
|
@WebResult |
This annotation customizes how a return value
maps to a WSDL part or XML element. You can apply this annotation
to public methods in a client or server Service Endpoint Interface
(SEI), or in a service endpoint implementation class for a JavaBeans endpoint.
|
- Annotation target: Method
- Properties:
- name
- Specifies the name of the return value as it is listed in the
WSDL file and found in messages on the wire. For RPC bindings, this
is the name of the wsdl:part attribute that represents
the return value. For document bindings, the name parameter
is the local name of the XML element that represents the return value.
The default value is return for RPC and DOCUMENT/WRAPPED
bindings. The default value is the method name + Response for
DOCUMENT/BARE bindings. (String)
- targetNamespace
- Specifies the XML namespace for the return value. Use this annotation
only for document bindings when the return value maps to an XML element.
The default value is the targetNamespace for the web service. (String)
- header
- Specifies whether the result is carried in a header. The default
value is false. (String)
- partName
- Specifies the part name for the result with RPC or DOCUMENT/BARE
operations. The default value is @WebResult.name.
(Boolean)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({METHOD})
public @interface WebResult{
String name() default “return”;
String targetNamespace default() “”;
boolean header() default false;
String partName() default "";
};
|
@HandlerChain |
This annotation associates the web service to
an externally defined handler chain. You can use this annotation if
the handler configuration must be shared across multiple web services,
and embedding handler configuration in the application source is inefficient. Apply
this annotation to a client or server Service Endpoint Interface (SEI),
or to a service endpoint implementation class for a JavaBeans endpoint.
|
- Annotation target: Type
- Properties:
- file
- Specifies the location of the handler chain file. The file location
is either an absolute java.net.URL in external form or a relative
path from the source or class file. (String)
- name
- Specifies the name of the handler chain in the configuration file.
(String)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({TYPE})
public @interface HandlerChain{
String file();
String name();
};
|
@SOAPBinding |
This annotation specifies the mapping of the
web service onto the SOAP message protocol. You can apply this annotation
to a type or public methods in a client or server Service Endpoint
Interface (SEI), or in a service endpoint implementation class for
a Java beans endpoint.
The
method-level annotation is limited by what it can specify. Use the
annotation only if the style property has the value DOCUMENT.
If the method-level annotation is not specified, the @SOAPBinding behavior
from the type is used.
|
- Annotation target: Type or Method
- Properties:
- style
- Defines encoding style for messages that are sent to and from
the web service. The valid values are DOCUMENT and RPC.
The default value is DOCUMENT. (String)
- use
- Defines the encoding that is used for messages that are sent to
and from the web service. The default value is LITERAL. ENCODED is
not a supported value. (String)
- parameterStyle
- Determines whether the method's parameters represent the entire
message body, or if the parameters are elements that are wrapped inside
a top-level element that is named after the operation. Valid values
are WRAPPED or BARE. You can use
the BARE value with DOCUMENT style
bindings. The default value is WRAPPED. (String)
|
@Retention(value = RetentionPolicy.RUNTIME)
@Target({TYPE})
public @interface SOAPBinding{
public enum Style{
DOCUMENT,
RPC
};
public enum Use{
LITERAL,
};
public enum ParameterStyle{
BARE,
WRAPPED
};
Style style() default Style.DOCUMENT
Use use() default Use.LITERAL
ParameterStyle parameterStyle() default ParameterStyle.WRAPPED;
};
|