in modules/rampart-core/src/main/java/org/apache/rampart/builder/TransportBindingBuilder.java [684:743]
private void handleSecureConversationTokens(RampartMessageData rmd,
SecureConversationToken secConvTok) throws RampartException {
MessageContext msgContext = rmd.getMsgContext();
String secConvTokenId = rmd.getSecConvTokenId();
//The RSTR has to be secured with the cancelled token
String action = msgContext.getOptions().getAction();
boolean cancelReqResp = action.equals(RahasConstants.WST_NS_05_02 + RahasConstants.RSTR_ACTION_CANCEL_SCT) ||
action.equals(RahasConstants.WST_NS_05_02 + RahasConstants.RSTR_ACTION_CANCEL_SCT) ||
action.equals(RahasConstants.WST_NS_05_02 + RahasConstants.RST_ACTION_CANCEL_SCT) ||
action.equals(RahasConstants.WST_NS_05_02 + RahasConstants.RST_ACTION_CANCEL_SCT);
//In the case of the cancel req or resp we should mark the token as cancelled
if(secConvTokenId != null && cancelReqResp) {
try {
rmd.getTokenStorage().getToken(secConvTokenId).setState(org.apache.rahas.Token.CANCELLED);
msgContext.setProperty(RampartMessageData.SCT_ID, secConvTokenId);
//remove from the local map of contexts
String contextIdentifierKey = RampartUtil.getContextIdentifierKey(msgContext);
RampartUtil.getContextMap(msgContext).remove(contextIdentifierKey);
} catch (TrustException e) {
throw new RampartException("errorExtractingToken",e);
}
}
if (secConvTokenId == null
|| (secConvTokenId != null &&
(!RampartUtil.isTokenValid(rmd, secConvTokenId) && !cancelReqResp))) {
log.debug("No SecureConversationToken found, requesting a new token");
try {
secConvTokenId = RampartUtil.getSecConvToken(rmd, secConvTok);
rmd.setSecConvTokenId(secConvTokenId);
} catch (TrustException e) {
throw new RampartException("errorInObtainingSct", e);
}
}
/* org.apache.rahas.Token token;
try {
token = rmd.getTokenStorage().getToken(secConvTokenId);
} catch (TrustException e) {
throw new RampartException("errorExtractingToken", e);
}
//Add the token to the header
Element siblingElem = RampartUtil
.insertSiblingAfter(rmd, this.getInsertionLocation(),
(Element) token.getToken());
this.setInsertionLocation(siblingElem);*/
}