|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface Action
The Action annotation can be specified on each method of a
service endpoint interface or implementation. This annotation allows implicit
and explicit association of Action with the corresponding WSDL
operation. The generated WSDL contains explicit wsa:Action
attribute on the WSDL input and output, as defined by
the WS-Addressing 1.0 WSDL Binding specification.
Here is an example using default values of Action.
Example 1:
@javax.jws.WebService
public class AddNumbersImpl {
@javax.ws.addressing.Action
public int addNumbers(int number1, int number2) {
return number1 + number2;
}
}
The generated WSDL looks like:
<definitions targetNamespace="http://example.com/numbers" ...>
...
<portType name="AddNumbersPortType">
<operation name="AddNumbers">
<input message="tns:AddNumbersInput" name="Parameters"
wsa:Action="http://example.com/numbers/AddNumbersPortType/Parameters"/>
<output message="tns:AddNumbersOutput" name="Result"
wsa:Action="http://example.com/numbers/AddNumbersPortType/Result"/>
</operation>
<portType>
...
<definitions>
Here is an example where only input attribute is specified and
output attribute is derived from input.
Example 2:
@javax.jws.WebService
public class AddNumbersImpl {
@javax.ws.addressing.Action(input="http://example.com/numbers/add")
public int addNumbers(int number1, int number2) {
return number1 + number2;
}
}
The generated WSDL looks like:
<definitions targetNamespace="http://example.com/numbers" ...>
...
<portType name="AddNumbersPortType">
<operation name="AddNumbers">
<input message="tns:AddNumbersInput" name="Parameters"
wsa:Action="http://example.com/numbers/add"/>
<output message="tns:AddNumbersOutput" name="Result"
wsa:Action="http://example.com/numbers/addResponse"/>
</operation>
<portType>
...
<definitions>
A different Action may be associated with each input
and output elements as shown in the following example.
Example 3:
@javax.jws.WebService
public class AddNumbersImpl {
@javax.ws.addressing.Action(input="http://example.com/addnumbers/input", output="http://example.com/addnumbers/output")
public int addNumbers(int number1, int number2) {
return number1 + number2;
}
}
The generated WSDL looks like:
<definitions targetNamespace="http://example.com/numbers" ...>
...
<portType name="AddNumbersPortType">
<operation name="AddNumbers">
<input message="tns:AddNumbersInput" name="Parameters"
wsa:Action="http://example.com/addnumbers/input"/>
<output message="tns:AddNumbersOutput" name="Result"
wsa:Action="http://example.com/addnumbers/output"/>
</operation>
<portType>
...
<definitions>
| Optional Element Summary | |
|---|---|
java.lang.String[] |
fault
Explicit Action for the output operation |
java.lang.String |
input
Explicit Action for the input operation |
java.lang.String |
output
Explicit Action for the output operation |
public abstract java.lang.String input
public abstract java.lang.String output
public abstract java.lang.String[] fault
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||