spacer
Yehuda Shiran July 24, 2002
Creating Web Service Proxy Namespace
Tips: July 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

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 for Web services is 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. Let's demonstrate this step with the add Web service. 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:calcService /out:calcProxy.js 
  http://localhost/Column113/simpleCalc.asmx
The last entry on this line is the input to the wsdl command:

http://localhost/Column113/simpleCalc.asmx
which is the full path to the Web service definition. The other switches are:

  • /l: specified the language of the input file. Put js for JScript.
  • /namespace: specifies to which namespace you want to add your new simpleCalc class. The .NET framework will create a new namespace if it does not find one in its archive. The .NET framework stores the class definition somewhere on a system directory and you don't have to worry about it ever.
  • /out: specifies the name of the JScript file that will be created. This file is the proxy for the Web service. Put calcProxy.js, for example. This switch specifies where the proxy will be saved. If you don't specify a directory before the file name, the proxy will be saved in your current directory (d:\aspDemo in our case).

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

To learn more about JScript .NET and ASP.NET, go to Column 113, JScript .NET, Part VII: Consuming add from ASP.NET.


People who read this tip also read these tips:

Look for similar tips by subject:

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