Generating RESTful Web Service Client Stubs

See Also 

For each RESTful resource class, you can generate a JavaScript client stub that makes it easy for client applications to access the RESTful service. Using a wizard, you can select from a list of projects containing RESTful services. Alternatively, you can enter the URL of a RESTful service's WADL file (See for more information about the Java.net WADL project.) When you finish the wizard, you will have created the client stubs for the services contained by the selected projects or represented by the WADL.

To generate RESTful web service client stubs:

  1. Create a web application project.
  2. In the Projects window or Files window, right-click the web application project node and choose New. Then choose RESTful Web Service Client Stubs.

    Alternatively, you can choose the above templates by right-clicking the project node, choosing New > Other and then selecting RESTful Web Service Client Stubs from the Web Services category.

  3. Click Next and complete the wizard.
  4. In the Projects window, expand the Web Pages node. Notice that you have a 'reststubs' node, which contains the generated JavaScript classes. There is also a 'reststub.html' file. Right-click it, choose View, and then you can view the generated test page. The test page lists URIs to the client stubs, which you can click to test whether client stub generation succeeded as expected.
See Also
About Web Services
Generating a RESTful Web Service from Scratch
Using the Preregistered RESTful Web Service Components
Testing a RESTful Web Service

Legal Notices