eLink SOAP API Documentation

General Design Notes

The eLink SOAP API is obviously designed to implement the same set of function described in the elink documentation. There are, some important differences.

Initialisation

The Linksession object must be initialised by calling LinkSession.initSoapSession() prior to any other LinkSession function.

Obtaining Results

It appears that all functions that return information from the database require additional code to obtain their results. Firstly, the value returned from the basic function is a ‘request key’ for getting the results back.
Secondly, the request is only issued to the server by a call to LinkSession.executeBatch()
Thirdly, the result can be read from the response variable.
Fourthly, the actual result has to be obtained from the response using the request key obtained earlier.

For example,
suppose we want to use the LinkSession.Search() function.
According to the documentation, we could call:

var results : TDataSet;

results = LinkSession.Search(tgCont,”email1″.”user1@elink.co.uk”,false,false);

And the results would be in the results record returned from the function.

This not the same in the SOAP API. here we need some extra steps:

var id = LinkSession.Search(targets.tgCONT,”email1″,”user1@elink.co.uk”,false,false);
LinkSession.executeBatch(true,soap_successful,soap_failed);
var r= response.getNodeDataByID(id,false);

Note how the id returned from Search() is used to locate the result data. Note also that data returned from executeBatch is placed in the response global variable. Having got the results, we can process them as expected.

alert(response.getXml());
r.first();
while(!r.EOF())
{
var name = r.fieldByName(‘NAME’);
alert(name);
r.next();
}

If a function that would normally return a value which we would use directly is called, such as BeginEdit(), this function also has to be followed by an executeBatch function call, such as:

editkey := LinkSession.BeginEdit(…)

var id = LinkSession.BeginEdit(…)
LinkSession.ExecuteBatch(true,null,null);
var result = response.getNodeDataByID(id,false);
editkey = result.fieldByName(‘EDITID’); // untested, I think this is correct or on the right lines

Leave a Reply