= REP deployment Quick Start = [[PageOutline(2-3,Table of Contents,inline)]] == 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: 1. extract the zip archive and import the eclipse project into your eclipse workspace 2. fix missing class path errors (add the restlet libraries 'org.restlet.jar' and 'org.restlet.ext.xml.jar' to the project classpath 3. after that the project structure should look like this: [[Image(projectStructure.png)]] 4. run uk.ac.surrey.sensei.rep.REPTest.java [[Image(runTest.png)]] If everything went well the REST server should be listening on HTTP port 8188. [[Image(runningTestServer.png)]] == 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 [[Image(GETlight.png)]] 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 [[Image(GETtemp.png)]] == 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