Calls a web service routine. This method corresponds to the WebCall action.
App.WebCall(Procedure, Timeout[, Arguments])
Newlook Smartclient
Newlook Server
In order to call a web service the routine must first have been declared with either the WebDeclare or the WebDescription method.
Procedure - (String, Required)
The name of the procedure to be executed or its alias as defined in the WebDeclare or WebDescription action.
Timeout - (Integer, Required)
The number of seconds newlook will wait for a connection response from a Web Service before it will fail.
Arguments - (Optional)
The parameters to be passed to the routine as defined in WebDeclare or WebDescription. Multiple parameters can be passed by comma separating each value.
This method returns a VB Array. If you are using this method in a JScript script then you will need to convert the returned value from a VB to JScript array using the toArray() method. See the JScript example below.
The array will be dynamically created based on the number of return values. If the Web Service returns only one value then an array is still created.
If the Web service routine that you are calling returns multiple output parameters then you need to use WebDeclare instead of WebDescription.
In this example we are calling the ConvertWeight service using the WebCall and WebDescription methods and returning the weight specified in Carats. The WebCall method will return a VB array containing the output from the call: VB SCRIPT'Declare variables to store the returned array and converted weight Dim returnWeight Dim convertedWeight
'Define the web service App.WebDescription "http://www.webservicex.net/ConvertWeight.asmx?WSDL", "ConvertWeight", ""
'Make the web service call returnWeight = App.WebCall ("ConvertWeight", 100, 100, "Grams", "Carats")
'Convert the first array element to a string convertedWeight= CStr(returnWeight(0))
app.MsgBox convertedWeight, "Converted Weight in Carats"
In this example we are calling the ConvertWeight web service to return the weight specified in Carats. The WebCall method will return a VB array containing the output from the call, which is then converted to a JScript array: JSCRIPT//Define the web service App.WebDescription ("http://www.webservicex.net/ConvertWeight.asmx?WSDL", "ConvertWeight","");
//Make the web service call var returnWeightinCarats = App.WebCall ("ConvertWeight", 100, 100, "Grams", "Carats"); //Convert to a JS Array and to a String var JSArrayWeight = returnWeightinCarats.toArray(); var itemWeightinCarats = String(JSArrayWeight[0]);
app.MsgBox (itemWeightinCarats, "Converted Weight in Carats", 0, 0);
|
WebDeclare method | WebDescription method | Web Services
© 2004-2021 looksoftware. All rights reserved.