createSeqRMMsg.setCreateSequence(createSequencePart);
// Find the token that should be used to secure this new sequence. If there is a token, then we
// save it in the properties so that the caller can store the token within the create sequence
// bean.
SecurityManager secMgr = SandeshaUtil.getSecurityManager(context);
SecurityToken token = secMgr.getSecurityToken(applicationMsgContext);
if(token != null) {
OMElement str = secMgr.createSecurityTokenReference(token, createSeqmsgContext);
createSequencePart.setSecurityTokenReference(str);
createSeqRMMsg.setProperty(Sandesha2Constants.MessageContextProperties.SECURITY_TOKEN, token);
// If we are using token based security, and the 1.1 spec level, then we
// should introduce a UsesSequenceSTR header into the message.
if(createSequencePart.getNamespaceValue().equals(Sandesha2Constants.SPEC_2007_02.NS_URI)) {
UsesSequenceSTR usesSeqStr = new UsesSequenceSTR();
usesSeqStr.toHeader(createSeqmsgContext.getEnvelope().getHeader());
}
// Ensure that the correct token will be used to secure the outbound create sequence message.
// We cannot use the normal helper method as we have not stored the token into the sequence bean yet.
secMgr.applySecurityToken(token, createSeqRMMsg.getMessageContext());
}
createSeqRMMsg.setAction(SpecSpecificConstants.getCreateSequenceAction(rmsBean.getRMVersion()));
createSeqRMMsg.setSOAPAction(SpecSpecificConstants.getCreateSequenceSOAPAction(rmsBean.getRMVersion()));