Search in sources :

Example 1 with InitiatorService

use of com.jboss.transaction.txinterop.webservices.atinterop.generated.InitiatorService in project narayana by jbosstm.

the class ATInteropClient method getInitiatorPort.

public static InitiatorPortType getInitiatorPort(MAP map, String action) {
    InitiatorService service = getInitiatorService();
    InitiatorPortType port = service.getPort(InitiatorPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.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();
    map.setAction(action);
    map.setFrom(getParticipant());
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) InitiatorService(com.jboss.transaction.txinterop.webservices.atinterop.generated.InitiatorService) InitiatorPortType(com.jboss.transaction.txinterop.webservices.atinterop.generated.InitiatorPortType) BindingProvider(javax.xml.ws.BindingProvider)

Aggregations

InitiatorPortType (com.jboss.transaction.txinterop.webservices.atinterop.generated.InitiatorPortType)1 InitiatorService (com.jboss.transaction.txinterop.webservices.atinterop.generated.InitiatorService)1 BindingProvider (javax.xml.ws.BindingProvider)1 AddressingFeature (javax.xml.ws.soap.AddressingFeature)1