Help / WLanguage / WLanguage functions / Communication / SOAP
  • Properties specific to wsResponse variables
  • Operating mode
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
wsResponse (Type of variable)
In french: wsRéponse
The wsResponse type is used to get:
  • the XML source code of the Webservice response.
  • the value of the different parts of the Webservice response (for the Webservices returning several responses).
The characteristics of this type can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
For a Webservice that returns 2 responses (and not a structured response)
wsResp is wsResponse = WSProcedure()
For a Webservice for which we want to retrieve the entire response XML (and the XML sent)
// WSDL of Webservice:
// Variable of parameter type of the Webservice function
paramGetWeather is GlobalWeather.GetWeather
paramGetWeather.CityName = "Paris-Charles De Gaulle Airport"
paramGetWeather.CountryName = "France"
// Variable of return type of the Webservice function
resGetWeatherResponse is GetWeatherResponse
// Instead of:
// resGetWeatherResponse = GetWeather(paramGetWeather)
// Use a "wsResponse" variable to get the entire XML result and
// a "wsRequest" variable to retrieve everything that was sent to the Webservice function
wsResp is wsResponse
wsReq is wsRequest
// Ability to force the HTTP timeout of the request: example HTTPTimeOut(10*1000)
wsResp = GlobalWeather.GetWeather(wsReq,paramGetWeather)
IF ErrorOccurred THEN
// Ability to get the entire XML returned with: wsResp.XMLSource
Error(ErrorInfo(), ...
"---------------------------------- Details of the XML request sent: ", wsReq.SourceXML, ...
"---------------------------------- Details of the XML response received: ", wsResp.SourceXML)
// Then, assign the return type of the Webservice function to the variable
// If the result is not the expected one,
// you can get the entire XML result with wsResp.XMLSource
xmlWeather is xmlDocument = XMLOpen(resGetWeatherResponse.GetWeatherResult..Value, ...
IF ErrorOccurred THEN
IF xmlWeather.CurrentWeather.Status..Text~="Success" THEN
Info("City: " + xmlWeather.CurrentWeather.Location, ...
"Time: " + xmlWeather.CurrentWeather.Time, ...
"Wind: " + xmlWeather.CurrentWeather.Wind, ...
"Visibility: " + xmlWeather.CurrentWeather.Visibility, ...
"Temperature: " + xmlWeather.CurrentWeather.Temperature, ...
"Dew point: " + xmlWeather.CurrentWeather.DewPoint, ...
"Humidity: " + xmlWeather.CurrentWeather.RelativeHumidity, ...
"Pressure: " + xmlWeather.CurrentWeather.Pressure)
Error(resGetWeatherResponse.GetWeatherResult, ...
"---------------------------------- Details of the XML response received:", wsResp.SourceXML)

Properties specific to wsResponse variables

The following properties can be used to handle wsResponse variables:
Property nameType usedEffect
ResponsePartArrayUsed to get the XML code corresponding to the specified response.
You also have the ability to use the following notation:
This property is read-only.
ValueCharacter stringReturns the XML code corresponding to the first part of the response.
This property is read-only.
XMLSourceBinary/BufferXML source received from the server.
This property is read-only.

Caution: If the Webservice returns only one response, it is recommended to keep the following syntax:
res is ReturnType = WSProcedure()

Operating mode

The wsResponse type is used to get the XML source of the request sent for the consumption of the Webservice.
SOAPPrepare already gives the information for the general case but not when the Webservice requires:
Practically, the standard call to a function:
WebserviceResponse = WebserviceFunction(Param1, Param2)
can be replaced with:
MyRequest is wsRequest
WebserviceResponse = WebserviceFunction(MyRequest, Param1, Param2)
The entire XML source of the request can be included in a buffer via the following code:
This feature may be useful during the design step and it is required to get some certifications.
Minimum version required
  • Version 18
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help