Search in sources :

Example 1 with MAP

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

the class TerminationCoordinatorPortTypeImpl method closeOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "CloseOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close")
@Oneway
public void closeOperation(@WebParam(name = "Close", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters") NotificationType parameters) {
    if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.trace(getClass().getSimpleName() + ".closeOperation");
    }
    MessageContext ctx = webServiceCtx.getMessageContext();
    final NotificationType close = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            TerminationCoordinatorProcessor.getProcessor().close(close, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) NotificationType(com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP)

Example 2 with MAP

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

the class TerminationParticipantPortTypeImpl method faultedOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "FaultedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted")
@Oneway
public void faultedOperation(@WebParam(name = "Faulted", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters") NotificationType parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final NotificationType faulted = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            TerminationParticipantProcessor.getProcessor().handleFaulted(faulted, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) NotificationType(com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP)

Example 3 with MAP

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

the class ActivationCoordinator method createCoordinationContext.

/**
 * Create the coordination context.
 * @param activationCoordinatorURI The URI of the activation coordinator.
 * @param messageID The messageID to use.
 * @param coordinationTypeURI The coordination type.
 * @param expires The expiry time or null.
 * @param currentContext The currnt context or null.
 * @return The coordination context.
 * @throws com.arjuna.wsc.InvalidCreateParametersException if the create parameters are invalid.
 * @throws SoapFault for errors during processing.
 */
public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI, final String messageID, final String coordinationTypeURI, final Long expires, final CoordinationContext currentContext) throws InvalidCreateParametersException, SoapFault {
    final MAP map = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID);
    final Expires expiresValue;
    if (expires == null) {
        expiresValue = null;
    } else {
        expiresValue = new Expires();
        expiresValue.setValue(expires.longValue());
    }
    try {
        CreateCoordinationContextResponseType response;
        ActivationCoordinatorClient client = ActivationCoordinatorClient.getClient();
        response = client.sendCreateCoordination(map, coordinationTypeURI, expiresValue, currentContext);
        return response.getCoordinationContext();
    } catch (final IOException ioe) {
        throw new SoapFault11(ioe);
    } catch (SOAPFaultException sfe) {
        // TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
        final SOAPFault soapFault = sfe.getFault();
        final QName subcode = soapFault.getFaultCodeAsQName();
        if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(subcode)) {
            Detail detail = soapFault.getDetail();
            String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
            throw new InvalidCreateParametersException(message);
        }
        throw SoapFault11.create(sfe);
    }
}
Also used : ActivationCoordinatorClient(com.arjuna.webservices11.wscoor.client.ActivationCoordinatorClient) QName(javax.xml.namespace.QName) SoapFault11(com.arjuna.webservices11.SoapFault11) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) SOAPFault(javax.xml.soap.SOAPFault) Expires(org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires) IOException(java.io.IOException) MAP(org.jboss.ws.api.addressing.MAP) CreateCoordinationContextResponseType(org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextResponseType) Detail(javax.xml.soap.Detail) InvalidCreateParametersException(com.arjuna.wsc.InvalidCreateParametersException)

Example 4 with MAP

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

the class WSCOORClient method getRegistrationPortMap.

private static MAP getRegistrationPortMap(Map<String, Object> requestContext) {
    final WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
    MAP map;
    if (WSCEnvironmentBean.SECURE_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
        String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getSecureServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME);
        String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getSecureServiceURI(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME);
        WSCLogger.logger.tracev("WSCOORClient Using secure endpoints {0} {1}", responseService, faultService);
        map = AddressingHelper.outboundMap(requestContext, responseService, faultService);
    } else if (WSCEnvironmentBean.PLAIN_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
        String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME);
        String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getServiceURI(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME);
        WSCLogger.logger.tracev("WSCOORClient Using plain endpoints {0} {1}", responseService, faultService);
        map = AddressingHelper.outboundMap(requestContext, responseService, faultService);
    } else {
        WSCLogger.logger.tracev("WSCOORClient Using anonymous endpoints");
        map = AddressingHelper.outboundMap(requestContext);
    }
    return map;
}
Also used : WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) MAP(org.jboss.ws.api.addressing.MAP)

Example 5 with MAP

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

the class CoordinationFaultPortTypeImpl method soapFault.

@WebMethod(operationName = "SoapFault", action = "http://www.w3.org/2005/08/addressing/soap/fault")
@Oneway
@Action(input = "http://www.w3.org/2005/08/addressing/soap/fault")
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "fault") Fault fault) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    MAP inboundMap = AddressingHelper.inboundMap(ctx);
    if (inboundMap.getRelatesTo() != null) {
        WSCLogger.logger.tracev("CoordinationFaultPortTypeImpl receiving fault for message={0} - string={1} code={2} details={3}", inboundMap.getRelatesTo().getRelatesTo(), fault.getFaultstring(), fault.getFaultcode(), fault.getDetail() == null ? "null" : fault.getDetail().getAny());
        AsynchronousRegistrationMapper.getInstance().assignFault(inboundMap.getRelatesTo().getRelatesTo(), fault);
    } else {
        WSCLogger.i18NLogger.error_empty_messageId_received_by_async_endpoint();
    }
}
Also used : MessageContext(javax.xml.ws.handler.MessageContext) MAP(org.jboss.ws.api.addressing.MAP) WebMethod(javax.jws.WebMethod) Action(javax.xml.ws.Action) Oneway(javax.jws.Oneway)

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