1.没有终结点在侦听

WCF Host关掉后,Client访问服务的方法,
会抛出System.ServiceModel.EndpointNotFoundException,错误Message是没有终结点在侦听可以接受消息的

2.元数据包含无法解析的引用

WCF Host正常运转,也配置了serviceBehaviors和终结点endpoint,但在客户端添加服务引用失败,提示“元数据包含无法解析的引用”,
原因是终结点定义service节点的behaviorConfiguration属性没有配置,或者配置不正确。

错误示例:
<configuration>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="metadataBehavior">
                    <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:9999/calculatorservice/metadata" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="WcfServiceExample.CalculatorService">
                <endpoint address="http://127.0.0.1:9999/calculatorservice" binding="wsHttpBinding"
                    contract="WcfServiceExample.ICalculator" />
            </service>
        </services>
    </system.serviceModel>
</configuration>

相关文章:

  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-11-08
  • 2021-05-25
猜你喜欢
  • 2021-11-26
  • 2021-10-15
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
  • 2021-09-28
相关资源
相似解决方案