Working with .NET Remoting Under IIS Server and Using ASP.NET as Remote Client
page 3 of 7
by Abhishek Kumar Singh
Feedback
Average Rating: 
Views (Total / Last 10 Days): 8973/ 362

Configure and Setup remote server application and web.config in IIS Server

We need setup Server project assembly in IIS.

Step 1: Go to the primary web root directory C:\Inetpub\wwwroot and create a new folder named Server.

Step 2: Inside folder Server, create a new folder named bin. Now, move to your project Debug directory (IServer\Server\bin\Debug). Copy all files from here and place them into \wwwroot\Server\bin.

At this point the wwwroot\Server\bin directory may have the following files:

Figure 1: File structure in \server\bin folder in web root directory

Step 3: We need a web config to enable the assembly to work as remote objects. Create a file web.config in the \Server folder. Open web.config in notepad and add the following content in it.

Listing 3: Content of web.config for server in IIS

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.runtime.remoting>
    <application>
 
        <service>
            <wellknown mode="Singleton" type="Server.clsServer,Server"
                               objectUri="server.soap" />
        </service>
        <channels>
            <channel ref="http" />
            <serverProviders>
                <formatter href="binary" />
            </serverProviders>
        </channels>
    </application>
</system.runtime.remoting>
</configuration>

Save web.config file. At this point the wwwroot\Server\ directory may look like:

Figure 2: File structure in \server folder in web root directory

Step 4: We need setup Server folder as a virtual directory in IIS. Open the IIS window as: Control Panel >> Administrative Tools >> Internet Information Services.

Expand the node to reach to the folder Server: Local computer >> Web Sites >> Default Web Site >> Server.

Right click on COMAppASPClient and open the properties window.

Figure 3: Choosing properties option for the directory of ASP page

Click "Create" button in the application name tag. This makes the directory a virtual directory.

Figure 4: Creating the server folder to be a virtual directory

Click OK to finish with the IIS Server properties window. Here the remote object is installed. Let us test whether it is successfully installed. Open an internet explorer window and write the following in URL (use server name/ip instead of localhost if remote server is installed on other machine in LAN/WAN).

http://localhost/server/server.soap?wsdl

Opening this link would show information in XML format about implemented remote methods on the page as given below.

Figure 5: Get the description of remote object services in XML format

If you get the XML output on the page about the remote service then you could be sure that remote server object is installed in IIS correctly. Now we can proceed to create a web client which consumes these services.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 5 and 6 and type the answer here:

User Comments

Title: Working with .NET Remoting Under IIS Server .........   
Name: Srinandan
Date: 7/31/2008 5:01:26 AM
Comment:
Thanks Abhishek.
I did it but used the console application which i have to execute everytime.

using class library with web.config using IIS made it easy to deploy..

Really i appreciate your job.
Title: finally a step by step guide   
Name: Fabrizio
Date: 6/28/2008 9:21:32 AM
Comment:
Thanks a lot for your article, some days wandering and i found only generic help. This article step by step guided me to a working solutions. Just two tips:
- explain better what you write in the web.config
- explain better the ways in which an ASP.NET page can call you (through global.asax activation and so on)

Thanks again,
Fabrizio
Title: article   
Name: sam
Date: 5/9/2008 3:33:12 AM
Comment:
good
Title: this article   
Name: abhishek singh
Date: 5/8/2008 3:22:04 AM
Comment:
this is actually for advance programmers only. In normal situation we don't require to host remoting under IIS. It's for hight level busineess processing.
Title: Working with .NET Remoting Under IIS Server and Using ASP.NET as Remote Client   
Name: Santy
Date: 5/8/2008 2:55:39 AM
Comment:
Its pretty gud but I dont think the beginners can understand the terminology much... so be as simple as you can... its just a suggestion rest is left up to you, but the article is really gud... I appreciate your effort.
Title: Very easy to read!   
Name: henkgijsbert
Date: 3/14/2008 5:07:15 PM
Comment:
Well done. Easy to read with lots of screen shots. No need for me to do it myself in order to get good understanding. Saves time.
Title: for C# version   
Name: Abhishek Singh (Author)
Date: 2/28/2008 7:11:37 AM
Comment:
you can easily get C# version of code. Just try to use some convertor available free on internet. You need to put part of vb code and then you will get C# version of that code..
then use that code in your C# project.
Title: mr   
Name: reddy
Date: 2/28/2008 5:25:06 AM
Comment:
could u pls write it in c-sharp?
Title: 404 error   
Name: Abhishek Singh
Date: 2/1/2008 10:51:05 AM
Comment:
Please check if you have set virtual directory to use proper .net framework.
Title: malinimarudhu@gmail.com   
Name: Malini
Date: 1/31/2008 7:25:27 AM
Comment:
Hi..

Its a good Stuff!!!
but i get "The remote server returned an error: (404) Not Found. "
Cause?
Title: Working with .NET Remoting Under IIS Server and Using ASP.NET as Remote Client   
Name: Mena
Date: 1/31/2008 7:23:08 AM
Comment:
Hi..
when i try this, i get the error
"The remote server returned an error: (404) Not Found. "
why?

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 8/29/2008 5:15:11 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search