Quick start 1: RESTful server application

This quick start provides step-by-step instruction for creating a RESTful Web service server application using the high-level framework. The application will manage access to customers stored in a database.

This quick start guides you through creating a Web service application. This involves coding two modules:
  • the Web service, where you define functions providing access to its resources
  • the Web service server that registers and starts the Web service

For our application, the resource is a list of customers stored in a database.

The Web service application exposes the resource as a REST API that clients can access using Uniform Resource Identifiers (URIs). We define resource endpoints with URIs that enable access to the resource:

In our example, the web service is on the localhost. For a production environment, the service would be deployed on a Genero Application Server (GAS). For more information, see the Genero Application Server User Guide.

  • Get details of all customers:
    GET http://localhost:8090/MyService/customers
  • Get details of a customer with the specified customer id:
    GET http://localhost:8090/MyService/customers/id

We use the RESTful high-level framework to code two functions in the Web service that respond to requests from these URIs. To see the web service work, we can run the web service in direct mode and test it from the browser, as we perform read (GET) actions only.

We define functions to insert (POST), update (PUT), and delete (DELETE) resources in Quick start 2: RESTful server application, part 2.