How can I transfer GPS data from TRBOnet to another application?
The article was successfully sent to the email
There are different ways to obtain GPS data from TRBOnet.
Data transfer based on schedule
Load GPS history
The example shows how you can to load GPS history of radios from server.
C#
The test form is only available for requests from the local machine.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /customdata/trbonetdataservice.asmx HTTP/1.1
Host: web.trbonet.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://trbonet.com/GetLocations"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<TrbonetHeader xmlns="http://trbonet.com/">
<UserName>string</UserName>
<Password>string</Password>
</TrbonetHeader>
</soap:Header>
<soap:Body>
<GetLocations xmlns="http://trbonet.com/">
<start>dateTime</start>
<end>dateTime</end>
<radioId>int</radioId>
</GetLocations>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetLocationsResponse xmlns="http://trbonet.com/">
<GetLocationsResult>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
</GetLocationsResult>
</GetLocationsResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /customdata/trbonetdataservice.asmx HTTP/1.1
Host: web.trbonet.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<TrbonetHeader xmlns="http://trbonet.com/">
<UserName>string</UserName>
<Password>string</Password>
</TrbonetHeader>
</soap12:Header>
<soap12:Body>
<GetLocations xmlns="http://trbonet.com/">
<start>dateTime</start>
<end>dateTime</end>
<radioId>int</radioId>
</GetLocations>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetLocationsResponse xmlns="http://trbonet.com/">
<GetLocationsResult>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
</GetLocationsResult>
</GetLocationsResponse>
</soap12:Body>
</soap12:Envelope>
Data transfer in Real-time
Get new radio locations
The example shows how you can get a new locations of radios
C#
Note!
We strongly not recommend accessing TRBOnet Database directly. TRBOnet Support team will not provide information on TRBOnet Database structure or advises of direct Database information transfer to avoid possible TRBOnet Database corruption. Data transfer based on schedule
"Export Data" Task
Refer to current TRBOnet user manual (Technical Documentation library). Chapter Export Data
TRBOnet API
Note!
Before performing this step, make sure that TRBOnet API is the same version as TRBOnet application you are running.
TRBOnet site contains API for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running. TRBOnet API method requires API feature activated in License.
Before performing this step, make sure that TRBOnet API is the same version as TRBOnet application you are running.
TRBOnet site contains API for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running. TRBOnet API method requires API feature activated in License.
Load GPS history
The example shows how you can to load GPS history of radios from server.
C#
CopyClient client = new Client();
List<Device> m_devices = new List<Device>();
//...
//...
int requestId = 0;
void GetGPSHistoryForWeek()
{
List<int> ids = new List<int>();
foreach (var item in m_devices)
{
ids.Add(item.ID);
}
client.HistoryDataReceived += new EventHandler<Objects.Event_args.HistoryDataReceivedEventArgs>(client_HistoryDataReceived);
requestId = client.GetHistory(ids, DateTime.Now.Subtract(TimeSpan.FromDays(7)), DateTime.Now, false, false, new Objects.Reports.Filters.GPSCorrectParams(), false);
}
void client_HistoryDataReceived(object sender, Objects.Event_args.HistoryDataReceivedEventArgs e)
{
if (e.RequestID == requestId)
{
foreach (var item in e.HistoryList)
{
int deviceId = item.Key;
List<GPSInfo> gps = item.Value;
//Some actions
//...
}
}
}
List<Device> m_devices = new List<Device>();
//...
//...
int requestId = 0;
void GetGPSHistoryForWeek()
{
List<int> ids = new List<int>();
foreach (var item in m_devices)
{
ids.Add(item.ID);
}
client.HistoryDataReceived += new EventHandler<Objects.Event_args.HistoryDataReceivedEventArgs>(client_HistoryDataReceived);
requestId = client.GetHistory(ids, DateTime.Now.Subtract(TimeSpan.FromDays(7)), DateTime.Now, false, false, new Objects.Reports.Filters.GPSCorrectParams(), false);
}
void client_HistoryDataReceived(object sender, Objects.Event_args.HistoryDataReceivedEventArgs e)
{
if (e.RequestID == requestId)
{
foreach (var item in e.HistoryList)
{
int deviceId = item.Key;
List<GPSInfo> gps = item.Value;
//Some actions
//...
}
}
}
TRBOnet Web Console
Note!
Before performing this step, make sure that TRBOnet Web Console is the same version as TRBOnet application you are running.
TRBOnet site contains Web Console for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running.TRBOnet Web Console method requires TRBOnet Web Console feature activated in License.
Before performing this step, make sure that TRBOnet Web Console is the same version as TRBOnet application you are running.
TRBOnet site contains Web Console for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running.TRBOnet Web Console method requires TRBOnet Web Console feature activated in License.
GetLocations
TestThe test form is only available for requests from the local machine.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /customdata/trbonetdataservice.asmx HTTP/1.1
Host: web.trbonet.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://trbonet.com/GetLocations"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<TrbonetHeader xmlns="http://trbonet.com/">
<UserName>string</UserName>
<Password>string</Password>
</TrbonetHeader>
</soap:Header>
<soap:Body>
<GetLocations xmlns="http://trbonet.com/">
<start>dateTime</start>
<end>dateTime</end>
<radioId>int</radioId>
</GetLocations>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetLocationsResponse xmlns="http://trbonet.com/">
<GetLocationsResult>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
</GetLocationsResult>
</GetLocationsResponse>
</soap:Body>
</soap:Envelope>
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /customdata/trbonetdataservice.asmx HTTP/1.1
Host: web.trbonet.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<TrbonetHeader xmlns="http://trbonet.com/">
<UserName>string</UserName>
<Password>string</Password>
</TrbonetHeader>
</soap12:Header>
<soap12:Body>
<GetLocations xmlns="http://trbonet.com/">
<start>dateTime</start>
<end>dateTime</end>
<radioId>int</radioId>
</GetLocations>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetLocationsResponse xmlns="http://trbonet.com/">
<GetLocationsResult>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
<GpsDataEx>
<ID>int</ID>
<RadioID>int</RadioID>
</GpsDataEx>
</GetLocationsResult>
</GetLocationsResponse>
</soap12:Body>
</soap12:Envelope>
Data transfer in Real-time
TRBOnet API
Note!
Before performing this step, make sure that TRBOnet API is the same version as TRBOnet application you are running.
TRBOnet site contains API for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running. TRBOnet API method requires API feature activated in License.
Before performing this step, make sure that TRBOnet API is the same version as TRBOnet application you are running.
TRBOnet site contains API for current Release version, if you are running TRBOnet of another build version - contact support@trbonet.com and specify exact TRBOnet build version you are running. TRBOnet API method requires API feature activated in License.
Get new radio locations
The example shows how you can get a new locations of radios
C#
Copyclient.DeviceLocationChanged += new EventHandler<DeviceLocationChangedEventArgs>(UpdateDeviceLocation);
//...
//...
void UpdateDeviceLocation(object sender, DeviceLocationChangedEventArgs e)
{
foreach (GPSInfo i in e.GPSData)
{
Device device = m_devices.Find((d) => d.ID == i.DeviceID);
if (device != null)
device.GPSInfo.Update(i);
}
}
//...
//...
void UpdateDeviceLocation(object sender, DeviceLocationChangedEventArgs e)
{
foreach (GPSInfo i in e.GPSData)
{
Device device = m_devices.Find((d) => d.ID == i.DeviceID);
if (device != null)
device.GPSInfo.Update(i);
}
}