THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
To add this to your server, you'll want to get access to the Server object (see here for more info):
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.frontend.ServerFactoryBean;
...
MyInterceptor myInterceptor = new MyInterceptor();
Server server = serverFactoryBean.create();
server.getEndpoint().getInInterceptor().add(myInterceptor);
|
On the Client side the process is very similar:
Code Block | ||||
---|---|---|---|---|
| ||||
import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; ... FooService client = ... ; // created from ClientProxyFactoryBean or generated JAX-WS client MyInterceptor myInterceptor = new MyInterceptor(); Client cxfClient = ClientProxy.getClient(client); cxfClient .getInInterceptor().add(myInterceptor); |
...