如何从Windows服务调用在iis中托管的wcfservcie [英] How to call wcfservcie which is hosetd in the iis from windows service

查看:157
本文介绍了如何从Windows服务调用在iis中托管的wcfservcie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows服务,它需要调用wcf服务,wcf服务是在IIS中托管的,如何调用wcf服务。



wcf服务在IIS中成功托管,我也可以从windowsform成功调用它,但是当我尝试使用相同的方式从窗口服务调用wcf服务时,它失败了。顺便说一下,WCF服务托管在远程计算机上。



返回错误是:找不到引用契约的默认端点元素; ServiceReference1.IService1''in ServiceModel客户端配置部分。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。



我检查事件查看器并且还发现了一个错误:



DCOM无法使用任何配置的协议与计算机EBMESF009通信。



我用错误的方法来调用wcf吗?或其他原因?

解决方案

http://blogs.msdn.com/b/tess/archive/2009/01/12/wcf-101 -creating-and-consume-a-basic-wcf-service-hosted-in-iis.aspx [ ^ ]

I have a windows service ,it need to call the wcf service ,the wcf service is hosted in IIS, how can call the wcf service.

The wcf service is hosted in IIS successfully and also i can call it from windowsform successfully, but when i try to call the wcf service from window service using the same way, it''s failed. By the way , the WCF service is hosted in remote computer.

The return error is : Could not find default endpoint element that references contract ;ServiceReference1.IService1'' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

I check the Event Viewer and also found an error:

DCOM was unable to communicate with the computer EBMESF009 using any of the configured protocols.

Do i use the wrong way to call wcf? Or other reason?

解决方案

http://blogs.msdn.com/b/tess/archive/2009/01/12/wcf-101-creating-and-consuming-a-basic-wcf-service-hosted-in-iis.aspx[^]


这篇关于如何从Windows服务调用在iis中托管的wcfservcie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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