【问题标题】:Could not find endpoint element找不到端点元素
【发布时间】:2012-05-17 13:44:03
【问题描述】:

错误信息是:

找不到具有名称的端点元素 'NetbiterServiceReference.nbws' 和合同 ServiceModel 客户端中的“NetbiterServiceReference.nbws” 配置部分。

我的app.config 文件如下所示:

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="nbws.cfcSoapBinding">
                <security mode="Transport" />
            </binding>
            <binding name="nbws.cfcSoapBinding1" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://../nbws.cfc"
            binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
            contract="NetbiterServiceReference.nbws" name="nbws.cfc" />
    </client>
</system.serviceModel>

在我的代码中,我确实喜欢这样,并给出了上面的错误消息。

 nbwsClient proxy = new nbwsClient();

然后我做了所有这些组合,但结果相同:

nbwsClient proxy = new nbwsClient("NetbiterServiceReference.nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws.cfc", "https://../nbws.cfc");

任何想法都将不胜感激!

【问题讨论】:

    标签: wcf web-services service-reference


    【解决方案1】:

    错误消息是:在 ServiceModel 客户端配置部分中找不到名为“NetbiterServiceReference.nbws”和合同“NetbiterServiceReference.nbws”的端点元素。我的 app.config 文件如下所示:


    如果您按以下方式更改端点部分,您将丢失此错误。

    <endpoint address="https://../nbws.cfc" 
                binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding" 
                contract="NetbiterServiceReference.nbws" name="NetbiterServiceReference.nbws" /> 
    

    【讨论】:

    • 感谢您的输入,但它仍然不起作用。相同的错误信息。做了一个正常的 Web 服务参考,它可以工作。仍然希望服务参考能够正常工作。
    【解决方案2】:

    自己解决了。 问题是测试项目,使用代码和 app.config 运行项目在 app.config 中没有正确的信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-30
      • 2010-09-26
      • 2018-02-15
      • 1970-01-01
      • 2012-04-25
      • 1970-01-01
      • 2015-11-02
      • 1970-01-01
      相关资源
      最近更新 更多