< C#/ASP .NET Asynchronous Web Service Program Example | Main | ASP Debug & C# Asynchronous Class Library Project >

 


 

 

Chapter 11 Part 7:

XML Web Services and the Network

 

 

What do we have in this chapter 11 Part 7?

  1. Configuring IIS for Web Service Hosting

 

Configuring IIS for Web Service Hosting

 

Next, let do some tweaking on the IIS side so that we can access the web service directly through the normal access using browser. Launch the Internet Information Services.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: invoking the Internet Information Services snap-in for IIS web server management

 

We can see the project folder in the IIS snap-in however we need to create a virtual directory to map it to the physical path.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: The IIS web server snap-in

 

Create a new virtual directory.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: creating a virtual directory for the IIS web server

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the IIS virtual directory creation wizard welcome page

 

You can use the following alias if you want. Click the Next button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: assigning the alias name to the IIS virtual directory

 

Click the Browse button to browse the project physical path.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: browsing the local physical path to the web site files

 

Make sure you select the first level project folder which host all the files and folders. Click the OK button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: selecting the physical folder for the IIS virtual directory

 

The correct physical path is shown in the following Figure.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the physical path for the IIS virtual directory

 

Just click the Next button for the access permission. We need to select the third check box if we need to run executable such as the DLL. Previously, the DLL was loaded and run using the ISAPI or CGI however in this case we can use the Web.config file to achieve the same purpose.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: setting the access permission for the IIS virtual directory

 

Click the Finish button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: finishing the IIS virtual directory creation

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the just created IIS virtual directory seen in the IIS snap-in

 

Now we can see the virtual directory that map to the real physical path. Next, open the Properties page for our Default Web Site. We need to tweak some more settings.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: invoking the Default Web Site property page of the IIS web server

 

Click the Home Directory property page. We need to point to the real physical local path. Click the browse button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: setting the physical path for the IIS home directory

 

Select the first level project path as done in the virtual directory setup.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: selecting the physical folder for the IIS home directory

 

Now you can see the Local Path of the content. Then, click the Documents property page.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the local physical path of the IIS home directory

 

We need to enable the default document, because the web service file name to be run has different file name and extension in this case. Click the Add button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: setting the default document for IIS web site

 

Type the file name of the web service application. In this case it is Service1.asmx. Click the OK button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: entering the default first page web document file

 

Then move the document to the top position.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: setting the default first page IIS web site

 

Meanwhile, if the ASP .NET was configured properly, you can see the ASP .NET property page in the ASP .NET property page as shown below.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the ASP .NET page seen in the Default Web Site Properties page

 

Click the OK button to close and save all the new settings. Select the object that will be inherited by the previous settings. In this case Printers is not relevant, just click the OK button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the Default Web Site inheritance overrides page for related IIS services

 

Next, restart IIS.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: restarting the IIS web server services through the IIS snap-in

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the Stop/Start/Restart IIS web services page

 

Then, let test the IIS web server (locally and physically).

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: browsing or testing the IIS web site locally and physically

 

You can see the web service test page displayed on the right window as if you are accessing it through a normal browser.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the web service test page seen in the browser

 

Please remember that the permission used in this local web access is Integrated Windows Authentication which can be seen through the Directory Security property page. Non-local and non-physical access should use the Anonymous access for normal web access. From the Directory Security web site property page, click the Edit button.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the Default Web Site IIS directory security page

 

The you can select several authentication schemes used for the web site. As mentioned before, non-local and non-physical access should use the Anonymous access.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the Default Web Site authentication methods page of the IIS web server

 

You may want to test the web service at this stage.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: testing the web service application exposed methods

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: the web service returned result in the XML page

 

Next, let access the web service using browser as a normal web user. Launch your browser, use http://localhost/ or http://127.0.0.1 as the URL. Well, all looks fine now.

 

The C# Asynchronous Web Service Access with ASP .NET WEB Service application development Program Example: opening the web service application directly in the Internet browser from the IIS web server locally

 

You may want to test float values for the Sum method. Exception will be thrown and displayed in the browser. You can set the debugging info for ASP through the Home Directory property page > Configuration button > Debugging page. This is very useful method in debugging the ASP web application.

 

 

 


< C#/ASP .NET Asynchronous Web Service Program Example | Main | ASP Debug & C# Asynchronous Class Library Project >