gpt4 book ai didi

WCF测试客户端未加载服务

转载 作者:行者123 更新时间:2023-12-04 09:27:56 25 4
gpt4 key购买 nike

最近,我开发了wcf服务。
到昨天为止工作很好。我能够测试它
在内置的WCF测试客户端中使用VS2010。
从昨天开始,我无法在WCF测试客户端中看到我的服务。
当我按F5键时,它将打开Wcf测试客户端窗口,并在底部
它显示Servie添加成功。但是它不会加载任何服务。
我试图从文件/添加服务中手动添加它,但仍未加载。
可能是什么问题呢。
非常感谢您的帮助。
这是我的Web.config。

<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<bindings/>
<client/>
<services>
<service behaviorConfiguration="myproj.ServiceBehavior" name="myproj.Service">
<endpoint address="" binding="webHttpBinding" contract="myproj.IService" behaviorConfiguration="REST">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="REST">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="myproj.ServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

最佳答案

您正在将webHttpBinding用于REST风格的WCF服务。

WCF测试客户端是一个 SOAP 测试应用程序-它可与SOAP Web服务(在WCF中基本上是webHttpBinding)一起工作。

对于REST服务,只需浏览到服务URL并以这种方式调用您的REST服务。

关于WCF测试客户端未加载服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7208222/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com