Hi Zsolt,

1. I don't have the solution to your problem, but maybe a meager hint.

The problem is that this cookie expires after some time.

The simplest solution would be to renew the cookie at a frequency higher than 
the cookie timeout period.
You can achieve this by running in a separate client thread a timer which does 
nothing else but renews the cookie when it triggers.

BUT - OK - the cookie times out at the server not at the client.
In which case the server likes to warn the client at any arbitrary point in 
time. 
So the occurrence of the servers warning is true asynchrony from a clients view.

Who then at the client listens all-time for this server side originating 
warning event?

2. How do real asynchronous communication on the wire work?
a) You have to configure the client with the all-time-running-listener and
b) you have to tell the server by using ws-addressing at which address and port 
   the client side running-listener is listening for the servers asynchronous 
cookie time-out-event 
c) and you have to establish the client in way that up on receiving the 
asynchronous event from the 
   server at the listener, the listener then knows how to call the supportive 
call-back-routine. 

3. Up on receiving the servers time-out-warning at this client side callback 
routine 
   then client has to invoke the server with what is required to re-new the 
cookie.

I think - what you should do is - going into the samples and study the 
non-blocking but true on the wire 
asynchronous client server communication examples of axis2. Also reading all 
about asynchronous client 
server communication but also about asynchronous transports may help you to 
find your solution.

Of big help is a TCPMONITOR or any other network tool like Wireshark etc.

Also http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html#HTTPSession
may help, after reading the things said for asynchrony.

Maybe fiddling with the scope="    " in the service.xml may help to setup cl/sv 
communication with a different pattern.

Josef


-----Ursprüngliche Nachricht-----
Von: Zsolt Kúti [mailto:kuti.zs...@prolan.hu] 
Gesendet: Donnerstag, 21. Juni 2012 09:26
An: java-user@axis.apache.org
Betreff: Re: How to cookie renewal?

Has anybody seen this problem?

I've been trying to find the way in the API to getting the http
response header with no success yet.

Any help appreciated!

Zsolt

Wed, 20 Jun 2012 10:34:26 +0200 -n
Zsolt Kúti <kuti.zs...@prolan.hu> írta:

> Hello,
> 
> In my application I can successfully call a WCF WS. The session start
> with a  login[*] where a specific cookie is provided by the server and
> this is set as an option in the Axis client for further use.
> 
> The problem is that this cookie expires after some time. It needs to
> be renewed otherwise the server rejects further requests.
> 
> The server signals this renewal request by timely sending a Set-Cookie
> tag with a new value and expiry date. My problem is that I couldn't
> yet find out how to get this information with Axis. 
> 
> These return nulls:
> 
> MessageContext inMC =
> service._getServiceClient().getLastOperationContext().getMessageContexts().get("In");
> String c1 =
> (String)inMC.getServiceContext().getProperty(HTTPConstants.HEADER_SET_COOKIE);
> String c2 =
> (String)inMC.getServiceContext().getProperty(HTTPConstants.HEADER_SET_COOKIE2);
> 
> 
> [*]: For the time being the login processing and cookie setting is
> done directly via HttpsURLConnection and SOAP.
> 
> 
> Can anyone tell me how to do this?
> 
> Thank you!



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

Reply via email to