SOAP SESSION :Reuse the session

81 views
Skip to first unread message

mouna sghaier

unread,
Nov 15, 2011, 5:23:05 AM11/15/11
to jira-extended-webservice

Hi,

I got the sample Jira soap client program from Atlassian's web site.
It always takes a long time to connect to the server. Code is here

token = getJiraSoapService().login(userName, password);
public JiraSoapService getJiraSoapService() { return
jiraSoapService; }

Object jiraSoapService is instantiated in the contructor: public
SOAPSession(URL webServicePort) { jiraSoapService =
jiraSoapServiceLocator.getJirasoapserviceV2(webServicePort); }

Every time when the client program is called, a new session would be
created. That's annoying because the connection may take 2 or 3
seconds.

So I ask is there are anyway to reduce the time or reuse the session
( the session is connected , timeout out...)?


Thanks
Mouna sghaier

Ath

unread,
Nov 15, 2011, 6:58:59 AM11/15/11
to jira-extended-webservice
You could use a static class or static Object to connect to the
server, and re-use that when needed. (wrap it all in a static method
for login maybe?) You'd probably need to keep a state variable too, to
record if it's (still) valid.
Do remember that the lifetime of the connection is determined by the
Jira-server, if there hasn't been any activity for some time (30 or 60
minutes?, default time-out) the connection is closed, so your
application should be prepared to re-connect on failure, it doesn't
auto-reconnect like the web-pages do.
Reply all
Reply to author
Forward
0 new messages