You need to sign in to do that
Don't have an account?
Checking to see if session is still available.
Can anyone recommend a way to check if a session is still available? I know there are ways to set the expiration period, however, I'd like my program to be aware of the session state so it can request a new one if it has timed out.
Currently I've wrapped the SoapBindingStub in a Singleton. On every call to getInstance() of my singleton, I can check the status of the session before returning the SoapBindingStub. This way, I can request a new stub if it has expired.
I can't seem to locate a means to check for session state in the API documentation. I know it is kind of a hack, but would checking the value of SoapBindingStub.getUserInfo() tell me anything? i.e., if the session is expired would this return null or throw an exception I could catch and then create a new instance of the SoapBindingStub.
Any suggestions on how to do so a more appropriate way?
Thanks again in advance.
Regards,
Simon,
Good point.
Fortunately the SoapBindingObject is seldomly used in this application (just used to query SF every now and then). So, when I get access to a SoapBindingObject I'll only be making one call to it.... and then getting the instance through my singleton to make a future call. i.e., the singleton getInstance() method can do the check each time..
Of course this is a limitation if I need to execute more operations on the SoapBindingObject. It could timeout at any time.
Thanks.