4

Is there a call I can make to determine whether my session is still alive in a gsoap client?

The only way I see to check if a session is still alive is to check to see if all the cookie values match after each soap call. It seems like gsoap would be aware of the session being alive since the tcp_keep_alive flag is set. Is there functionality in gsoap that would allow me to check this before a soap call? Is there a callback that will inform me of session loss? Or should I just make a dummy soap method for this purpose?

Veerendra
  • 2,562
  • 2
  • 22
  • 39
Fredrick
  • 1,210
  • 2
  • 15
  • 24
  • 1
    Cookies is one way to go, as you already noted. [Section 19.11](http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc19.11) also has notes about monitoring gSOAP errors for SOAP_EOF. There is also notes for UNIX implementations about implementing a signal handler for SIGPIPE. – Dave Newman Apr 06 '13 at 15:55

1 Answers1

0

You can use Genivia Plugin ,to Ckeck and create or update a session on localhost:8080 that is valid on any path:

soap->cookie_domain = "localhost:8080";
struct soap_session *session = soap_start_session(soap, NULL, NULL); 

To create a new session variable or modify an existing session variable inside that session:

soap_set_session_var(soap, "session_var_name", "session_var_value", NULL, NULL);

To access the value of that session variable:

const char *value = soap_get_session_var(soap, "session_var_name", NULL, NULL);

To delete that session variable:

soap_clr_session_var(soap, "session_var_name", NULL, NULL);