}
if(sctObject instanceof com.sun.xml.ws.security.opt.impl.incoming.SecurityContextToken){
com.sun.xml.ws.security.opt.impl.incoming.SecurityContextToken sct = (com.sun.xml.ws.security.opt.impl.incoming.SecurityContextToken)sctObject;
sctId = sct.getSCId();
}else if(sctObject instanceof SecurityContextToken){
SecurityContextToken sct = (SecurityContextToken)sctObject;
sctId = sct.getIdentifier().toString();
}
} else{
SecurityContextToken sct = (SecurityContextToken)context.getExtraneousProperty(MessageConstants.INCOMING_SCT);
if (sct == null) {
throw new XWSSecurityException("SecureConversation Session Context not Found");
}
sctId = sct.getIdentifier().toString();
}
ictx = ((SessionManager)context.getExtraneousProperty("SessionManager")).getSecurityContext(sctId, !context.isExpired());
java.net.URI identifier = null;
String instance = null;
String wsuId = null;
SecurityContextToken sct = (SecurityContextToken)ictx.getSecurityToken();
if (sct != null){
identifier = sct.getIdentifier();
instance = sct.getInstance();
wsuId = sct.getWsuId();
}else{
SecurityContextTokenInfo sctInfo = ictx.getSecurityContextTokenInfo();
identifier = java.net.URI.create(sctInfo.getIdentifier());
instance = sctInfo.getInstance();
wsuId = sctInfo.getExternalId();