ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help /  / 
  • Overview
  • Calling a REST web service function
  • 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 REST web service description
  • 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 a new element (e.g., a new product).
  • PUT to modify an existing element. .
  • DELETE to delete an element (e.g., a product).
  • PATCH to partially modify an element.
  • HEAD to get information about an element (e.g., determine if it exists).

Calling a REST web service function

You can call a REST web service function using a resource (identified by a URL).
This resource contains the type of information manipulated and its identification. The HTTP methods (verbs) used in the address define the action to be performed on the resource.
In the function, the HTTP codes (2xx, 3xx, 4xx and 5xx) indicate the response of the 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 REST web service project or project configuration.
  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 new project is opened in the editor.

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 REST web service description
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: 02/11/2025

Send a report | Local help