if (acksToStr == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));
//Getting the operation for ack messages.
AxisOperation ackOperation = SpecSpecificConstants.getWSRMOperation(
Sandesha2Constants.MessageTypes.ACK,
rmdBean.getRMVersion(),
msgContext.getAxisService());
MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(rmMsgCtx, ackOperation);
//setting up the RMMsgContext
RMMsgContext ackRMMsgCtx = MsgInitializer.initializeMessage(ackMsgCtx);
ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());
ackMsgCtx.setTo(acksTo);
ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());
if (ackMsgCtx.getMessageID()==null)
ackMsgCtx.setMessageID(SandeshaUtil.getUUID());
//adding the SOAP Envelope
SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(msgContext.getEnvelope()));
SOAPEnvelope envelope = factory.getDefaultEnvelope();
try {
ackMsgCtx.setEnvelope(envelope);
} catch (AxisFault e3) {
throw new SandeshaException(e3.getMessage());
}
ackMsgCtx.setReplyTo(msgContext.getTo());
RMMsgCreator.addAckMessage(ackRMMsgCtx, sequenceId, rmdBean);
//this is not a client generated message. So set serverSide to true.
ackMsgCtx.setServerSide(true);
if (acksTo.hasAnonymousAddress()) {
//If acksTo is anonymous we will be sending the ack here it self. Transport will use what ever mechanism to send the
//message. (for e.g. HTTP will use the back channel)
// setting "response written" since acksto is anonymous
//adding an OperationContext if one is not available. (for e.g. If we are in the SandeshaGlobalInHandler)
if (rmMsgCtx.getMessageContext().getOperationContext() == null) {
// operation context will be null when doing in a GLOBAL
// handler.
ServiceContext serviceCtx = msgContext.getServiceContext();
OperationContext opCtx = OperationContextFactory.createOperationContext(ackOperation.getAxisSpecificMEPConstant(), ackOperation, serviceCtx);
rmMsgCtx.getMessageContext().setOperationContext(opCtx);
}
try {