.NET Remoting: Using Interfaces

Using .NET Remoting and SoapSuds tools (SOAPSUDS.Exe) to extract metadata using Interface mechanism as an Alternative to SOAPSUDS. Explanation of concepts with examples of each.


In the previous article we used Soapsuds to extract the metadata from the Remoting Server so that we don't need to deploy the complete implementation assembly to your clients.

Another alternative way is to use Interfaces to access remote objects instead of using SoapSuds.There are many articles available on the internet which discusses the pro's and Con's of Interfaces Vs Soapsuds.

Create the Interface dll
Create a Class library called Inter.

using System;
public interface IService
int Addition (int num1,int num2)

Creating the Server Application
Create a Class library called ServerApp which Implements the IService Interface

using System;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels.Http;
using System.IO;

namespace ServerApp
public class Service: MarshalByRefObject,IService
public int Addition (int num1,int num2)
return num1 + num2;

Steps to deploy this Server in IIS.

1. Create a new folder and we will call it as "RemotingSample".
2. Create another new folder called "bin" inside RemotingSample folder.
3. Place the ServerApp.dll inside the "bin" folder.
4. Place the following Web.Config file inside the RemotingSample folder.

<wellknown mode="SingleCall" objectUri="AdditionService.rem" type="ServerApp.Service, ServerApp"/>
<channel ref="http"/>

5. Create a virtual directory in IIS.. say MyServer and map the path to the RemotingSample folder. You can test whether the Server is properly deployed by typing in


Client Application

The Distributed Inter.dll will be available to the Client.

1. Create a Windows Forms Application.
2. Add Reference to the Inter.dll in this application
3. Add a button and in the Button Click Event add the following Code :-

IService obj = (IService) Activator.GetObject(typeof(IService),"http://ServerName/MyServer/AdditionService.rem");

4. In the form load add the follwing Code..

HttpChannel channel = new HttpChannel();

This method will help you to use interface based remoting .
U Can Reach me @ 9840063939


Author: Ravi Ranjan13 Sep 2004 Member Level: Silver   Points : 0

It is really a nice article. it is really helpful for learner.
Thankx to this.

Author: Sreenivasa Rao01 Oct 2004 Member Level: Silver   Points : 0

I have changed server name as localhost. I am getting The page cannot be displayed error. Please let me know what i have missed.

Author: AGA31 Dec 2004 Member Level: Bronze   Points : 0

Dear Friend,

It is really a good article for the beginners.

Best Regards,


Author: Suresh Raj07 Sep 2009 Member Level: Silver   Points : 1

In Steps to deploy this Server in IIS-- Step 3
don't we need to add Interface dll i.e inter in the bin folder ???


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: