Renier Rhode wrote:
> ---- BEGIN Webservice Interaction
> 3) Call are made to the Webservice with the JSESSIONID ( retrieved in
> step 2 ) tacked on as an HTTP header.
> --- END Webservice Interaction
You can set a specific cookie in the client policy which will be sent
with every request made with that proxy. This does mean you can't use
the same client proxy object ("myService" below) for requests with
different session IDs at the same time, but that should be a reasonable
tradeoff.
// do the authentication and get the JSESSIONID
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(MyService.class);
factory.setAddress("http://....");
// whatever else you need to set up...
MyService myService = (MyService)factory.create();
Client client = ClientProxy.getClient(cxfStub);
Conduit conduit = client.getConduit();
if(conduit instanceof HTTPConduit) {
HTTPClientPolicy policy = ((HTTPConduit)conduit).getClient();
if(policy == null) {
policy = new HTTPClientPolicy();
((HTTPConduit)conduit).setClient(policy);
}
policy.setCookie(/*value of the Cookie: header*/);
}
// use myService here and it will pass your cookie with each request
Ian
--
Ian Roberts | Department of Computer Science
[EMAIL PROTECTED] | University of Sheffield, UK