Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Properties specific to the description of wsResponse variables
  • Operating mode
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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 modified using different WLanguage properties.
Remark: See Declaring a variable for more details on the declaration of this type of variable and the use of WLanguage properties.
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:
// http://www.webservicex.net/globalweather.asmx?WSDL
// 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 time-out of the request: example HTTPTimeOut(10*1000)
wsResp = GlobalWeather.GetWeather(wsReq,paramGetWeather)
IF ErrorOccurred THEN
// Ability to get the entire XML returned with: wsResp.SourceXML
Error(ErrorInfo(), ...
"---------------------------------- Details of the XML request sent: ", wsReq.XMLSource, ...
"---------------------------------- Details of the XML response received: ", wsResp.XMLSource)
// Then, assign the return type of the Webservice function to the variable
// If the result is not the expected one,
// you have the ability to get the entire result XML with wsResp.SourceXML
xmlMeteo 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.XMLSource)

Properties specific to the description of wsResponse variables

The following properties can be used to handle a wsResponse variable:
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 available in read-only.
XMLSourceBinary/BufferXML source received from the server.
This property is available in read-only.
ValueCharacter stringReturns the XML code corresponding to the first part of the response.
This property is available in read-only.

Caution: If the Webservice ne returns a single response, we recommend that you 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 by:
MyRequest is wsRequest
WebserviceResponse = WebserviceFunction(MyRequest, Param1, Param2)
The entire XML source of 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