Client client = ClientProxy.getClient(transportSaml2Port);
Endpoint ep = client.getEndpoint();
String id = "1234";
ep.getEndpointInfo().setProperty(TokenStore.class.getName(), new MemoryTokenStore());
ep.getEndpointInfo().setProperty(SecurityConstants.TOKEN_ID, id);
TokenStore store = (TokenStore)ep.getEndpointInfo().getProperty(TokenStore.class.getName());
SAMLCallback samlCallback = new SAMLCallback();
SAMLUtil.doSAMLCallback(new Saml2CallbackHandler(), samlCallback);
SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Element assertionElement = assertion.toDOM(db.newDocument());
SecurityToken tok = new SecurityToken(id);
tok.setTokenType(WSConstants.WSS_SAML2_TOKEN_TYPE);
tok.setToken(assertionElement);
store.add(tok);
doubleIt(transportSaml2Port, 50);
((java.io.Closeable)transportSaml2Port).close();
bus.shutdown(true);