Search in sources :

Example 46 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class TwoPCParticipantTest method checkDetails.

/**
 * check the message details to see that they have the correct to, from and faultto address and message id, a
 * none reply to address and an arjuna context containing the correct instannce identifier
 * @param details
 * @param hasFrom
 * @param hasFaultTo
 * @param messageId
 * @param instanceIdentifier
 */
private void checkDetails(CoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier) {
    MAP inMAP = details.getMAP();
    ArjunaContext inArjunaContext = details.getArjunaContext();
    assertEquals(inMAP.getTo(), TestUtil.coordinatorServiceURI);
    assertNotNull(inMAP.getReplyTo());
    assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
    if (hasFrom) {
        assertNotNull(inMAP.getFrom());
        assertEquals(inMAP.getFrom().getAddress(), TestUtil.participantServiceURI);
    } else {
        assertNull(inMAP.getFrom());
    }
    if (hasFaultTo) {
        assertNotNull(inMAP.getFaultTo());
        assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.participantServiceURI);
    } else {
        assertNull(inMAP.getFrom());
    }
    assertNotNull(inMAP.getMessageID());
    assertEquals(inMAP.getMessageID(), messageId);
    if (instanceIdentifier == null) {
        assertNull(inArjunaContext);
    } else {
        assertNotNull(inArjunaContext);
        assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier());
    }
}
Also used : ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP)

Example 47 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class WSATClient method configureEndpointPort.

private static void configureEndpointPort(BindingProvider bindingProvider, String action, MAP map) {
    /*
         * 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 requestMap = AddressingHelper.outboundMap(requestContext);
    map.setAction(action);
    AddressingHelper.installCallerProperties(map, requestMap);
    AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
}
Also used : MAP(org.jboss.ws.api.addressing.MAP)

Example 48 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class CompletionCoordinatorPortTypeImpl method commitOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
public void commitOperation(@WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification commit = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CompletionCoordinatorProcessor.getProcessor().commit(commit, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 49 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class WSARJTXClient method getTerminationCoordinatorRPCPort.

public static TerminationCoordinatorRPCPortType getTerminationCoordinatorRPCPort(W3CEndpointReference endpointReference, String action, MAP map) {
    final TerminationCoordinatorRPCService service = getTerminationCoordinatorRPCService();
    final TerminationCoordinatorRPCPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, TerminationCoordinatorRPCPortType.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 requestMap = AddressingHelper.outboundMap(requestContext);
    map.setAction(action);
    AddressingHelper.installCallerProperties(map, requestMap);
    AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) BindingProvider(javax.xml.ws.BindingProvider) MAP(org.jboss.ws.api.addressing.MAP)

Example 50 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class WSARJTXClient method getTerminationCoordinatorPort.

public static TerminationCoordinatorPortType getTerminationCoordinatorPort(W3CEndpointReference endpointReference, String action, MAP map) {
    final TerminationCoordinatorService service = getTerminationCoordinatorService();
    final TerminationCoordinatorPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, TerminationCoordinatorPortType.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 requestMap = AddressingHelper.outboundMap(requestContext);
    map.setAction(action);
    AddressingHelper.installCallerProperties(map, requestMap);
    AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) BindingProvider(javax.xml.ws.BindingProvider) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

MAP (org.jboss.ws.api.addressing.MAP)322 MessageContext (javax.xml.ws.handler.MessageContext)119 Action (javax.xml.ws.Action)104 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)81 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)75 SoapFault11 (com.arjuna.webservices11.SoapFault11)65 Task (com.arjuna.services.framework.task.Task)62 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)53 Test (org.junit.Test)51 RequestWrapper (javax.xml.ws.RequestWrapper)41 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)40 NotificationType (org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)29 SoapFault (com.arjuna.webservices.SoapFault)24 ATInitiatorProcessor (com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor)15 InitiatorProcessor (com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor)15 Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)15 QName (javax.xml.namespace.QName)13 BAInitiatorProcessor (com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor)12 SystemException (com.arjuna.wst.SystemException)11 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)11