if (el.equals(UsernameToken.TOKEN))
return new UsernameToken(wssConfig, tokenElement);
if (el.equals(BinarySecurity.TOKEN))
return new BinarySecurity(wssConfig, tokenElement);
} catch (WSSecurityException e) {
throw new ElementParsingException("WSSecurityException while trying to create a SecurityToken object from a SecurityTokenReference: "
+ e.getMessage());
}
}
} catch (WSSecurityException e) {
throw new InvalidSecurityTokenReference("WSSecurityException while trying to dereference a <SecurityTokenReference>: " + e.getMessage());