简体   繁体   English

添加包含多个正在运行的服务的托管wcf服务的服务引用

[英]Adding service reference of a hosted wcf service which is containing multiple running services

a service is having multiple services which are hosed and started successfully, when i am trying with WCFTESTCLIENT tool i am getting the error "unable to get the metadata of the service plese check the service is running and exposing metadata". 当我尝试使用WCFTESTCLIENT工具时,一个服务具有多个已成功启动的服务,但出现错误“无法获取服务的元数据,请检查该服务正在运行并公开元数据”。 what are the tools we can use to troubleshoot this kind of problems in WCF service. 我们可以使用哪些工具来解决WCF服务中的此类问题。 please help . 请帮忙 。

In my case the cause of the problem is in hosting process.unfortunately i commented the line servicehostObject.open() method in OnStart method. 就我而言,问题的原因在于托管进程。不幸的是,我在OnStart方法中注释了servicehostObject.open()方法行。 we can check the hosting process by using " netstat -a " command in VS command prompt. 我们可以在VS命令提示符下使用“ netstat -a ”命令检查托管过程。 i have checked with this command, and came to know that the address/port was not there.but other ports with tcp protocol was there and also in listening status. 我已经使用此命令进行了检查,并知道地址/端口不存在。但是其他带有tcp协议的端口也存在并且处于侦听状态。 so concluded that service not yet hosted. 因此得出结论,该服务尚未托管。 then i checked my windows Service hosting programs onStart method by using debugger.lauch() . 然后我通过使用debugger.lauch()检查了Windows Service托管程序的onStart方法。 and finally got the issue problem and fixed successfully. 终于解决了问题并成功解决了。 the problem is simple :D i commented the service open method. 问题很简单:D我评论了服务打开方法。 like below. 像下面 //servicehostObject .open(); // servicehostObject .open();

but this mistake gave the opportunity to learn about tracing. 但是此错误使您有机会了解跟踪。 yeah issues/problems only help us to learn more always. 是的问题/问题只会帮助我们不断学习。

while using wcftestclient try to give the exact address of the service. 在使用wcftestclient时,尝试提供服务的确切地址。 localhost/ip address make sure on this mainly. 本地主机/ IP地址主要确保这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM