The eXo IDE application provides the original approach to operate with REST Service to validate, deploy/undeploy and launch applications, which are compatible with the JSR-311 specification without restarting the portal, or installing additional programs. With this application, you can validate REST Service before saving, deploying, launching or undeploying the service. Feedback from server is displayed in the Output Tab:

Illustration 23. REST Service operations

All REST Service commands are placed at the right part of the Toolbar and in the Run on the top menu.

To clear the Output Panel, use the special button at the right top corner of the this panel.

To deploy some REST Services, do as follows:

The deploy request will be sent to the server. In case of no errors, one message will be displayed in the Output tab as below:

[INFO]rennes.groovy deployed successfully

Otherwise, one error message will be shown. For example,

[ERROR] rennes.groovy deploy failed. Error (400: Bad Request)
Unexpected error. Error occurs when parse stream, compiler error:
startup failed, rennes.groovy: 4: unable to resolve class javax.ws.rs.Path1
@ line 4, column 1.rennes.groovy: 8: unable to resolve class Path , unable to
find class for annotation
@ line 8, column 1.rennes.groovy: 11: unable to resolve class Path , unable to
find class for annotation
@ line 11, column 3.
3 errors

To do the Undeploy operation, do as follows:

In case of no error, you will receive a message as below:

[INFO] /repository/collaboration/rennes.groovy undeployed successfully.

You can deploy multiple REST Services, and double-deploy the services. But, you cannot undeploy services which were not previously deployed. In this case, you will receive an error message from the server as below:

With the eXo IDE, you can not only write and deploy the service, but also make requests with your own header, query and path parameters and body content using one of supported methods, view WADL-description of method, launch those services methods and view service response in the Output Tab. To do that, simply call the Launch REST Service... command by clicking the appropriate button, or select Run on the top menu as follows:

After this application has verified whether the path is correct and send the formed request to the service or display the error message, the response of service will be displayed in the Output Tab.

To learn about launching REST Service, see the REST Service operations illustration above.


Table2. Reproducing service annotations in the "Launch REST Service" dialog

You can view headers, status code and status text in the Output Panel after sending your requests. The message will be the following:

[OUTPUT] - -Status - - - - - - - -
200 OK
- -Headers- - - - - - - -
Content-Type : */*
Transfer-Encoding : chunked
Server : Jetty(6.1.x)
- -Text - - - - - - - - -
Hello steve

IDE will send OPTIONS-request and display the received response in the Output Tab. For example:

Then eXo IDE will create request and send it. The response will be added to the Output Tab:

[OUTPUT] - -Status - - - - - - - -
200 OK
- -Headers- - - - - - - -
Server : Apache-Coyote/1.1
Content-Type : text/html
Transfer-Encoding : chunked
Date : Mon, 05 Jul 2010 09:06:55 GMT
- -Text - - - - - - - - -
PathParam 1:value1; Test Query Parameter 1: value2; Test-Header1: value3; Body: example