Search in sources :

Example 1 with CoordinationContextHandler

use of com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler in project narayana by jbosstm.

the class ATInteropClient method getParticipantPort.

// don't think we ever need this as we get a registration port from the endpoint ref returned by
// the activation port request
public static ParticipantPortType getParticipantPort(MAP map, String action) {
    ParticipantService service = getParticipantService();
    ParticipantPortType port = service.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    List<Handler> customHandlerChain = new ArrayList<Handler>();
    /*
         * we need to add the coordination context handler in the case where we are passing a
         * coordination context via a header element
         */
    customHandlerChain.add(new CoordinationContextHandler());
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
		customHandlerChain.add(new WSAddressingClientHandler());
         */
    bindingProvider.getBinding().setHandlerChain(customHandlerChain);
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    map.setAction(action);
    map.setFrom(getInitiator());
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : ParticipantService(com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantService) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ParticipantPortType(com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantPortType) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) ArrayList(java.util.ArrayList) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider)

Example 2 with CoordinationContextHandler

use of com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler in project narayana by jbosstm.

the class BAInteropClient method getParticipantPort.

// don't think we ever need this as we get a registration port from the endpoint ref returned by
// the activation port request
public static ParticipantPortType getParticipantPort(MAP map, String action) {
    ParticipantService service = getParticipantService();
    ParticipantPortType port = service.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    List<Handler> customHandlerChain = new ArrayList<Handler>();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
		customHandlerChain.add(new WSAddressingClientHandler());
         */
    /*
         * we need to add the coordination context handler in the case where we are passing a
         * coordination context via a header element
         */
    customHandlerChain.add(new CoordinationContextHandler());
    bindingProvider.getBinding().setHandlerChain(customHandlerChain);
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    map.setAction(action);
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : ParticipantService(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantService) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) ArrayList(java.util.ArrayList) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider)

Aggregations

CoordinationContextHandler (com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler)2 ArrayList (java.util.ArrayList)2 BindingProvider (javax.xml.ws.BindingProvider)2 Handler (javax.xml.ws.handler.Handler)2 AddressingFeature (javax.xml.ws.soap.AddressingFeature)2 ParticipantPortType (com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantPortType)1 ParticipantService (com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantService)1 ParticipantPortType (com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)1 ParticipantService (com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantService)1