WCF服务和.net 2.0窗口应用程序之间是否可以进行双向通信?(Is it possible to have duplex communication between a WCF service

编程入门 行业动态 更新时间:2024-10-09 20:24:22
WCF服务和.net 2.0窗口应用程序之间是否可以进行双向通信?(Is it possible to have duplex communication between a WCF service and a .net 2.0 windows application? If so, how?)

相当不言自明。 我需要一个服务来通知我的客户端应用程序,如果发生了什么,但该应用程序是在.net 2.0中,我不愿升级这个功能。

是否有可能在WCF服务和.net 2.0应用程序之间进行双工通信?

Pretty self-explanatory. I have a need 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?

最满意答案

最终,是的...因为在最坏的情况下,WCF可以让你编写自己的自定义频道,这样你几乎可以做任何事情。 但...

我假设你问是否有简单/便宜的方法? 这一切都取决于您需要支持的“WCF”的功能,例如SOAP,元数据等 也许你甚至不需要WCF?

“最简单的”方法之一可能是使用像HTTP这样的自定义双工通道 。 很明显,.NET 2.0支持HTTP,所以这是一个通用协议。

WCF确实有一个名为basicHttpBinding的旧式绑定,它支持.NET 2.0时代的旧式(WS 1.1)SOAP Web服务。 这只是一个请求 - 响应,所以为了建立一个双工通道,你需要建立一个建立在两个单工端点上的自定义绑定。

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.

更多推荐

本文发布于:2023-08-06 16:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1453619.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:双向   应用程序   窗口   通信   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!