SCOPE
elink.dll and econfig.dll
ISSUE DESCRIPTION
In using the eLink SOAP API, I note that I need to invoke the LinkSession.InitSOAPSession function in order to setup the session. I have arrange to do this as the first step after page loading. For instance:
:
:
function load()
{
if (!currentuserid)
{ //if parameters are not already loaded
LinkSession.initSoapSession()
{ //if parameters are not already loaded
LinkSession.initSoapSession()
//load server settings (SOAP function in eLinkSOAPProxy.js)
}
}
}
:
:
<body onload=”load()”>
Unfortunately, this approach appears to be unreliable (see attached image for example of the error reported). Often it fails when the page is first loaded, but subsequent attempts are more likely to succeed. I have tried delaying invocation of this function by using a timeout in javascript. While this helps, it is not 100% reliable. I have also tried performing multiple retrys, but this did not work either. (I adjusted the original function to do this and the error report attached shows it still failed after 100 tries).
SOLUTION
Log onto an elink database before initialising the SOAP session. This step is non-intuitive, since it is easy to think that you would need to initialise the session before logging in. The corrected code would be like:
:
:
function load()
{
LinkSession.login(database_username, database_password, database_name);
LinkSession.executeBatch(true,login_successful,soap_failed);
LinkSession.executeBatch(true,login_successful,soap_failed);
if (!currentuserid)
{
//if parameters are not already loaded
LinkSession.initSoapSession()
//load server settings (SOAP function in eLinkSOAPProxy.js)
}
}
}
:
:
<body onload=”load()”>




