spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column106


Web Services, Part XI: Consuming Multiple Web Services

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Consuming the Add Web Service

Here again is the Add Web service in action:

Enter First Number:
Enter Second Number:

Here is complete listing of a page that consumes the Add Web service:

<HTML>
<HEAD>
<TITLE>Consuming the ADD Web Service</TITLE>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
function init() {
  myWebService.useService("http://63.210.240.215/d2s/
    20011205/add.asmx?WSDL",
    "simpleCalcWebService");
}

function addNumbers(a, b) {
  myWebService.simpleCalcWebService.callService(addResult,
    "add", first.value,
    second.value);
}

function addResult(result) {
  theResult1.innerHTML = result.value;
}
// -->
</SCRIPT>
</HEAD>
<BODY onload="init()">
<DIV ID="myWebService"
  STYLE="behavior:url(webservice.htc)"></DIV>
<TABLE BORDER="0">
  <TR><TD><INPUT SIZE="4" TYPE="text" ID="first"
    STYLE="text-align:'right'"></TD></TR>
  <TR><TD><INPUT SIZE="4" TYPE="text" ID="second"
    STYLE="text-align:'right'"></TD></TR>
  <TR><TD><HR></TD><TD><INPUT VALUE="Add" TYPE="button"
    onclick="addNumbers();"></TD></TR>
  <TR><TD><DIV ID="theResult1" STYLE="text-align:'right'">
    </DIV></TD></TR>
</TABLE>
</BODY>
  </BODY>
</HTML>

Next: How to consume the IsPrime Web service

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


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/4.html