Hi
 
This works. But I don't have access to obj1 when I'm calling "getDetails" using 
obj2.
 
I'm calling "login" and "getDetails" in two different entities using obj1 and 
obj2 respectively, which *cannot* share anything in memory. However I can 
extract cookie from response of "login", store the cookie in some file and read 
this cookie from the file to set it in obj2 before calling "getDetails. 
 
But this is not working from me.
 
thanks,
Naresh 

Andrea Sodomaco <[EMAIL PROTECTED]> wrote:
Hi, 
Try 
obj2.setState(obj1.getState());

can it help you?

Andrea Sodomaco


-----Messaggio originale-----
Da: Naresh Agarwal [mailto:[EMAIL PROTECTED] 
Inviato: luned� 23 maggio 2005 15.32
A: [email protected]
Oggetto: session maintenance with two different HttpClient objects

Hi 

I'm using HttpClient library for writing a specialized http client.

Let's say I have two instances of HttpClient object obj1 and obj2, which
communicate with same application running in web server. This
application provide two operations - "login" and "getDetails", which
need session maintenance using cookies. 

I am using obj1 and obj2 as follows - 

1. Call "login" operation using obj1 and extract the cookie from the
response.
2. Call "getDetails" operation using obj2 after setting cookie
extracted in step 1.

But my "getDetails" fails saying that login is required. However, if I
use obj1 in step 2, it works fine.

Basically, I've a special requirement to use *two different* instances
of HttpClient to communicate with same web service (which needs session
maintenance).

Am I missing something? Does session maintenace works only if all the
operations are called using same HttpClient object?

Any help will be greatly appreciated.

thanks & regards,
Naresh Agarwal

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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


                
---------------------------------
Do You Yahoo!?
 Yahoo! Small Business - Try our new Resources site!

Reply via email to