【问题标题】:Could not find default endpoint element that references contract找不到引用合同的默认端点元素
【发布时间】:2010-11-28 02:56:52
【问题描述】:

我的是windows应用程序。我正在使用网络服务。当我向我的应用程序添加服务引用时,它会生成一个 app.config 文件。

<client>
    <endpoint address="http://58.71.131.223/uucpapi/UUCPAPIServer.svc"
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUUCPAPIServer"
        contract="UUCPAPI.IUUCPAPIServer" name="WSHttpBinding_IUUCPAPIServer">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint>
</client>

我将这个 API 称为

UUCPAPI.UUCPAPIServerClient uucp = new UUCPAPI.UUCPAPIServerClient();

这里是抛出异常

找不到引用合约的默认端点元素 ServiceModel 客户端配置部分中的“UUCPAPI.IUUCPAPIServer”。这可能是因为找不到您的应用程序的配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。”

【问题讨论】:

  • 你能发布服务器和客户端的配置吗?
  • 您好,这些是客户端设置“"

标签: c# .net wcf wcf-configuration


【解决方案1】:
<client>
    <endpoint address="http://...../uucpapi/UUCPAPIServer.svc" 
              binding="wsHttpBinding" 
              binding configuration="WSHttpBinding_IUUCPAPIServer" 
              contract="UUCPAPI.IUUCPAPIServer" 
              name="WSHttpBinding_IUUCPAPIServer">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint> 
</client>

【讨论】:

    猜你喜欢
    • 2014-09-14
    • 2011-10-20
    • 2013-05-13
    • 2013-01-23
    相关资源
    最近更新 更多