PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Pre-launched sessions
  • Passing parameters in the raw data of the request (POST or PUT method)
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
WebserviceParameter (Function)
In french: WebserviceParamètre
AjaxNot available
Allows you to retrieve the value of a parameter when calling a request from a Webservice (SOAP or REST).
Remarks:
  • The parameters can be passed to a REST Webservice according to 2 methods:
    • Passing in the URL (URL such as "http://....?Param1=value1&Param2=value2..."). To retrieve the parameter value, use the syntax 1 or 2.
    • Passing in the raw data of the request (POST or PUT method). To retrieve the parameter value, use the syntax 3.
  • In the case of a SOAP Webservice, the parameters are passed in the raw data of the request (Post method, PUT, ...). To retrieve the parameter value, use the 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 Webservice only) Hide the details

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

Retrieving the value of a parameter identified by its subscript (REST Webservice only) Hide the details

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

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
Valeur of requested message type:
  • Data received.
  • Empty buffer if no data.
Remark: A fatal error is triggered if the query does not return 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 "Initializing" event of the project. This function must only be used in the event "Initializing the project after connection to the site".

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

To transmit parameters in the raw data of the request (POST, PUT method, ...) from a WINDEV or WEBDEV application, it is for example possible to use the Property Content of an Variable of type restRequest.
Component: wd270awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment