Hi Vinay

There is also a configuration way to enforce the issuance of a security token 
from the STS and attach it to the outgoing request automatically. All you need 
is the STSClient bean in the jaxws:client bean configuration as well as the 
WS-SecurityPolicy in the WSDL or referenced externally (see policy options 
here: http://cxf.apache.org/docs/how-it-works.html)

Talend has enriched the CXF distribution with additional examples. You can 
download the examples for CXF (Talend Service Factory) here:
http://www.talend.com/download.php#SF

Have a look to the following examples (check the readme)
jaxws-ws-trust: Illustrates teh usage of WS-SecurityPolicy with an STS (your 
case)
jaxws-ws-secpol : Illustrates the usage of WS-SecurityPolicy without an STS

You find there also a link for a manual which describes how to configure CXF 
for WS-Trust.

If you still prefer to enforce it in your code, have a look to the CXF class 
IssuedTokenInterceptorProvider which implements the communication with the STS:
http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java?view=markup

HTH

Thanks
Oli


-----Original Message-----
From: Penmatsa, Vinay [mailto:[email protected]] 
Sent: Freitag, 12. August 2011 22:41
To: [email protected]
Subject: ws-security.sts.client

Hello,
I am able to get security token from STS, but now I want to use in the service 
call. The problem is for STSClient I'm using spring configuration partially.
I have generated the web service client. How can I combine these two?
I tried to do:

 ((BindingProvider)port).getRequestContext().put("ws-security.sts.client", 
stsClient);


But this seems to have no effect.

-Vinay


Reply via email to