WCF 和多个客户端
我有一个托管在 IIS 中的 WCF,同时我有两个客户端,一个 WPF 应用程序和一个 Window Phone 应用程序。我的程序的工作方式是,Window Phone 应用程序将向 WCF 发送消息,然后 WCF 将其发送到 WPF 应用程序。我怎样才能实现它?
我查看了回调,但我相信它的作用是在电话应用程序使用 WCF 服务后将消息返回到 Window Phone 应用程序。但我希望我的程序做的是将消息从电话应用程序发送到 WPF 应用程序。
请指导我。谢谢你!
I have a WCF hosted in IIS, at the same time I have two clients, a WPF application and a Window Phone Application. My program work in the way that, the Window Phone Application will send a Message to the WCF and then the WCF will send it to the WPF application. How can I achieve it?
I have take a look at callback, but I believe what it does is to return a message back to the Window Phone Application after the Phone Application consume the WCF service. But what I want my program to do is to send the Msg from the Phone App to the WPF application instead.
please guide me. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能会这样做:
在 WPF 应用程序内部,托管第二个 WCF 服务来接收该消息 - 您的 WPF 应用程序将成为 WCF 服务器
当消息从 Windows Phone 进入 IIS 中的 WCF 服务时,该服务类将成为 WPF 应用程序的 WCF 客户端,并将该消息向前发送到其他 WCF 服务
回调将不起作用 - 因为回调只能回拨原始呼叫者(此处为您的 Windows Phone),而这不是您想要的。
I would probably do it this way:
inside the WPF application, host a second WCF service to receive that message - your WPF application becomes a WCF server
when a message comes in from the Windows Phone into your WCF service in IIS, that service class then becomes a WCF client to the WPF app and send that message onwards to the other WCF service
Callback won't work - since callback can only call back to the original caller (your Windows Phone, here) and that's not what you want.