Web Services, Part XI: Consuming Multiple Web Services - Doc JavaScript | WebReference

Web Services, Part XI: Consuming Multiple Web Services - Doc JavaScript

Web Services, Part XI: Consuming Multiple Web Services

In this column we continue our series on Web services. In Part I, we introduced you to this hot topic. In Part II, we showed you how to call Web services. In Part III, we presented the WebService behavior and its four supported methods. In Part IV, we continued our coverage of the WebService behavior by describing its objects and properties. In Part V, we dove into XML and XSLT. In Part VI, we started a miniseries on how to load and manipulate XML files from JavaScript. We continued this miniseries in Part VII, where we focused on the DOMDocument's nodes and node types. In Part VIII, we examined the world of document type definitions (DTDs). In Part IX we covered techniques for finding nodes on the DOMDocument tree. In Part X you exercised concepts and ideas from previous columns, by consuming the StockQuote Web service. In this column, we'll show you how to consume two other Web services: Add and IsPrime. We'll explain how to install them on different pages, as well as on a common page.

The first Web service adds two integers. Try it:

Enter First Number:
Enter Second Number:

The second Web service checks if a number is a prime number. Try it:

Enter a number:  

These Web service examples work properly in Internet Explorer 5.5 or later browsers. If you are using Internet Explorer 5.5+ and the examples are not working properly, you need to enable the "access data sources across domains" option. See Column 105 for details.

In this column you will learn:

You can download all of the files shown here (add.html, isprime.html, and webservice.htc) directly from this zipped file.

Next: How to write a multiple-service consumer


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: March 25, 2002
Revised: March 25, 2002

URL: http://www.webreference.com/js/column106/index.html