It is important that the policy used uses an "IssuedToken" assertion.
https://wso2.org/repos/wso2/trunk/wsas/java/modules/samples/sts-sample/conf/service.policy.xml Now when RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN property provides an id of a token in the token store rampart will use that token as the issued token. Thanks, Ruchith On 8/30/07, Dimuthu <[EMAIL PROTECTED]> wrote: > Hi, > > You can do it as follows [1] > I got the code from this sample available here[2] > > Cheers, > Dimuthu > > [1] > Token tok = new Token(Token(tokenId, youTokenElem, > dateCreated, dateExpires)); > TokenStorage store = TrustUtil.getTokenStore(ctx); > store.add(token); > > //Store token > TokenStorage store = TrustUtil.getTokenStore(ctx); > store.add(responseToken); > > //Service invocation > ServiceClient client = new ServiceClient(ctx, null); > client.engageModule("rampart"); > client.engageModule("addressing"); > > > client.getServiceContext().setProperty(RampartMessageData.KEY_RAMPART_POLICY, > servicePolicy); > Options options = client.getOptions(); > options.setAction("urn:echoOMElement"); > > options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); > options.setTo(new EndpointReference(service)); > options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN, > responseToken.getId()); > OMElement respEelm = client.sendReceive(getPayload()); > System.out.println("RESPONSE FROM SERVICE: \n" + respEelm); > > [2]http://wso2.org/repos/wso2/trunk/wsas/java/modules/samples/sts-sample/src/org/wso2/wsas/sample/sts/client/Client.java > > > > On Wed, 2007-08-29 at 17:46 +0200, Massimiliano Masi wrote: > > Hi all, > > > > I have a SAML2 Authentication Assertion as OMElement, created by opensaml2. > > > > How can I include it in the SOAP Header using the rampart api? > > > > Is there a way to do it? > > > > > > Thank you in advance, > > > > > > Massimiliano > > > > ---------------------------------------------------------------- > > This message was sent using IMP, the Internet Messaging Program. > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > http://wso2.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- www.ruchith.org www.wso2.org --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
