WCF“对 SSPI 的调用失败,请参阅内部异常”
我曾经安装并运行过一个自托管的 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>
你猜我做错了什么吗?
I had a self-hosted win service WCF installed and running at one point.
Naturally, I had to make some changes. So I changed the base address back to my local workstation and made the changes. It worked fine.
Now it's time to redistribute and... Well... It keeps hosing and I can't figure it out.
From the app.config file:
<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>
From the web.config file (long story):
<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>
Any guesses on what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
感谢 tomasr,这是一个配置错误的 SPN。
太糟糕了,这个网站上没有功能来关闭您自己的问题,我必须等待 2 天才能选择这个:-)
再次感谢!
Thanks tomasr, it was a misconfigured SPN.
Too bad there's no functionality on this site to close your own question, I'll have to wait 2 days to choose this one :-)
Thanks again!
当我未连接到域时,我从配置中删除了身份元素以进行本地测试。有用。
参考 -
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
i removed identity element from config for local testing when i was not connected to domain. It works.
reference -
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
将其添加到端点中的绑定配置中
参考:https://www.youtube.com/ watch?v=KYDBjoCYAC4&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1&index=53
add this to bindingConfiguration in the endpoint
ref: https://www.youtube.com/watch?v=KYDBjoCYAC4&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1&index=53
检查是否安装了框架,应使用框架4.5.x。可能会升级。恢复旧版本就可以了。
Check for framework installed, framework 4.5.x should be used. It might be upgraded. Restore old version and it will work.