简体   繁体   English

Android / iOS客户端使用WCF双工服务

[英]Android/iOS client consumes WCF Duplex service

I am trying to build a server/web service which provides APIs to Android/iOS client. 我正在尝试构建一个服务器/ Web服务,该服务向Android / iOS客户端提供API。 I am using WCF service and clients can send request to server successfully. 我正在使用WCF服务,客户端可以将请求成功发送到服务器。 Now, I am going to make server enable to ping client to notify that there some changes in server and client need to synchronize data. 现在,我将使服务器能够对客户端进行ping操作,以通知服务器和客户端中有一些更改需要同步数据。

The question is: Is it possible to enable my server to ping client (Android/iOS), I knew that it is possible for Windows client by using wsDualHttpBinding but I am not sure about iOS and Android client. 问题是:是否可以使我的服务器对客户端(Android / iOS)进行ping操作,我知道可以使用wsDualHttpBinding对Windows客户端执行ping操作,但我不确定iOS和Android客户端。 Anyone can help me to make it clear? 有人可以帮我弄清楚吗? Any solution is appreciated. 任何解决方案表示赞赏。

I don't think you can do it. 我认为您无法做到。 For start, while wsDualHttpBinding is intended to be interoperable I don't beleive in practice it is supported by any otehr framework than WCF. 首先,尽管wsDualHttpBinding旨在实现互操作,但实际上我并不相信它会得到WCF之外的任何其他框架的支持。 Then wsDualHttpBinding uses a client callback url that the server needs to contact. 然后,wsDualHttpBinding使用服务器需要联系的客户端回调URL This url is not going to be accessible on a phone. 无法在手机上访问该URL。 You should use websockets, long polling or some proprietary push mechanism of the device os. 您应该使用网络套接字,长时间轮询或设备操作系统的某些专有推送机制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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