On Thursday, December 15, 2011 9:55:02 PM manoj_cxf wrote:
> Hi Dan,
> Thanks for reply.
> Yes there is WS Security policy described in the given WSDL.
> Can you please provide me some code sample how to put it all together.
Basically, you should just need to:
1) add the cxf-rt-ws-security, cxf-rt-ws-addr, and cxf-rt-ws-policy jars to
your project (if they aren't already).
2) When you setup you factory, add the wsdlLocation, serviceName, and
endpointName attributes to the right values in the wsdl prior to calling
create.
After you do that, if you try and invoke the service, you should get a
different error on the client side as the policies could not be met. To do
that, you would need to provide proper key/values via something like:
((BindingProvider)client).getRequestContext()
.put("ws-security.username", "dkulp");
((BindingProvider)client).getRequestContext()
.put("ws-security.password", "password");
etc... See the keys listed at:
http://cxf.apache.org/docs/ws-securitypolicy.html
What will be required will depend on the policy itself.
Dan
>
> Thanks,
> Manoj
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/The-security-context-token-is-expired-or-is
> -not-valid-ERROR-tp5076527p5079398.html Sent from the cxf-user mailing list
> archive at Nabble.com.
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com