Back to index

GetLocations_v1

This method wraps the R:Com Database view EX_Locations2. See R:COM Database API document.

Parameters:

[in] usn The user-name that you need to use to authenticate on this interface.
[in] pwd The password that you need to use to authenticate on this interface.
[in] options String parameter. This is currently unused and reserved for future versions of the API. Pass in an empty string.
[out] errorMsg If an error happens this string contains the error message. In case an error has happened (this variable contains a valid non-empty string) then the return value will not contain any usable data, do not try to parse it as an xml.
[in] generationNumber A start point expressed in terms of a generation number. For more on generation numbers and restart points, see the remarks section.
[out] lastGeneration The generation number of the last entry in the returned chunk.
[in] requestedNumRows Specifies how many rows to return in this "chunk."
[out] adjustedNumRows Each customer is configured with a minimum and maximum threshold. Maximum thresholds ensure no single response becomes too large. Minimum thresholds helps prevent the server being flooded with requests returning no data. If the client requests a number of rows outside these boundaries the number of rows returned will be adjusted.
Example: CustomerA has a minimum threshold of 100, and a maximum threshold of 1000. She sends a request for 2000 records. The adjustedNumRows will be 1000.
return value If the errorMsg variable is null or empty then the returned string contains the requested data in xml format. The xml has the following structure:
<?xml version="1.0" encoding="utf-16"?>
<root>
  <EX_Locations2>
    <row LocationID="6079" Named="True" LocationDescription="TestLocation1" Address="" PostalCode="" CountryName="" UserData="info..." LocationCategoryID="1" CategoryName="General" Latitude="47.9369233333" Longitude="12.9432616667" Polygon="POLYGON ((12.9419207942 47.936025018, 12.9446025392 47.936025018, 12.9446025392 47.9378216486, 12.9419207942 47.9378216486, 12.9419207942 47.936025018))" GenerationNumber="161022" />
  </EX_Locations2>
</root>
Please note this.

Remarks

Minimum R-COM Database version

0.1435

Retrieving large amount of data

You cannot use this function to retrieve infinitely large amount of data in one call. In case you would like to get a large set of rows you will need to call this function several times. You can specify your preference about the number of rows returned in one function-call in requestedNumRows. If it is possible the webservice will use this number, but there are circumstances in which the webservice needs to adjust this number for performing the query. The real row number that was used for performing the query is retuned in adjustedNumRows.

To find out whether there is more data that was not returned with the previous call you should compare adjustedNumRows with the number of rows in the returned xml. If these two numbers match then it is likely that there are more rows to return. If the number of rows in the returned xml is smaller than ajustedNumRows then most probably you have retrieved all the data for now. No new rows will be returned until new data gets saved.

If you want to fetch the next set of data, you need to remember the value of lastGeneration from the last call and pass that value in as startPointGeneration to query the following set of rows.

There is a chance that you get the same rows more than once, your application needs to be prepared to handle this case.

Error messages

Please see this page.