ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Web services
  • Overview
  • Importing REST web services using the OpenAPI definition
  • Using a REST web service imported via its OpenAPI definition
  • Options for calling a web service function
  • Properties associated with the web service
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
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 the 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 starts.
  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.
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.
Remark: You can drag the name of the web service from the "Project explorer" pane and drop it directly onto the code editor, to insert 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.

Properties associated with the web service

Several properties can be used with the name of the web service. These properties are available in read and write mode.
NameType usedEffect
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/webservice_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 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.
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.
With the Negotiate authentication method, the domain must be added to the user depending on the configuration:
myWebservice..User = "DOMAIN\User"
or
myWebservice..User = "User@DOMAIN"
VersionHTTPInteger constantHTTP version used by the server:
  • httpVersion2: HTTP version 2.0. If the server does not support this version, an older version is used.
  • httpVersion2Only: Forces HTTP version 2.0: if the server does not support this version, a fatal error is displayed.
  • httpVersion1_1: HTTP version 1.1.
  • httpVersion1_0: HTTP version 1.0.
  • httpVersionDefault: HTTP version 1.0.
Minimum version required
  • Version 28
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/07/2024

Send a report | Local help