0

I have a situation where I want to establish communication between WCF service and Windows service.

  1. I want to pass messages from the Windows service to the WCF service
  2. I want to send array list from the Windows service to the WCF service

How can I achieve this?

Edit:WCF is hosted on IIS. if any code snippets it would very helpfull. Thanks in advance loke

4

2 回答 2

1

是的,您可以,只需在您的 Windows 服务中添加对您的 wcf 服务的引用。

于 2012-05-21T09:20:13.940 回答
0

在 Visual Studio 中,右键单击您的项目并选择添加服务引用。输入您的 WCF 服务地址并选择命名空间名称。Visual Studio 将从您的 Web 服务下载 WSDL 并为您创建代理。

然后只需创建代理对象并调用 Web 服务方法:

YourNamespace.YourServiceClient client = new YourNamespace.YourServiceClient();
client.Open();
client.YourOperation();
client.Close();
于 2012-05-21T12:50:16.337 回答