Java Reference
In-Depth Information
public @interface WebResult {
public String name() default "";
public String partName() default "";
public String targetNamespace() default "";
public boolean header() default false;
}
As expected, the name element specifies the name of the value returned in the WSDL.
The targetNamespace element customizes the XML namespace for the returned value.
This works for document-style web services where the return value binds to an XML
namespace.
If the header element is set to true , the value is returned as a part of the message header.
As with the @WebParam annotation, the partName property is used to customize the
name of the value returned from an operation.
Using @OneWay and @HandlerChain
The web service metadata annotation specification defines two more annotations:
@OneWay and @HandlerChain . We'll briefly introduce these two annotations, but fur-
ther exploration is outside the scope of this topic.
The @OneWay annotation is used to define a web service that doesn't return a value. The
method's return type is void. For example, consider the following method:
@WebMethod
@OneWay
public void pingServer() {
...
}
In this case, pingServer doesn't return anything. The @OneWay annotation optimizes
the message to reflect that no value is returned.
The @HandlerChain annotation is used to define a set of handlers that are invoked in
response to a SOAP message. Logically, handlers are similar to EJB interceptors. There are
two types of handlers:
• Logical handlers (@ javax.xml.ws.handler.LogicalHandler ), which
operate on the message context properties and message payload
Search WWH ::




Custom Search