The following is a description of SOAP API utilities.
getVersion
Returns a string that identifies the WSAPI version. This function is useful to test the service connection, as it does not require the inclusion of credentials.
Return values: String
getRowSetInfo
Returns information about the requested rowset.
Parameter | Type | Description |
---|---|---|
idRowSet | String | Id of the rowset |
Return values: MNRowSetInfo
Batch exchange of data with MagNews WSAPI
Sometimes you need to receive a large amount of data from the WSAPI - e.g. think of the possibility of receiving all the contacts of an audience.
You have to use the MNRowSetInfo data structure to perform this data exchange.
The functions of WSAPI whose name starts with 'query' return a string that provides a MNRowSetInfo object ID that represents a batch of data pre-stored on the server and that encloses information such as the previously past ID (getIdRowSet function), the number of existing rows (getCount function) and the type of past data (getDataType data).
In reference to any type of data available, there are existing functions - whose names starts with "fetch" - that return a list of results obtained from a MNRowSetInfo.
RowSets can be removed on a programmatic level (releaseRowSet function) or with a system that automatically destroys the RowSets after a pre-established time (about 10 minutes) from the latest use.
E.g.:
String idRowSet = wsapi.queryContactsByGroup(10); MnRowSetInfo info = wsapi.getRowSetInfo(idRowSet); try { List contacts0_9 = wsapi.fetchContacts(info.getIdRowSet(), 0, 9); List contacts10_19 = wsapi.fetchContacts(info.getIdRowSet(), 10, 19); } finally { wsapi.destroyRowSetInfo(info.getIdRowSet()); }