Hi .

I am writing a Java client to call a .NET web service which is used for authentication purposes. This authentication service return me 2 cookies. One with attribute name : ".ASPXAUTH...."
and other one with attribute name : "PWA656....".
I was having problem accessing the cookie. So I used the following code snippet :


       OMElement loginRequest = loginRequest(username,password);
       Options options = new Options();
       options.setAction(NAMESPACELogin+"Login");
       options.setTimeOutInMilliSeconds(TIMEOUT);
       options.setTo(targetEPR1);
       client.setOptions(options);
OMElement result = client.sendReceive(loginRequest); if(((CommonsTransportHeaders)((MessageContext)client.getServiceContext().getLastOperationContext().getMessageContexts().get("In")).getProperty("TRANSPORT_HEADERS")).get("Set-Cookie") != null) { this.setCookie(((CommonsTransportHeaders)((MessageContext)client.getServiceContext().getLastOperationContext().getMessageContexts().get("In")).getProperty("TRANSPORT_HEADERS")).get("Set-Cookie").toString());
}


Now my problem is that a "getProperty" operation on CommonsTransportHeaders object actually accesses a HeaderMap which is a HashMap. When this HashMap is initialized, the cookie value is overwritten as they both have same key "Set-Cookie". So I am able to access only one of them. The one I need is overwritten and is not accessible.

Can someone please suggest a method by which I can access both the cookies so that I may use the one I need or point me to some other post where this problem is addressed.

Thanks,
Rajat Bhushan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to