A predefined REST service is a REST service of which the functionality is largely supplied by USoft.
You define such a service by basing it on one of the ready-made Functional Types that USoft ships with the Service Definer product. Using these ready-made Functional Types allows you to create general-purpose REST services quickly with a minimum of programming and debugging effort.
The most important Functional Types that USoft ships for predefined REST services are:
•"USoft Table Resource" for basic browsing and manipulation of table data in your USoft application. •"USoft Job Resource" for calling batch jobs defined in your USoft application.
Predefined REST services have predefined methods that may be inspected in the ".wadl" file but are not listed in the USoft Definer windows interface. Only methods of custom REST services may be inspected in the windows interface.
1. | Choose Define, REST Services from the USoft Service Definer menu. |
2. | If you want to use the predefined "USoft Table Resource" Functional Type, insert a new “REST Services” record with the setting: |
•Service Name: myservice 3. | In this record, depending on whether you want the predefined service to be based on "USoft Table Resource" or on "USoft Job Resource", make one of the following settings: |
•Functional Type: USoft Table Resource, or: •Functional Type: USoft Job Resource | The following defaults are generated. You should leave these unaltered: |
•Package: com.usoft.service •Relative URI Path: /myservice 5. | Press the Check button on the right-hand side. |
| This causes the “myservice” REST Service to get the Correct = Yes setting. |
|
1. | Choose Define, Services, REST Services from the USoft Service Definer menu. |
| The "REST Services" window or tab appears. |
2. | Query the REST service that you want to expose. |
3. | When you have that REST service in view, click the Servers tab and specify the server where you want to publish the REST service, for example, the default server called 'Default'. |
|
1. | In the "REST Services" window, for the REST service, click the Connections tab and specify the connection that you want the service to use. |
|
1. | Choose Define, Servers from the menu of the USoft Service Definer. |
| The Services window or tab appears. |
2. | Query the server where you want to (re)publish the REST service. |
3. | Stop the Server if it was running. Do this by choosing Actions, Stop from the menu, or by clicking the Stop icon on the icon ribbon. |
4. | (Re)publish the service(s) associated with the server. Do this by choosing Publish, Publish Services from the menu, or by clicking the Publish Services icon on the icon ribbon. |
5. | Start the Server. Do this by choosing Actions, Start from the menu or by clicking the Start icon in the icon ribbon. |
TIP: You can wrap Steps 3, 4 and 5 into one by choosing Publish, Publish and Restart from the menu or by clicking the "Publish and Restart" icon on the icon ribbon.
|
Once you have a USoft REST service running, you can test its behavior by using any favourite app.
As an example, the following steps describe how you can use the POSTMAN app.
1. | Open a Google Chrome browser window, search the download site for the “POSTMAN – REST Client” Google extension, and download it to your browser. |
2. | Click the standard “Apps” button on the Favorites bar, then click the POSTMAN item in the middle of the screen. |
3. | Optionally, on the “Basic Auth” tab, specify the database username and password required to access the service, then press Refresh Headers. |
|
If you are using "USoft Table Resource", choose a topic from this list to continue:
Retrieving data with USoft Table Resource
Adding data with USoft Table Resource
Updating data with USoft Table Resource
Deleting data with USoft Table Resource
If you are using "USoft Job Resource", choose a topic from this list to continue:
Calling a Batch Job with USoft Job Resource
|