Java Reference
In-Depth Information
message="tns:sayHello"/>
<output wsaw:Action="http://soacookbook.com/greeting"
message="tns:sayHelloResponse"/>
</operation>
</portType>
...
<binding name="HelloAddressingWSPortBinding"
type="tns:HelloAddressingWS">
<wsaw:UsingAddressing/>
First, the annotation's attributes map clearly to the input and output of the operation they
modify. The values specified in the Java file are added to the addressing Action attribute.
Then, in the binding, the WSDL now indicates that it is set up for WS-Addressing so that
clients are free to use Addressing if they would like to, via the <wsaw:UsingAddressing/>
element. This element also has a required attribute that indicates if you want the service
to force clients to use addressing. By default, it is set to false. But you could just write
<wsaw:UsingAddressing required="true"/> to force clients to use Addressing, if you had
started from WSDL. To generate that from Java, use the following code:
@Addressing(required=true)
NOTE
The current version of JAX-WS is what the spec calls “incomplete” with respect to addressing. That's
because there is no standard way to indicate within a WSDL that you want to use WS-Addressing,
and there is no standard default value for the Action headers that WS-Addressing uses. Once the
W3C (the sponsor of the working group defining the addressing spec) defines these items, JAX-WS
will be updated to enforce them.
To make sure that your endpoint and its client are portable, the endpoint must use the Action
annotation to indicate their WS-Addressing actions, and it should use the FaultAction an-
notation for creating WS-Addressing-compliant SOAP faults.
NOTE
If you wish to set up addressing in Apache CXF, see http://cwiki.apache.org/CXF20DOC/ws-ad-
dressing.html .
See Also
Explicitly Enabling Addressing on the Client .
Search WWH ::




Custom Search