use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class RegistrationResponsePortTypeImpl method registerResponseOperation.
@WebMethod(operationName = "RegisterResponseOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/RegisterResponse")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/RegisterResponse")
public void registerResponseOperation(@WebParam(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters", name = "RegisterResponse") org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType parameters) {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
if (inboundMap.getRelatesTo() != null) {
WSCLogger.logger.tracev("RegistrationResponsePortTypeImpl received response for messageId {0}", inboundMap.getRelatesTo().getRelatesTo());
AsynchronousRegistrationMapper.getInstance().assignResponse(inboundMap.getRelatesTo().getRelatesTo(), parameters);
} else {
WSCLogger.i18NLogger.error_empty_messageId_received_by_async_endpoint();
}
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method testSendCancel.
@Test
public void testSendCancel() throws Exception {
final String messageId = "testSendCancel";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId);
CoordinatorCompletionParticipantClient.getClient().sendCancel(endpoint, map, new InstanceIdentifier("sender"));
final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000);
assertTrue(details.hasCancel());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method checkDetails.
/**
* check the message details to see that they have the correct to and from address and message id, a null
* reply to address and an arjuna context containing the correct instannce identifier
* @param details
* @param messageId
* @param instanceIdentifier
*/
private void checkDetails(CoordinatorCompletionParticipantDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier) {
MAP inMAP = details.getMAP();
ArjunaContext inArjunaContext = details.getArjunaContext();
assertEquals(inMAP.getTo(), TestUtil.coordinatorCompletionParticipantServiceURI);
assertNotNull(inMAP.getReplyTo());
assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
if (hasFrom) {
assertNotNull(inMAP.getFrom());
assertEquals(inMAP.getFrom().getAddress(), TestUtil.coordinatorCompletionCoordinatorServiceURI);
} else {
assertNull(inMAP.getFrom());
}
if (hasFaultTo) {
assertNotNull(inMAP.getFaultTo());
assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.coordinatorCompletionCoordinatorServiceURI);
} 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());
}
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9");
final String reason = "testSendErrorReason";
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason);
// this would be a better test if we could set the identifier as a reference parameter here
CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFaultType);
assertEquals(details.hasSoapFault().getReason(), reason);
assertEquals(details.hasSoapFault().getSubcode(), subcode);
checkDetails(details, false, false, messageId, null);
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method testSendClose.
@Test
public void testSendClose() throws Exception {
final String messageId = "testSendClose";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1");
W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId);
CoordinatorCompletionParticipantClient.getClient().sendClose(endpoint, map, new InstanceIdentifier("sender"));
final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000);
assertTrue(details.hasClose());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
Aggregations