Client protocol
Overview
The protocol is based on requests and responses. The client builds a experiment string, a request, and sends it to the server. The server then handles the request and produces a response that is sent back to the client. The protocol is using XML to describe its data.
Packet transport
From 2008-12-01, the OpenLabs flash client can use either the XMLSocket API or HTTP requests to transport the request data to a server. There is a size limit on the requests/responses, which shouldn't exceed 64KB in size.
Sessions
Sessions are initialized with the default values described throughout the protocol specification. Only the entries you send in your request are updated (Differential update). Sessions are created when a successful login request is handled. A sessionkey which uniquely identifies the session will then be returned.
Protocol header
Every request/response contains a simple protocol header.
<protocol version="[Major.Minor]"> [Payload] </protocol>
- Major.Minor
- Major dot Minor version. Both must be integers.
Request types
Login
Request:
<login cookie="[cookie]" />
- cookie
- A magic cookie used to verify the session. The server can use this cookie to verify that the client is a valid user.
Response:
On success you will receive a login response:
<login sessionkey="[uniqueid]" />
The sessionkey is a unique string that identifies the active measurement session. This to allow stateless protocols such as http. The sessionkey MUST be provided in all following measurement requests. If the login fails, the server should respond with an error response.
Measurements
Request header:
<request sessionkey="uniqueid"]>[Instrument data]</request>
- Instrument data
- Contains all the instrument settings
Response header:
<response>[Instrument data]</response>
- Instrument data
- Contains the measurement data for each instrument
Heartbeat
Checks if the server is up and running. Request and response look the same:
<heartbeat/>
Error
<error>[Error message]</error>