In the Projects window or Files window, right-click the web application project node
and choose New. Then choose one of the following:
- RESTful Web Services from Entity Classes. Creates RESTful web services from a set of entity classes.
>
- RESTful Web Services from Patterns.
Creates RESTful web services using one of the following patterns:
- Singleton. Creates a singleton RESTful resource
class with GET and PUT methods. This pattern is useful for creating
a simple HelloWorld service and wrapper services for invoking
WSDL-based web services.
- Container-Item. Creates a pair of RESTful resource
classes, consisting of an item resource class and its container
resource class.
Item resources can be created and added to the container resource
using the POST method on the container resource class. Note
that the URI for the newly created item resource is determined
by the container resource.
- Client-Controlled Container-Item. Creates a pair of RESTful
resource classes, consisting of an item resource class and its container
resource class.
This pattern is a slight variation of the Container-Item pattern.
The difference is that there is no POST method on the container
resource class for creating item resources. Instead, item resources
are created using the PUT method on the item resource class.
The reason this is called Client-Controlled Container-Item pattern
is because the URI for the item resource is determined by the client
and not the container resource.
Alternatively, you can choose the above templates
by right-clicking the project node, choosing New > Other
and then selecting them from the Web Services category.