473,387 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Remoting - Can not call methods after creating remoted objects

Remoting Error

can not access property or method of proxy object on internet, works fine for LAN

Hello, here is my some remoting code

Code Snippet Remoted Class:

namespace Server

{
[Serializable()]
public class clsUser_Ent: MarshalByRefObject
{
public string _ID = "ID";

public clsUser_Ent()
{
}
public string ID()
{
return _ID ;
}
}
}


Host:

namespace Host
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
try
{
IDictionary properties = new Hashtable();

BinaryServerFormatterSinkProvider serverSinkProvider = new BinaryServerFormatterSinkProvider();

serverSinkProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilter Level.Full;

properties["name"] = "";

properties["port"] = 8070;

properties["typeFilterLevel"] = "Full";

TcpServerChannel tcpChannel = new TcpServerChannel(properties, serverSinkProvider);

ChannelServices.RegisterChannel(tcpChannel, false);

RemotingConfiguration.RegisterActivatedServiceType (typeof(clsUser_Ent));

}

catch (Exception exp)

{

MessageBox.Show(exp.Message.ToString());

this.lstOutput.Items.Add("Unabled to load objects.");
}
}
}
}



Client:

namespace Client
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
try
{
IDictionary properties = new Hashtable();

BinaryClientFormatterSinkProvider clientSinkProvider = new BinaryClientFormatterSinkProvider();

properties["name"] = "";

properties["port"] = 8070;

properties["typeFilterLevel"] = "Full";


TcpClientChannel tcpChannel = new TcpClientChannel(properties, clientSinkProvider);

ChannelServices.RegisterChannel(tcpChannel, false);

RemotingConfiguration.RegisterActivatedClientType( typeof(clsUser_Ent), "tcp://220.156.185.252:8070");

RemotingConfiguration.RegisterActivatedClientType( typeof(MyServerClass), "tcp://220.156.185.252:8070");

}

catch (Exception exp)

{

MessageBox.Show(exp.Message.ToString());

this.lstOutput.Items.Add("Unabled to load objects.");

}

}

private void button3_Click(object sender, EventArgs e)
{
try
{
clsUser_Ent a = new clsUser_Ent();
MessageBox.Show("Obect created, press ok to print it's ID");
MessageBox.Show(a._ID);
}

catch (Exception exp)
{
MessageBox.Show("Error: " + exp.Message.ToString());
}
}
}
}


Error:

when I press Button3 , it will create the remote object, but whenever I access it's method or property it raise error, "No connection could be made because the target machine actively refused it"

I checked it within LAN, it works fine but can't on internet
I already disable the firewall on both computer also.

waiting for good reply......

Regards
Vishal Simon
Sep 17 '07 #1
0 1032

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fadi | last post by:
Backround: I am trying to figure out how to do the equivalant of a classic COM Local Server Singleton in .NET/C#. I created a coupld of simple Class Libs that exposes public interfaces and hosted...
11
by: perspolis | last post by:
Hi I want to send some info from my C# windows application to a website that hosetd in Linux. Can I use Remoting to transfer information between them? thanks in advance
6
by: AMDRIT | last post by:
Hello folks, I appologize for the cross post, but I really need an answer on this: I do not think that I am seeing the whole picture here. I would like to create a windows service and a...
0
by: Milan | last post by:
I've got a slight problem with an application I'm creating: I am passing a client side Stream into server side method call (remoted method call). The server side method call creates a...
5
by: mitch | last post by:
Hello, Basically, I want my application to run only one instance at a time and pass command line arguments to a running instance. I have all of this working, I used the IPC Remoting channel and...
3
by: Michael Maes | last post by:
Hi, We have a windows service passing objects to a client application by remoting. The windows service is started and running successfully. * When the client app is running on the same...
4
by: Rich | last post by:
Can anyone suggest a good (current) tutorial on how to do basic remoting with C# (2005 express edition)?
13
by: José Joye | last post by:
Hello, What is the best way to stop a remoting server (Singleton SAO) that has been started with RemotingConfiguration.Configure(). For sure, I want to do this without quitting the application...
0
by: VishalSimon | last post by:
Plese help, I can not call the method after creating the remoted object in C#.Net I do not know what is wrong with my code ? This is the code: Remotable Class:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.