【问题标题】:WCF 'A Call to SSPI Failed, see inner exception'WCF '对 SSPI 的调用失败,请参阅内部异常'
【发布时间】:2011-05-20 18:59:25
【问题描述】:

我曾经安装并运行了一个自托管的 win 服务 WCF。

当然,我不得不做出一些改变。所以我将基址改回我的本地工作站并进行了更改。效果很好。

现在是重新分配的时候了……嗯……它一直在流水,我想不通。

来自 app.config 文件:

<system.serviceModel>
<services>
  <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
    name="ExStreamWCF.Service1">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
      contract="ExStreamWCF.IService1">
      <identity>
        <dns value="Devexstream-2" />
        <!--<dns value="vmwin2k3sta-tn2" />-->
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
        <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ExStreamWCF.Service1Behavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

来自 web.config 文件(长话短说):

  <system.serviceModel>
    <services>
  <service behaviorConfiguration="ExStreamWCF.Service1Behavior"
    name="ExStreamWCF.Service1">
    <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
      contract="ExStreamWCF.IService1">
      <identity>
        <dns value="Devexstream-2" />
        <!--<dns value="vmwin2k3sta-tn2" />-->
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
      contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://Devexstream-2:8080/Service" />
        <!--<add baseAddress="net.tcp://vmwin2k3sta-tn2:8080/Service" />-->
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="ExStreamWCF.Service1Behavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

任何猜测我做错了什么?

【问题讨论】:

  • 内部异常是怎么说的?
  • 我真的不知道如何找出内部异常所说的内容!
  • 在服务 (msdn.microsoft.com/en-us/library/ms733025.aspx) 上启用 WCF 跟踪,它可能会为您提供所有必要的信息。如果您在域中,我认为这是导致 kerberos 失败的原因(例如缺少或配置错误的 SPN,或者使用与配置的 SPN 不匹配或域控制器不知道的主机名的基地址) .

标签: .net vb.net wcf config sspi


【解决方案1】:

感谢 tomasr,这是一个错误配置的 SPN。

太糟糕了,这个网站上没有关闭你自己的问题的功能,我得等 2 天才能选择这个:-)

再次感谢!

【讨论】:

  • 在我的情况下,它是由使用大写服务器地址的端点引起的,更改为小写立即解决了这个问题
【解决方案2】:

当我没有连接到域时,我从配置中删除了身份元素以进行本地测试。它有效。

参考 -

http://blogs.msdn.com/b/jpsanders/archive/2010/10/14/wcf-client-inner-exception-quot-the-security-support-provider-interface-sspi-negotiation-failed-quot.aspx

【讨论】:

    【解决方案3】:
    under the <system.serviceModel>
    <bindings>
        <netTcpBinding>
            <binding name="netTcp">
                <security mode="None">
            </binding>
        </netTcpBinding>
    </bindings>
    

    将此添加到端点中的 bindingConfiguration

    参考:https://www.youtube.com/watch?v=KYDBjoCYAC4&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1&index=53

    【讨论】:

    • 将此添加到端点中的 bindingConfiguration
    【解决方案4】:

    检查是否安装了框架,应使用框架 4.5.x。它可能会升级。恢复旧版本即可。

    【讨论】:

    • 我认为您的帖子看起来像是评论而不是答案。
    猜你喜欢
    • 2016-04-10
    • 2021-06-25
    • 2022-12-18
    • 2016-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-18
    • 2015-02-06
    相关资源
    最近更新 更多