This help topic offers a practical walk-through that helps you get started with USoft REST services. At the end of this walk-through, you will have set up:
•A fully functional default REST service, •An environment where you can start creating REST services of your own. As a prerequisite, you need a USoft application that already has some data structure that is interesting to advertise as a REST interface, for example, a travel booking table. This can be a try-out application with 1 table that you build quickly just for the occasion, or it can be a large, existing USoft application.
In this help topic we will assume you have a USoft application called TRAVEL.
If you haven't approached your USoft tables with a Rules Service before, you need to create one now. Instructions on how to do this are in the Model and Rules Guide, which is also part of the on-screen USoft Definer Help.
If you have a Rules Service already, look up (in USoft Binder) which port number it uses.
|
1. | In the USoft Binder file that you use for the application, create a new User Application item and call it "Service Definer". |
2. | Right-mouse-click on the item and choose Properties. On the Property Sheet, specify From = Flat Files and App.Name = USERVICE. |
3. | Right-mouse-click on the item and choose Create Tables. |
4. | Double-click to open USoft Service Definer. |
|
1. | Create a folder 'c:\usoft\servers\Default\' on your computer. |
2. | Choose Define, Servers from the menu. |
3. | Insert a new Server record. Specify Name = 'Default' and Publication File Path = 'c:\usoft\servers\Default\' (mind the backslash at the end). |
4. | On the Security tab, in the Cors Configuration field, choose Default. |
5. | Save. A default setting Base URI = 'http://0.0.0.0:8090' is generated. Leave this unaltered unless you want a different port from 8090. |
6. | Install the server. Do this by choosing Actions, Install from the menu whilst having input focus on the “Default” Server record. The server is now visible in the Services console in the Control Panel of your PC. |
More on this step
|
1. | Choose Define, Applications from the USoft Service Definer menu. |
2. | Insert a new Application record with Application Name = 'TRAVEL'. |
3. | On the Defined Connections tab, and specify Connection Name = 'myconnection', Host Name = 'localhost' and Port Number = <the port number of your Rules Service>. |
4. | Save work. This will cause defaults to appear in remaining fields. |
More on this step
|
1. | Choose Define, REST Services from the menu. |
2. | Insert a new “REST Services” record with Service Name = 'myservice' and Functional Type = 'USoft Table Resource'. Save. Some default values are generated; leave these unaltered. |
3. | Press the Check button on the right-hand side. This causes the the Correct = Yes flag to be set. |
4. | Click the Servers tab and insert a record with Server Name = 'Default'. |
5. | Click the Connections tab and insert a record with Connection = 'myconnection'. |
6. | Go back to the Server record you created in Step 3. With input focus on it, choose Publish, Publish and Restart. |
More on this step
|
1. | Open a Google Chrome browser window, search the download site for the "POSTMAN – REST Client" Google extension, and download it to your browser. |
| Once installed, this extension can be opened easily from a new Google Chrome browser tab. To do this, click the standard "Apps" button on the Favorites bar, then click the POSTMAN item in the middle of the screen. |
2. | Open POSTMAN, and specify the following URL: |
http://localhost:8090/myservice/myconnection/tables
3. | See that the REST service gives you information from the application via the REST interface. |
More on this step
|
This step consists in making it possible for intended users to approach the service across the Internet, typically using a URL such as
https://www.mycompany.com/myservice...
Exactly how you do this depends on your organisation's IT architecture and its company standards for domain control and web security.
More on this step
|
See Also
REST Services
|