Is is possible to 'relay' a WCF service fr

2019-06-07 13:18发布

问题:

I've got a WCF service on a server on one side of a firewall. I need to access the service from many workstations on the other side of the firewall. The network guys insist that all holes through the firewall are one-to-one so at the mo, I'll have to set up every workstation one by one. There could be loads and it'll get tedious and be prone to errors.

Is it possible to set up a WCF server on this side of the firewall that can in some clever way just act as a proxy to the 'real' WCF service on the other side of the firewall? If so, could you point me to some reference material?

回答1:

I have a few suggestions, maybe one would work in your case:

  • Place the WCF service outside the firewall. If the WCF service needs to talk to the database, open the database port for the IP address of the machine running the WCF service.
  • Program or use code generation to create a WCF service that is simply a pass through layer
  • There may be some functionality in your firewall that allows you to publish an end point


回答2:

There is a new concept of a WCF Relay service being developed for the Windows Azure "cloud" computing space. That would allow you to create your scenario fairly easily - just host some bits of your service out in the cloud.

See these links for more information:

  • WCF services hosted on Windows Azure
  • Software in the cloud: the Relay service
  • .NET ServiceBus: Hands-On with Relays

or search Google for "WCF Relay Service". There are also a number of new bindings specifically for these WCF scenarios.

Hope this helps.

Marc

UPDATE:
WCF v4 - to be released with .NET 4.0 later this year (2009) will include a RoutingService class which can be used in scenarios like this.

See more info about the WCF4 routing service here:

  • Content based routing in WCF 4
  • Routing messages in WCF 4.0
  • A developer's introduction to WCF .NET 4 Beta 1


标签: wcf proxy