简体   繁体   中英

Route WCF ServiceHost to another computer

GoodDay,

I'm not a guru when it comes to WCF, but i do know the basics.

My question is, how do i create a ServiceHost on machine X, while the code is on machine Y?

if i build and run this code on my dev machine(localhost) :

servicehost = new ServiceHost(typeof(MyService1));
servicehost.AddServiceEndpoint(typeof(IMyService1), new NetTcpBinding(),"net.tcp://my.datacenter.com/MyApp/MyService1"); //This is normally set to localhost.

What implementation must be done on the datacenter server, so that if i had to point to http://my.datacenter.com/MyApp/MyService1 , it will route the service operation to my dev machine (localhost).

However, the datacenter should not be accessible via the internet.

It is a possible infrastructure that we researching to see if we can create a service bus type architecture so that all our customers can invoke other customer services running on their respective machines just by calling our datacenter url.

We have looked at Windows Azure, but we have our own datacenter infrasture that we wish to leverage off. Come think of it, we kind of building our own Azure, on a very very basic scale.

How does one go creating this?

Thanks in Advance

WCF in .NET 4 has a new feature called the routing service which does some of that - the clients will connect and send their messages to machine A, while that machine basically just re-routes the request to machine B.

Check out these resources (or find a lot more by googling or binging for "WCF 4 Routing service"):

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM