I have a service that requires an authentication credential to be passed as a 
cookie. When using XFire, I can't seem to get the cookie to be transmitted. I'm 
doing the following:

    Service service = new AnnotationServiceFactory().create(ServiceImpl.class);

    ServicePortType port = (ServicePortType) new 
XFireProxyFactory().create(service, "http://domain.com/path/to/ws";);

    Client client = Client.getInstance(port);

    HttpState state = new HttpState();
    state.addCookie(new Cookie("domain.com", "cookiename", "cookievalue"));

    client.setProperty(CommonsHttpMessageSender.HTTP_STATE, state);

I then make my service call, which fails because the request is missing 
credentials. If I sniff the connection I can see that the cookie header is not 
being passed. I did some debugging in the code and I can see an entirely 
different HttpState object being used, explaining why my cookie isn't being 
picked up.

The docs on the Client API indicate that you can meddle with the HttpClient 
configuration through the Client class, but XFire seems to be ignoring anything 
I set in my case. If someone can point me in the right direction, I'd 
appreciate it.

Ryan Kennedy

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to