April 8, 2002 - Calling the Add Web Service | WebReference

April 8, 2002 - Calling the Add Web Service

Yehuda Shiran April 8, 2002
Calling the Add Web Service
Tips: April 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Here is the Add Web service in action:

Enter First Number:
Enter Second Number:

The function addNumbers() is invoked when the Add button is clicked. It calls the webservice behavior's callService() method. The parameters are: (i) the function that handles the result display, (ii) the Web service command, add, (iii) the first number, and (iv) the second number:

function addNumbers(a, b) {
  myWebService.simpleCalcWebService.callService(addResult, 
    "add", first.value, second.value);
}
These Web service examples work properly in Internet Explorer 5.5 or later browsers. If you are using Internet Explorer 5.5+ and receiving errors with the examples, you need to enable the access data sources across domains option. See Column 105 for details.

To learn more on consuming multiple Web services, go to Column 106, Web services Part XI: Consuming Multiple Web Services.