WebDeclare Method

Describes a Web service routine in a low-level manner and allows for multiple return values. After the WebDeclare method, the routine can be called with the WebCall method.

App.WebDeclare(URL, SoapAction, Procedure,[Namespace,][Alias,][Arguments ,][Returns])

Client support

   Newlook Smartclient only.

Use

While it is certainly easier to call a web service defined by a WSDL file, there are times when it may not be advantageous to do so. These scenarios include:

  • When you wish to make use of user-defined types in your web service call.
  • When you wish to avoid the round trip to the web server to retrieve the WSDL.
  • When the WSDL for the web service has not been published.

In theses instances you will need to use the WebDeclare action or method to define the web service instead of the high level WebDescription.

This is particularly true if you want to utilize user-defined types with web services as the WebDescription method does not support user-defined types.

TIP

If you know the location of the WSDL file for the Web Service you may prefer to use the WebDescription method instead. This high-level action is easier to use and allows the user to define a Web Service routine simply by providing a URL to a WSDL file.

Arguments

Url - (String, Required)

Specifies the end-point URL of the Web service.  

SoapAction- (String, Requiredl)

Specifies the Soap Action. Use "" for none.

Procedure - (String, Required)

Specifies the name of the routine. Also called 'Operation' in Web Service terminology.  

Namespace - (String, Optional)

Specifies the web service namespace URI (Uniform Resource Identifier).  

Alias - (String, Optional)

Specifies an alternate name that you can use in the Call action.  Use "" for none.

Arguments - (String, Optional)

Described the parameters required by the external routine.

Each argument is defined with the following syntax, with multiple arguments separated by a comma:

name1 As type, name2 As type

The arguments are always passed as if they were declared ByVal. You do not need to specify ByVal however you must explicitly specify ByRef if required.

The types supported are Boolean, Integer, Long, Single, Double, String, and user-defined types.

Returns - (String, Optional)

Defines the expected return values from the executed routine. Each return value is defined with the following syntax, with multiple arguments separated by a comma - name As type

Return values are always passed as ByRef. You do not need to specify ByRef.

The types supported are Boolean, Integer, Long, Single, Double, String, and user-defined types.

The return value names used in the Returns parameter are important as the webcall will fail to return the expected output value for that argument if the value names specified in the WebDeclare action do not exactly match those defined in the web service itself. This parameter is case sensitive.

For example, If we have a Web Service which has two output string attributes: 'Title' and 'Username', then the Returns parameter in the WebDeclare action should look like:

Title as String, Username as String

If the following was entered in the Returns parameter of the WebDeclare then it would fail:

var1 as String, var2 as String

Returns

This method has no return value. The user will be notified with a run-time error if the web service is not defined.

Applies To

App object

See Also

WebDeclare Action | WebDescription method | WebCall method | Web Services


© 2004-2021 looksoftware. All rights reserved.