开发者

Is it possible to have duplex communication between a WCF service and a .net 2.0 windows application? If so, how?

Pretty self-explanatory. I have a n开发者_运维技巧eed for a service to notify my client app if something happens, but the app is in .net 2.0 and I am loath to upgrade just for this functionality.

Is it possible to have duplex communication between a WCF service and a .net 2.0 app?


Ultimate, yes... because in the worst case WCF lets you write your own custom channels so you can pretty much do anything. But...

  • I am assuming you are asking if there is an easy/cheap way?
  • This all depends on what features of "WCF" you need to support e.g. SOAP, Metadata etc
  • Maybe you dont even need WCF?

One of the 'simplest' ways might be to use something like this custom duplex channel built on top of HTTP. Obviously .NET 2.0 supports HTTP so thats a common protocol.

WCF does have a legacy binding called basicHttpBinding which supports the old-style (WS 1.1) SOAP webservices from .NET 2.0 era. This is only a request-response so to make a duplex channel you would need to build a custom binding which builds on top of two simplex endpoints.


Strictly speaking no since WCF will not run with the .NET 2.0 framework but this is not the big issue it would seem. WCF was introduce with the .NET 3.0 framework. It came with the wsDualHttpBinding duplex functionality which will provide for client notification.

Your ASP.NET 2.0 app is completely compatible with the .NET 3.0 framework because the ASP.NET namespaces did not change very much in .NET 3.0 so you shouldn't worry about upgrading your app to take advantage of the WCF duplex binding. This ASP.NET forum post provides a more detailed explanation of the various .NET framework versions and ASP.NET. The upgrade will be much less painful than rolling your own duplex client.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜