Generating RESTful Web Service JavaScript Clients

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 > Other > Web Services > RESTful JavaScript Client.
  3. Click Next and complete the wizard.
  4. In the Projects window, expand the Web Pages node. Notice that you have a 'rest' node, which contains the generated JavaScript classes. There is also a 'TestStubs.html' file. Right-click it, choose View, and 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
Using the Web Service Manager
Testing a RESTful Web Service

Legal Notices