String userName = (args.length > 0 ? args[0] : "tomcat");
String password = (args.length > 1 ? args[1] : "tomcat");
// Step 1: Create a WS Trust Client
WSTrustClient client = new WSTrustClient("PicketLinkSTS", "PicketLinkSTSPort", "http://localhost:8080/picketlink-sts/PicketLinkSTS",
new SecurityInfo(userName, password));
Element assertionElement = null;
try {
System.out.println("Invoking token service to get SAML assertion for user:" + userName + " with password:" + password);
// Step 2: Get a SAML2 Assertion Token from the PicketLink STS
assertionElement = client.issueToken(SAMLUtil.SAML2_TOKEN_TYPE);