Search in sources :

Example 26 with MAPEndpoint

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

the class ParticipantCompletionCoordinatorClient method sendCompleted.

/**
 * Send a completed request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendCompleted(W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
    if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.trace(getClass().getSimpleName() + ".sendCompleted");
    }
    MAPEndpoint participant = getParticipant(endpoint, map);
    AddressingHelper.installFromFaultTo(map, participant, identifier);
    BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
    port = getPort(endpoint, map, completedAction);
    NotificationType completed = new NotificationType();
    port.completedOperation(completed);
}
Also used : MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) BusinessAgreementWithParticipantCompletionCoordinatorPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType) NotificationType(org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)

Example 27 with MAPEndpoint

use of org.jboss.ws.api.addressing.MAPEndpoint in project jbossws-cxf by jbossws.

the class ServerHandler method handleInbound.

@Override
public boolean handleInbound(SOAPMessageContext msgContext) {
    log.info("handleRequest");
    MAPBuilder builder = MAPBuilderFactory.getInstance().getBuilderInstance();
    MAP addrProps = builder.inboundMap(msgContext);
    if (addrProps == null)
        throw new IllegalStateException("Cannot obtain AddressingProperties");
    String clientid = null;
    MAPEndpoint replyTo = addrProps.getReplyTo();
    for (Object obj : replyTo.getReferenceParameters()) {
        if (obj instanceof Element) {
            Element el = (Element) obj;
            QName qname = getElementQName(el);
            if (qname.equals(IDQN)) {
                clientid = getTextContent(el);
            }
        } else {
            log.warn("Unsupported reference parameter found: " + obj);
        }
    }
    if (clientid == null)
        throw new IllegalStateException("Cannot obtain client id");
    // put the clientid in the message context
    msgContext.put("clientid", clientid);
    msgContext.setScope("clientid", Scope.APPLICATION);
    return true;
}
Also used : MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) QName(javax.xml.namespace.QName) Element(org.w3c.dom.Element) MAP(org.jboss.ws.api.addressing.MAP) MAPBuilder(org.jboss.ws.api.addressing.MAPBuilder)

Example 28 with MAPEndpoint

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

the class TerminationParticipantClient method sendClosed.

/**
 * Send a closed request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendClosed(final W3CEndpointReference participant, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
    MAPEndpoint coordinator = getCoordinator(participant);
    AddressingHelper.installFromFaultTo(map, coordinator, identifier);
    final TerminationParticipantPortType port = getPort(participant, map, identifier, closedAction);
    final NotificationType closed = new NotificationType();
    port.closedOperation(closed);
}
Also used : TerminationParticipantPortType(com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType) MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) NotificationType(com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType)

Example 29 with MAPEndpoint

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

the class CompletionCoordinatorClient method sendRollback.

/**
 * Send a rollback request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendRollback(final W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
    MAPEndpoint initiator = getCompletionInitiator(endpoint);
    AddressingHelper.installFromFaultTo(map, initiator, identifier);
    CompletionCoordinatorPortType port = getPort(endpoint, map, rollbackAction);
    Notification rollback = new Notification();
    port.rollbackOperation(rollback);
}
Also used : MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) CompletionCoordinatorPortType(org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorPortType) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)

Example 30 with MAPEndpoint

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

the class ParticipantClient method sendRollback.

/**
 * Send a rollback request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendRollback(final W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
    MAPEndpoint coordinator = getCoordinator(endpoint, map);
    AddressingHelper.installFromFaultTo(map, coordinator, identifier);
    ParticipantPortType port = getPort(endpoint, map, rollbackAction);
    Notification rollback = new Notification();
    port.rollbackOperation(rollback);
}
Also used : MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) ParticipantPortType(org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantPortType) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)

Aggregations

MAPEndpoint (org.jboss.ws.api.addressing.MAPEndpoint)55 NotificationType (org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)29 Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)11 BusinessAgreementWithCoordinatorCompletionCoordinatorPortType (org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorPortType)9 BusinessAgreementWithCoordinatorCompletionParticipantPortType (org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantPortType)9 BusinessAgreementWithParticipantCompletionCoordinatorPortType (org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType)9 BusinessAgreementWithParticipantCompletionParticipantPortType (org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantPortType)8 NotificationType (com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType)7 TerminationParticipantPortType (com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType)4 CoordinatorPortType (org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorPortType)4 StatusType (org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType)4 TerminationCoordinatorPortType (com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorPortType)3 ParticipantPortType (org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantPortType)3 MAP (org.jboss.ws.api.addressing.MAP)2 MAPBuilder (org.jboss.ws.api.addressing.MAPBuilder)2 CompletionCoordinatorPortType (org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorPortType)2 CompletionInitiatorPortType (org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionInitiatorPortType)2 ExceptionType (org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType)2 IOException (java.io.IOException)1 QName (javax.xml.namespace.QName)1