public static ActivationPortType getActivationPort(MAP map, String action) { final ActivationService service = getActivationService(); final ActivationPortType port = PrivilegedServiceHelper.getInstance().getPort(service, ActivationPortType.class, new AddressingFeature(true, true)); BindingProvider bindingProvider = (BindingProvider)port; String to = map.getTo(); /* * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature List<Handler> customHandlerChain = new ArrayList<Handler>(); customHandlerChain.add(new WSAddressingClientHandler()); bindingProvider.getBinding().setHandlerChain(customHandlerChain); */ Map<String, Object> requestContext = bindingProvider.getRequestContext(); AddressingHelper.configureRequestContext(requestContext, map, to, action); return port; }
public static RegistrationPortType getRegistrationPort(final W3CEndpointReference endpointReference, String action, String messageID) { final RegistrationService service = getRegistrationService(); final RegistrationPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, RegistrationPortType.class, new AddressingFeature(true, true)); BindingProvider bindingProvider = (BindingProvider)port; /* * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature List<Handler> customHandlerChain = new ArrayList<Handler>(); customHandlerChain.add(new WSAddressingClientHandler()); bindingProvider.getBinding().setHandlerChain(customHandlerChain); */ Map<String, Object> requestContext = bindingProvider.getRequestContext(); MAP map = getRegistrationPortMap(requestContext); AddressingHelper.installActionMessageID(map, action, messageID); // we should not need to do this but JBossWS does not pick up the value in the addressing properties AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; }