home / experts / javascript / column113 |
|
Defining A Virtual DirectoryWe have showed you how to consume Web services from DHTML pages in Columns 97, 98, 99, 105, and 106. Consuming Web services from ASP.NET pages is not as straightforward as from DHTML pages, but it is not that complicated either. The first new concept you have to deal with is the proxy. ASP.NET pages cannot interact directly with Web services. You need to create a proxy for the Web service you want to consume in your ASP.NET code. A proxy is a special component that masquerades as the service. The proxy insulates you from the location of the actual service. The location is captured once, when the proxy is created, and from then on you don't have to worry about where the Web service is. Creating a proxy for a Web service converts the Web service to a local component. In general, when you want to call a local component from your code, you need to access the component's class definition including its namespace, as well as its binary realization in the form of a
Before showing you how to create proxies, there is a security issue you need to be aware of. Once you create a proxy, you are left with a
Also, it is not sufficient to change the setting of your directory alone. You need to make sure all its parent directories can be accessible by In both Windows XP and Windows 2000, make sure you can share this directory on the Web. Web sharing is turned on automatically when you define your Web server's Default Web Site. When you assign the Default Web Site's directory on your hard drive, the IIS Web server changes that directory's Web Sharing properties. Suppose your directory is
As you can see, the directory already "knows" its alias on the IIS Web server: |
Next: How to create a proxy
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: June 30, 2002
Revised: June 30, 2002
URL: http://www.webreference.com/js/column113/3.html