如何WCF服务和主机应用程序之间的通信? [英] How to communicate between WCF service and host application?

查看:127
本文介绍了如何WCF服务和主机应用程序之间的通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过创建这样的一个WCF服务<一href="http://bloggingabout.net/blogs/dennis/archive/2010/06/16/wcf-simple-example-in-visual-studio-2010.aspx"相对=nofollow>教程。这这里的伟大工程,没有问题。 现在我托管在托管应用程序的服务。但在同一时间,我想用客户端的输入到主机应用程序的服务。

I created an WCF service through this tutorial. This works great, no problems here. Now I am hosting the service in an Managed Application. But at the same time I would like to used the input from the client to the service in the host application.

我不需要在客户端和服务之间的双向通信。我只需要在服务和主机通信之间的通信。

I don't need Duplex communication between the Client and the Service. I just need communication between the Service and the Host communication.

什么是对付它的最好方法?

What would be the best way to deal with this?

推荐答案

我设法利用这种信息的问题。在其被指出服务类也可以被传递到主机。然后,它很简单,只要添加事件监听器,响应来自服务的事件。

I managed to solve it using the information from this question. In which it was pointed out that service classes can also be passed to the host. Then it is as simple as adding an event listener which responds to events from the Service.

这篇关于如何WCF服务和主机应用程序之间的通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆