// TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
ActivationService service = getActivationService();
// ActivationPortType port = service.getPort(ActivationPortType.class, new AddressingFeature(true, true));
ActivationPortType port = service.getPort(ActivationPortType.class);
BindingProvider bindingProvider = (BindingProvider)port;
AttributedURI toUri = addressingProperties.getTo();
/*
* we have to add the JaxWS WSAddressingClientHandler because we cannot specify the WSAddressing feature
*/
List<Handler> customHandlerChain = new ArrayList<Handler>();
customHandlerChain.add(new WSAddressingClientHandler());
bindingProvider.getBinding().setHandlerChain(customHandlerChain);
Map<String, Object> requestContext = bindingProvider.getRequestContext();
requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
// jbossws should do this for us . . .
requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, toUri.getURI().toString());
try {
addressingProperties.setAction(builder.newURI(action));
} catch (URISyntaxException use) {
// TODO log this error
}