从WindowsService调用WCF服务时出现问题。 [英] Problem while calling WCF Service from WindowsService.

查看:53
本文介绍了从WindowsService调用WCF服务时出现问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友.......



i在WCF服务上调用方法时遇到问题。

一段时间这种方法运行正常。

但是有一段时间它显示以下异常: -





无法在ServiceModel客户端配置部分找到引用合同UpdationWebService.IService1的默认端点元素。

这可能是因为没有找到您的应用程序的配置文件,或者因为没有端点元素匹配此合约可以在客户端元素中找到。






在此UpdationWebService中是Web服务名称(WCF)。



我不明白为什么它会抛出这个异常,........

有时它运行正常...

,有时会导致问题...



请帮帮我.......,这很紧急

Hi friends .......

i am getting a problem while calling a method on WCF service.
Some time this method is running properly.
but some time it shows following exception:-


Could not find default endpoint element that references contract ''UpdationWebService.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.



In this UpdationWebService is web service name (WCF).

I am not getting why it is throwing this exception,........
sometimes it is running properly...
, sometime it is causing Problem...

please help me ......., it''s urgent

推荐答案

嗨谢谢大家继承人有价值的回复..





每一个建议,要检查appconfig。很好。 我检查了,但它仍然显示同样的问题。 我通过提供绑定到httpBinding并将endPointAddress提供给我的ServiceRefrence来解决它



如下



BasicHttpBinding binding = new BasicHttpBinding();

EndpointAddress endPointAddress = new EndpointAddress(http: //LocalHos/Service1.svc);



ServiceClient sv = new ServiceClient(binding,endPointAddress);
Hi thanks to all for their valuable replies..


Every one suggestions, To check appconfig. was good. I checked, but still it was showing same problem. I solved it by providing Binding to httpBinding and endPointAddress to my ServiceRefrence

as follows

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress endPointAddress = new EndpointAddress("http://LocalHos/Service1.svc");

ServiceClient sv = new ServiceClient(binding ,endPointAddress );


这篇关于从WindowsService调用WCF服务时出现问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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