javax.xml.ws.wsaddressing


1. Setting the Endpoint Address

@WebService(endpointInterface = "com.example.MyService")
public class MyServiceImpl implements MyService {
    @WebMethod
    public void myMethod() {
        // ...
    }
}

// In the client:
MyService service = new MyServiceImpl();
BindingProvider bp = (BindingProvider) service;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/myService");

2. Using the WSA Destination

@WebService(endpointInterface = "com.example.MyService")
public class MyServiceImpl implements MyService {
    @WebMethod
    public void myMethod() {
        // Get the WSA destination from the message context
        WSDestination destination = (WSDestination) messageContext.get(MessageContext.WS_ADDRESSING_DESTINATION);
        String destinationAddress = destination.getAddress().getValue();
        // ...
    }
}

3. Setting the FaultTo Address

4. Using the WSA Action

5. Setting the RelatesTo Attribute

6. Using the Message ID

7. Setting the ReplyTo Address

8. Using the WSA Reference Properties

9. Setting the WSA To Header

10. Using the WSA Fault RelatesTo

11. Setting the WSA From Header

12. Using the WSA Fault To Header

13. Setting the WSA ReplyTo Header

14. Using the WSA Fault

15. Setting the WSA ReferenceParameters

16. Using the WSA MessageID

17. Setting the WSA Action

18. Using the WSA ReplyTo

19. Setting the WSA FaultTo

20. Using the WSA RelatesTo

21. Setting the WSA From