|
|
|
|
- Pre-launched sessions
- Passing parameters in the raw data of the request (POST or PUT method)
WebserviceParameter (Function) In french: WebserviceParamètre
Not available
Gets the value of a parameter in a call to a SOAP or REST Webservice request. 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.
- For SOAP Webservices, parameters are passed in the raw data of the request (POST, PUT, etc.). To retrieve the parameter value, use the syntax 3.
// REST Webservice: retrieves the list of customers // with an optional filter on the state. // GET + /Customers[?state=xxx] sState is string // Use the syntax 1 sState = WebserviceParameter("state") // Use the syntax 2 // sState = WebserviceParameter(1) IF sState <> "" THEN HFilter(Customer, State, sState) END // REST Webservice: retrieves the list of customers // according to the filters specified in POST in JSON. // POST + /Customers sCustomerFilter is string vParameters is Variant // Retrieves the parameter value according to syntax 3 sCustomerFilter = WebserviceParameter(paramBuffer) // Convert the parameter value in a Variant // to study the content vParameters = JSONToVariant(sCustomerFilter) 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 Name of parameter whose value will be returned. <Encoding>: Optional Integer constant Mode for managing the encoding of parameter value:
| | paramNoDecoding | The 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 encoding/decoding standard of URLs. |
Retrieving the value of a parameter identified by its index (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 Index of the parameter whose value will be returned. <Encoding>: Optional Integer constant Mode for managing the encoding of parameter value:
| | paramNoDecoding | The 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 encoding/decoding standard of URLs. |
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 thrown if the request does not return data (e.g., DELETE method). <Type of message>: Integer constant Type of data to retrieve: | | paramBuffer | Retrieves 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 "Initialize project after connecting to the site" 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.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|