|
|
This document presents an overview of REST Web Service
development features in MyEclipse. For a more detailed look
at our REST features, please see the
Developing REST Web
Services tutorial. To get a better feel for MyEclipse in
general, please check our product
Documentation for more
material.
If you notice portions
of this tutorial looking different than the screens you are
seeing, please
let us know and we will make sure to
resolve any inconsistencies.
|
|
2.
Creating a REST Web Services Project
Select
Web Service Project from the new toolbar menu:
Alternatively, invoke the wizard using
File > New > Other > MyEclipse >
Java Enterprise Projects > Web Service Project.
Specify the project name and select
REST (JAX-RS):
Specify the
Servlet name, URL pattern and select Jersey
libraries you need:
You can also add REST Web Service capabilities to any Java EE 5
project. From the project's context menu, select
MyEclipse > Add REST Capabilities... to bring
up the above page.
|
3.
Creating the REST Web Service
Select the
New Web Service action from the web service
toolbar menu:
Alternatively invoke the wizard using
File > New > Other > MyEclipse > Web Services >
Web Service
Select the
REST (JAX-RS) framework:
Page 2 of the wizard allows you to create a web service from a
new or existing class:
Add REST resource methods to your web service class either using
the above wizard or invoking the
MyEclipse > Add REST Method... context menu
action:
Specify the method name, path, parameter details, etc. using the
New JAX-RS Resource Method wizard:
|
4.
Deploying & Testing the Web Service
Choose the
Run As > MyEclipse Server Application item
from the project's context menu to deploy the application and
start the server:
Use the
MyEclipse > Test with REST Web Services
Explorer action to open the REST Web Services Explorer correctly
initialized for your project:
Select the operation you wish to test, fill in the input fields
and click
Test to invoke the service:
|
|
We would like to hear from you! If you liked this tutorial, has
some suggestions or even some corrections for us please let us
know. We track all user feedback about our learning material in
our
Documentation Forum.
Please be sure to let us know which piece of MyEclipse material
you are commenting on so we can quickly pinpoint any issues that
arise.
|