views:

408

answers:

3

I'm sure there has to be an easy way to do this, maybe I'm making more work for myself than I need to. I'm trying to set up cross system communications in a way that I can have bi-directional communication between objects, I imagine it would be something like this.

public interface ISharedResource

public class SharedResourceHost : ISharedResource  //<- slave process

SharedResourceHost resource = new SharedResourceHost("http://192.168.1.102/HostedResources/Process1");

resource.Invoke("SomeMethod");

is there anything like this? I don't wanna have to pull teeth setting up web services etc but if I have to I will.

+2  A: 

You're definitely re-inventing the wheel here. Look at the System.Runtime.Remoting namespace. I'd link in a tutorial, but I'd just have to check Google and you can evaluate what will make more sense for you better than I.

Joel Coehoorn
is remoting the EASY answer to this?
Firoso
Easier than doing it yourself.
Joel Coehoorn
*laughs* is WCF an easier solution? I hear it's better but in my 'experimentation' I've been mostly swearing at the configuration due to my complete lack of ITS background.
Firoso
thank you for the help.
Firoso
WCF essentially replaces System.Net.Remoting in .NET 3.0 (along with much other networking/web-related stuff and adding new functionality). If you're just doing simple remoting, WCF should be fairly straightforward (perhaps marginally harder), but it's the right way to go really.
Noldorin
It'd be nice if I just had an example of a cross system "ping/pong" service. where if application A sends a ping application B returns pong, and vice versa.
Firoso
+3  A: 

You should check WCF. It is far too big to explain here but this article should give you some pointers.

http://msdn.microsoft.com/pt-br/library/bb907581.aspx

WCF allows you to set up interfaces in which two objects can communicate using a protocol of your choice.

Leahn Novash
A: 

It looks like you'd want either Remoting or WCF. However in both instances you're going to need to make sure you have the correct ports open. I don't see how setting up Web Services would be difficult, but I can only go off of your post.

Alexander Kahoun