spacer

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

home / experts / javascript / column114


JScript .NET, Part VIII: Consuming IsPrime from ASP.NET

Vice President of Risk Technology - READY TO HIRE! (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs


Creating a Proxy

Let's create a proxy for the IsPrime Web service from Column 112. We put all files in d:\aspDemo, including the Web service definition, checkIsPrime.asmx. Now you need to open the IIS control window. In Windows XP, click start -> Control Panel -> Performance and Maintenance -> Administrative Tools -> Internet Information Services. Expand the menu by clicking the + button, until you get the Default Web Sites entry:

Let's create a virtual directory now under Default Web Sites. Right-click the Default Web Sites entry, and pick New Virtual Directory. A wizard will guide you through two entries and a set of options. The first entry is the alias of this Web site. Since our filenames will all be different from Column 113's, we'll continue to use the Column113 alias that we created in our previous tutorial. Then it will ask you for the path of the directory where the content is. Browse to your directory and press Next. We chose d:\aspDemo. Leave the last page as is and click Finish. You will now see all your files from d:\aspDemo reflected in the right window of the IIS control panel. You can check now that indeed you can see the IsPrime Web service via http://localhost/Column113/checkIsPrime.asmx (assuming you put checkIsPrime.asmx in d:\aspDemo).

Now you can start creating the proxy to the IsPrime Web service. It's a two-step process. The first step creates the proxy code in JScript .NET and adds your class to the specified namespace. The executable that does this is wsdl.exe. Your .NET Framework should support this executable by including its directory in your path. Open a Command Prompt window and cd (change directory) to d:\aspDemo. Type wsdl and verify you get the help for this executable. Type the full command now (in one line):

wsdl /l:js /namespace:primeProxy /out:sampleProxy.js 
  http://localhost/Column113/checkIsPrime.asmx

The last entry on this line is the input to the wsdl command:

http://localhost/Column113/checkIsPrime.asmx

which is the full path to the Web service definition. The other switches are:

The following Command Prompt window shows the content of checkIsPrime.asmx and the echo of the wsdl command:


Next: How to create a .dll file

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: July 15, 2002
Revised: July 15, 2002

URL: http://www.webreference.com/js/column114/2.html