spacer
Yehuda Shiran August 7, 2002
Deploying and Testing IsPrime's Consumer
Tips: August 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source
Once you write the Web service consumer (.aspx file), save it in the same directory of the Web service (.asmx file). Suppose you name the consumer of IsPrime as isPrimeConsumer.aspx. Save it in the same directory of the Web service file, checkIsPrime.asmx. In our case, the directory is d:\aspDemo. Recall that in a previous tip we created a virtual directory in the Web server, Column113, pointing to d:\aspDemo. Load your browser with the following path:

  http://localhost/Column113/isPrimeConsumer.aspx
You should get the following window:

To summarize the IsPrime Web service development discussions, here is the full code listing of isPrimeConsumer.aspx:

  <%@ Page LANGUAGE="JScript" %>
  <%@ import namespace="primeProxy" %>
  <HTML>
  <SCRIPT LANGUAGE="JScript" RUNAT="server">

  public function Submit_Click(sender:Object, E:EventArgs) : void {
    var result : String;
    var webService : PrimeNumbers;
    webService = new PrimeNumbers();
  
    result = webService.IsPrime(int.Parse(first.Text));
    resultControl.Text = (result == 0 ? " is not a prime number": "   
	  is a prime number") ;
  }

  </SCRIPT>
  <HEAD>
    <TITLE>IsPrime XML Web Service Test</TITLE>
  </HEAD>
  <BODY STYLE="font-size:12; font-family:arial,verdana,sans-serif;">
    <FORM RUNAT="server">
      <TABLE BORDER="0">
        <TR>
          <TD ALIGN="middle"><ASP:TEXTBOX ID="first" 
		    RUNAT="server" SIZE="4" STYLE="text-align:'right'"/></TD>
          <TD ALIGN="middle"><ASP:LABEL ID="resultControl" 
		    RUNAT="server"/></TD>
        </TR>
        <TR>
          <TD><ASP:BUTTON TEXT="Is Prime?" ID="isprime" 
		    OnClick="Submit_Click" RUNAT="server"/></TD>
        </TR>
      </TABLE>
    </FORM>
  </BODY>
  </HTML>
To learn more about JScript .NET and ASP.NET, go to Column 114, JScript .NET, Part VIII: Consuming IsPrime from ASP.NET.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script · Book Review: Content Rich
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags