[英]WCF : I Keep getting the error “The caller was not authenticated by the service.”
使用WCF Test Client执行测试时,我一直收到此错误:
呼叫者未通过服务认证。
我试图将security mode
none
设置为none
,但是错误仍然存在
我不能使用basicHttpBinding
因为据我所知它在.Net 4.5中
我已经花了几个小时解决这个问题,但是即使我也遇到过一些关于SOF的类似话题,也还是没有运气,但是它们没有帮助!
Web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="ota2010AEndpoint" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32"/>
<reliableSession ordered="true"/>
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="CalculatorServiceBehavior" name="GWork_Service.Service1">
<endpoint address="" binding="wsHttpBinding" contract="GWork_Service.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://xxx:8000/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
客户端的应用程序配置:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService1">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://xxx:8000/" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IService1" contract="GWork_MER.ServiceReference1.IService1"
name="WSHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
抱歉,我必须在此处添加更多字母,以便我可以通过SOF关于在问题中包含过多代码的规则。我还没有在这里添加更多
我不能使用basicHttpBinding,因为据我所知它在.Net 4.5中
这不是真的。
要解决此问题,请检查您的客户端和服务器上的日期是否同步。 只需在服务器和客户端计算机上设置相同的时间即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.