cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John-M Baker <>
Subject Re: Rampart and CXF
Date Tue, 04 Mar 2008 15:25:14 GMT
I'm now totally confused :-) To recap, I've got a perfectly satisfactory 
solution when WSSecurity is not required. I've used the wsdl2java ant task 
to create a set of sources. My requirement is to implement WSSecurity so 
it is there when required:

Here's the code I'm fiddling with to try and add WSSecurity support:

  Query q = new Query(url);
  qPort = q.getQueryHttpport();

  Client cxfClient = ClientProxy.getClient(qPort);
  cxfClient.getInInterceptors().add(new SAAJOutInterceptor());
"moo")); // This just creates a callback handler

So, are you suggesting I use qPort as follows:

qPort.myWSMethod() ?

That seems bizarre. Surely I need to do something else?

John Baker
Web SSO 
IT Infrastructure 
Deutsche Bank London


Willem Jiang <> 
04/03/2008 15:20
Please respond to


Re: Rampart and CXF


You just use the FooService (client) as usual. The cxfClient will build 
up the interceptors each time before it send out the message when you 
invoke the client proxy method.
I will update the wiki as you suggested.

BTW,  You could also add the interceptor through the 
ClientProxyFactoryBean by calling


John-M Baker wrote:
> Hi,
> Thanks for your response. Having read the Wiki, I still appear to be 
> missing something:
> FooService client = ... ; // created from ClientProxyFactoryBean or 
> generated JAX-WS client
> MyInterceptor myInterceptor = new MyInterceptor();
> Client cxfClient = ClientProxy.getClient(client);
> cxfClient.getInInterceptor().add(myInterceptor);
> What do I do with cxfClient? How do I make a call on FooService (client) 

> and invoke the interceptor? I'm assuming the call is made through 
> Does it really involve the invoke methods on Client? I think that by 
> adding an example call to the end fo that code sample, the Wiki would 
> a little more sense.
> John Baker


This e-mail may contain confidential and/or privileged information. If you are not the intended
recipient (or have received this e-mail in error) please notify the sender immediately and
delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in
this e-mail is strictly forbidden.

Please refer to for additional EU corporate
and regulatory disclosures.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message