GET WEB SERVICE RESULT

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2003


GET WEB SERVICE RESULT (returnValue{; returnName{; *}})

ParameterTypeDescription
returnValueVariableValue returned by the Web Service
returnNameStringName of the parameter to be retrieved
*Free up memory

Description

The GET WEB SERVICE RESULT command is used to retrieve a value sent back by the Web Service as a result of the processing performed.

Note: This command must be used only after the CALL WEB SERVICE command.

The returnValue parameter receives the value sent back by the Web Service. Pass a 4D variable in this parameter. This variable is generally $0, corresponding to the value returned by the proxy method. It is, however, possible to use intermediary variables (you must use process variables only).

Note: Each 4D variable or array used must be previously declared using the commands of the "Compiler" and "Arrays" themes.

The optional returnName parameter is used to specify the name of the parameter to be retrieved. However, since most Web Services only return a single value, this parameter is generally not necessary.

The optional * parameter signals the program to free up the memory devoted to the processing of the request. You must pass this parameter after retrieving the last value sent by the Web Service.

Example

Imagine that a Web Service returns the current time in any city in the world. The parameters received by the Web Service are the name of the city and the country code. In return, the Web Service sends the corresponding time. The proxy calling method could be in the following form:

   C_TEXT($1)
   C_TEXT($2)
   C_TIME($0)

   SET WEB SERVICE PARAMETER("city";$1)
   SET WEB SERVICE PARAMETER("country_code";$2)

   CALL WEB SERVICE("http://www.citiesoftheworld.com/WS";"WSTime#City_time";"City_time";
                                    "http://www.citiesoftheworld.com/namespace/default")

   If (OK=1)
      GET WEB SERVICE RESULT($0;"return";*) 
   End if 

See Also

CALL WEB SERVICE, SET WEB SERVICE PARAMETER.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next