REP deployment Quick Start
Table of Contents
- Software requirements
- Download the REP source code
- Compile and Run the REP
- Test the REP
- REST client tools
Software requirements
To build and run the REP example code you need to meet following requirements:
- Java 6.0 SDK http://java.sun.com/javase/downloads/index.jsp
- eclipse http://eclipse.org/downloads/
- Java REST framework 'restlet' by http://www.restlet.org/
Download the REP source code
- REP example code: eclipse project 'JavaREP' which can be found as an attachment on the bottom of this page
Compile and Run the REP
In order to run the code samples please follow the steps below:
- extract the zip archive and import the eclipse project into your eclipse workspace
- fix missing class path errors (add the restlet libraries 'org.restlet.jar' and 'org.restlet.ext.xml.jar' to the project classpath
- after that the project structure should look like this:
- run uk.ac.surrey.sensei.rep.REPTest.java
If everything went well the REST server should be listening on HTTP port 8188.
Test the REP
The REP can now be tested with a suitable REST client. To request a value from a dummy light sensor reading from the file xml/sensors/light.rdf use a REST GET method call on http://localhost:8188/rep/s/light
The response is the Observation and Measurement value in XML-RDF syntax, which is returned in the Response body.
The example REP also offers value from a dummy temperature sensor reading from the file xml/sensors/temp.rdf
REST client tools
GET and POST requests can be easily tested by using a web browser. For testing other REST methods like PUT, DELETE, and OPTIONS dedicated REST client tools are available, like:
- RESTClient: plug-in for Firefox: https://addons.mozilla.org/en-US/firefox/addon/9780
- Java GUI tool: http://code.google.com/p/rest-client/
- soapUI: http://www.soapui.org/userguide/rest/index.html
Attachments (7)
- projectStructure.png (28.7 KB) - added by 12 years ago.
- runningTestServer.png (62.3 KB) - added by 12 years ago.
- runTest.png (50.6 KB) - added by 12 years ago.
- GETtemp.png (21.6 KB) - added by 12 years ago.
- GETtemp.2.png (21.6 KB) - added by 12 years ago.
- GETlight.png (21.4 KB) - added by 12 years ago.
- JavaREP.zip (80.6 KB) - added by 12 years ago.
Download all attachments as: .zip