ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Web service functions
  • Pre-launched sessions
  • Passing parameters in the raw data of the request (POST or PUT method)
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
WebserviceParameter (Function)
In french: WebserviceParamètre
AjaxNot available
Gets the value of a parameter in a call to a SOAP or REST web service.
Remarks:
  • Parameters can be passed to a REST web service using two methods:
    • In a URL (URL of type "http://....?Param1=value1&Param2=value2..."). To retrieve the parameter value, use syntax 1 or 2.
    • In the raw data of the request (POST or PUT method). To retrieve the parameter value, use syntax 3.
  • For SOAP web services, parameters are passed in the raw data of the request (POST, PUT, etc.). To retrieve the parameter value, use syntax 3.
Example
// Webservice REST : récupère la liste des clients 
// avec un filtre optionnel sur le département.
// GET + /Clients[?departement=xxx]
sDépartement is string

// Utilisation de la syntaxe 1 
sDépartement = WebserviceParameter("departement") 

// Utilisation de la syntaxe 2
// sDépartement = WebserviceParamètre(1)

IF sDépartement <> "" THEN
	HFilter(Client, Département, sDépartement)
END
// Webservice REST : récupère la liste des clients 
// selon des filtres indiqués en POST en JSON.
// POST + /Clients
sFiltreClient is string
vParametres is Variant 

// Récupère la valeur du paramètre selon la syntaxe 3
sFiltreClient = WebserviceParameter(paramBuffer)

// Conversion de la valeur du paramètre dans un Variant 
// pour analyse du contenu
vParametres = JSONToVariant(sFiltreClient)
Syntax

Retrieving the value of a parameter identified by its name (REST web service only) Hide the details

<Parameter value> = WebserviceParameter(<Parameter name> [, <Encoding>])
<Parameter value>: Character string
Corresponds to:
  • Value of the specified parameter.
  • Empty string ("") if the parameter does not exist or has no value.
<Parameter name>: Character string
Name of the parameter whose value is to be returned.
<Encoding>: Optional Integer constant
Parameter value encoding mode:
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the encoding of the URL does not comply with the standards used by WEBDEV (e.g., "+" sign not supported, etc.)
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the URL encoding/decoding standard.

Retrieving the value of a parameter identified by its index (REST web service only) Hide the details

<Parameter value> = WebserviceParameter(<Parameter index> [, <Encoding>])
<Parameter value>: Character string
Corresponds to:
  • Value of the specified parameter. This value has the following format: <Parameter name> = <Value>.
  • Empty string ("") if the parameter does not exist.
<Parameter index>: Integer
Index of the parameter whose value is to be returned.
<Encoding>: Optional Integer constant
Parameter value encoding mode:
paramNoDecodingThe raw value of the parameter is returned. No decoding is performed by WEBDEV. This constant can be used when the encoding of the URL does not comply with the standards used by WEBDEV (e.g., "+" sign not supported, etc.)
paramWithDecoding
(Default value)
The parameter value is automatically decoded by WEBDEV according to the URL encoding/decoding standard.

Retrieving specific data (raw data of the request sent by a POST or PUT method.) Hide the details

<Result> = WebserviceParameter(<Type of message>)
<Result>: Buffer
Value of the requested message type:
  • Data received.
  • Empty buffer if there is no data.
Note: A fatal error is triggered if the request returns no data (e.g. DELETE method).
<Type of message>: Integer constant
Type of data to retrieve:
paramBufferRetrieves the raw data that was received (sent by POST or PUT methods).
Remarks

Pre-launched sessions

If your project uses pre-launched sessions, this function must not be used in the project initialization event. This function must only be used in the "Initialization when connecting to a pre-launched session" event.

Passing parameters in the raw data of the request (POST or PUT method)

To pass parameters in the raw data of the request (POST or PUT method) from a WINDEV or WEBDEV application, you can use the Content property of a variable of type restRequest.
Component: wd300awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help