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.
The Linksession object must be initialised by calling LinkSession.initSoapSession() prior to any other LinkSession function.
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.
suppose we want to use the LinkSession.Search() function.
According to the documentation, we could call:
var results : TDataSet;
results = LinkSession.Search(tgCont,”email1″.”email@example.com”,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″,”firstname.lastname@example.org”,false,false);
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.
var name = r.fieldByName(‘NAME’);
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(…)
var result = response.getNodeDataByID(id,false);
editkey = result.fieldByName(‘EDITID’); // untested, I think this is correct or on the right lines