我在使用WCF测试客户端执行测试时遇到此错误:
该服务未对呼叫者进行身份验证。
我尝试将security mode
设置为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关于在问题中包含太多代码的规则.siaasd asjasjd kasjg kash jasdkus kasdashdsakdasd jasdj ldasdj asd lasd kk adjsad lasld ads kasd lald h3riew askk asdjasdj asdj asdj asd asdj asdj asdj adjsadjasd jasdj asdj adsj adsj ajdasjdasd jadj jsksk jdd asdasd哇哇仍然没有想到我必须在这里添加更多
答案 0 :(得分:0)
我不能使用basicHttpBinding,因为我知道它在.Net中 4.5
事实并非如此。
要解决此问题,请检查客户端和服务器上的日期是否已同步。只需在服务器和客户端计算机上设置相同的小时。