我正在使用双工通信的WCF服务,并且在通过我的开发机器上的本地主机之外的任何地方工作都有问题。
无论我做什么,都会产生以下错误:
{“安全支持提供程序接口(SSPI)身份验证失败。服务器可能不在具有身份'host/crpnyciis20e‘的帐户中运行。如果服务器运行在服务帐户(例如网络服务)中,则将帐户的ServicePrincipalName指定为服务器的EndpointAddress中的标识。如果服务器运行在用户帐户中,则将帐户的UserPrincipalName指定为服务器EndpointAddress中的标识。”
我的服务Web.config如下:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<protocolMapping>
<add scheme="http" binding="wsDualHttpBinding"/>
</protocolMapping>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>我的客户的App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IMessagingService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IMessagingService"
contract="CTMessagingServiceReference.IMessagingService" name="WSDualHttpBinding_IMessagingService">
<identity>
<userPrincipalName value="nbdfp2k" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>我能做些什么来解决这个问题吗?如果有其他代码有助于诊断,请告诉我.据我所知,其余部分都与连接配置无关。
发布于 2012-05-10 19:30:25
不确定这是否会解决您的问题,但您正在丢失客户端点中的地址以及绑定配置中的client地址(它应该与您的端点地址不同)。
发布于 2014-01-04 04:36:21
不确定这是否是理想的方法,但您可以尝试从客户端配置中删除以下"identity“节点-
<identity>
<userPrincipalName value="nbdfp2k" />
</identity>https://stackoverflow.com/questions/6692910
复制相似问题