//Setting sequence properties for the outgoing sequence.
//Only will be used by the server side response path. Will be wasted properties for the client side.
//setting the out_sequence_id
SequencePropertyBean outSequenceBean = new SequencePropertyBean();
outSequenceBean.setName(Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
outSequenceBean.setValue(offeredSequenceID);
outSequenceBean.setSequenceID(outgoingSideInternalSequenceID);
seqPropMgr.insert(outSequenceBean);
//setting the internal_sequence_id
SequencePropertyBean internalSequenceBean = new SequencePropertyBean();
internalSequenceBean.setName(Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
internalSequenceBean.setSequenceID(offeredSequenceID);
internalSequenceBean.setValue(outgoingSideInternalSequenceID);
seqPropMgr.insert(internalSequenceBean);
} else {
//removing the accept part.
createSeqResPart.setAccept(null);
createSeqResponse.addSOAPEnvelope();
}
}
EndpointReference acksTo = createSeqPart.getAcksTo().getAddress().getEpr();
if (acksTo == null || acksTo.getAddress() == null
|| acksTo.getAddress() == "") {
String message = "Acks to not present in the create sequence message";
log.debug(message);
throw new AxisFault(message);
}
SequencePropertyBean acksToBean = new SequencePropertyBean(
newSequenceId, Sandesha2Constants.SequenceProperties.ACKS_TO_EPR,acksTo.getAddress());
seqPropMgr.insert(acksToBean);
outMessage.setResponseWritten(true);
//commiting tr. before sending the response msg.
createSequenceTransaction.commit();
Transaction updateLastActivatedTransaction = storageManager.getTransaction();
SequenceManager.updateLastActivatedTime(newSequenceId,createSeqRMMsg.getMessageContext().getConfigurationContext());
updateLastActivatedTransaction.commit();
AxisEngine engine = new AxisEngine(context);
engine.send(outMessage);
SequencePropertyBean toBean = seqPropMgr.retrieve(newSequenceId,Sandesha2Constants.SequenceProperties.TO_EPR);
if (toBean==null) {
String message = "Internal Error: wsa:To value is not set";
log.debug(message);
throw new SandeshaException (message);
}
EndpointReference toEPR = new EndpointReference (toBean.getValue());
String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(newSequenceId,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,context);
String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);
if (anonymousURI.equals(toEPR.getAddress())) {