ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help /  / 
  • Overview
  • Importing REST web services using an OpenAPI definition
  • Using a REST web service imported via its OpenAPI definition
  • Options for calling a web service function
  • Web service properties
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
REST web service APIs can be described using OpenAPl files.
This file can be imported into the project. The code editor recognizes the APIs described in the file.
These APIs can then be called natively.
Importing REST web services using an OpenAPI definition
To import a REST web service using its OpenAPI definition:
  1. In the "Project explorer" pane, select "Imported web services".
  2. Right-click and select "Use an API". The import wizard opens.
  3. In the wizard, locate the OpenAPI definition:
    • via an Internet address. In this case, you can specify:
      • whether HTTPS security errors should be ignored,
      • the authentication parameters, if necessary.
    • via a local JSON or YAML file.
  4. The web service is then imported into the project. The description appears in the "Project explorer" pane. You can now use the REST web service in the project.
Note: The oneOf, anyOf and allOf keywords are supported.
Using a REST web service imported via its OpenAPI definition
To handle a web service programmatically, simply use its name (as it appears in the "Project explorer" pane) in the code editor. All associated procedures will then be available.
Note: You can drag the web service from the "Project explorer" pane and drop it onto the code editor to use the web service and its functions.

Options for calling a web service function

In some cases, it may be necessary to define pre-requisites for the execution of an API function, such as the use of specific headers. You can also define the certificate and password used, as well as the timeout of the request.
You can define these parameters using a variable of type apiRequest.
The apiRequest variable must be used as the first parameter of the call to the web service function.

Web service properties

Several properties can be used with the name of the web service. These properties are available in read and write mode.
Name
Type used
Effect
AddressCharacter stringReplaces the web service call address described in the OpenAPI document with another URL. This property is useful if the web service is hosted on different servers.
This property has the following format: "http://server:port/web_service_path".
For a web service generated with WINDEV and deployed on a WEBDEV Application Server, it is the URL of the "awws" file.
Remarks:
  • Changing this property overrides all URLs described in the OpenAPI document.
  • If this property is set to an empty string (""), the URLs described in the OpenAPI document will be used.
PasswordCharacter string or Secret stringPassword used for authentication in the HTTP requests sent to the web service. This name is used only if authentication is required to access the server where the web service is hosted.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "Ansi or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
PortCharacter stringName of the port defined in the OpenAPI document. It is the port used to communicate with the server that hosts the web service. Contact your network manager or the owner of the web service.
UserCharacter stringUsername used for authentication in the HTTP requests sent to the web service. This name is used only if authentication is required to access the server where the web service is hosted.
Depending on the configuration, with the Negotiate authentication method, the domain must be assigned to the user:
myWebservice..User = "DOMAIN\User"
or
myWebservice..User = "User@DOMAIN"
VersionHTTPInteger constantHTTP version used by the server:
  • httpVersion2: HTTP 2.0. If the server does not support this version, an older version is used.
  • httpVersion2Only: Forces HTTP 2.0. If the server does not support this version, a fatal error is displayed.
  • httpVersion1_1: HTTP 1.1.
  • httpVersion1_0: HTTP 1.0.
  • httpVersionDefault: HTTP 1.0.
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/11/2025

Send a report | Local help