ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help /  / 
  • Overview
  • Principle for calling a function of a REST web service
  • Steps for creating a REST web service
  • Creating a REST web service project or project configuration
  • Creating a REST web service project
  • Creating a REST web service project configuration
  • Creating a description of REST web service
  • Creating entry points
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
A REST web service is a program hosted on a server. This program contains functionalities accessible via HTTP requests. Each functionality (also called API or entry point) corresponds to a process run on the server.
Each entry point is characterized by:
  • a resource,
  • an HTTP method (GET, POST, PUT, etc.).
A REST web service can contain entry points with identical URLs and different HTTP methods (representing a different action).
The available HTTP methods are as follows:
  • GET to get information.
  • POST to create.
  • PUT to modify.
  • DELETE to delete.
  • PATCH to modify.
  • HEAD to get information.

Principle for calling a function of a REST web service

The call to a function of a REST web service is performed via a resource (URL).
This resource itself represents the nature of information used as well as their identification. The HTTP methods (verbs) used in the address are used to specify the kind of action to perform.
In the function, the HTTP codes (2xx, 3xx, 4xx and 5xx) are used to indicate the status report of REST function.
For example, the following address:
http://server/Customers/10/Orders
represents the following action: "Retrieve the list of orders for customer # 10".
In this address:
  • server represents the address of the server hosting the REST web service.
  • Customers indicates that the request will handle data about customers.
  • 10 represents the customer's ID.
  • Orders indicates that the request will handle data about orders.
This HTTP request is made using the GET method. This means that data is expected in the response.
Steps for creating a REST web service
To create a REST web service:
  1. Create a project or project configuration whose type is REST web service.
  2. Create one or more REST web service descriptions. A REST web service description can be used to group together functions that serve a common purpose.
  3. In each description, create the necessary entry points.
  4. Define the options for each description:
    • Common component,
    • Prologue procedure,
    • Authorization (for secure web services).
  5. Generate OpenAPI documentation if necessary.
  6. Test the REST web service.
  7. Generate and deploy the REST web service.
You can then program the calls to the REST web service.
It is recommended to create the REST web service entry points and associated procedures using the wizard. You will then be able to write the code of these procedure according to the desired functionality.
Creating a REST web service project or project configuration

Creating a REST web service project

To create a REST web service project:
  1. Click Create an element in the WINDEV quick access buttons. In the window that appears, click "Project". The project creation wizard opens.
  2. Choose the type of project to create: "SOAP or REST web service". Proceed to the next step of the wizard.
  3. Choose a REST web service. Go to the next step.
  4. Specify the project name and location. These options cannot be modified.
    All the objects associated with the project will be created in the specified directory.
  5. Finish the wizard. The created project becomes the current project.

Creating a REST web service project configuration

To create a REST web service project configuration:
  1. In the "Project explorer" pane, right-click "Configurations" and select "New configuration". The project configuration creation wizard opens.
  2. Select "SOAP or REST web service" and specify the name and description of the project configuration. Proceed to the next step of the wizard.
  3. Choose to generate a REST web service. Proceed to the next step of the wizard.
  4. If necessary, indicate the elements you want to integrate into the project configuration.
  5. Finish the wizard. A new REST web service description is automatically created, and the entry point creation wizard starts.
Creating a description of REST web service
Reminder: A REST web service description can be used to group together functions that serve a common purpose.
To create a REST web service description:
  1. In the "Project explorer" pane, right-click "REST web services descriptions" and select "New REST web service description".
    Creating a web service description
  2. Type the name of the REST web service description and validate.
  3. The entry point creation wizard automatically opens.
Minimum version required
  • Version 22
This page is also available for…
Comments
dead link in the page
step 3 method 1, "For more details, see Composition of resource.", the link just sends me back to step 3 method 1.
brys
20 Mar. 2024

Last update: 01/20/2025

Send a report | Local help