今天重新运行上一个任务的WCF服务,部署到本地调用发现报如下错误:

{"The caller was not authenticated by the service."}

The request for security token could not be satisfied because authentication failed,

问了一哥们才发现原来也碰到过这个问题,居然再次跌倒在这,所以匆忙记录一下

<system.serviceModel>

     <services>
      <service name="*.SearchingService" behaviorConfiguration="*.SearchingServiceBehavior">
        <!-- Service Endpoints -->
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConfiguration" contract="*.ISearchingService">
        </endpoint>
        
      </service>
    </services>  
    
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingConfiguration">
          <security mode="None" />
        </binding>

      </wsHttpBinding>
    </bindings>


    <behaviors>
      <serviceBehaviors>
        <behavior name="*.SearchingServiceBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

    

  </system.serviceModel>

 主要注意红色字体的配置语句,有时间得好好查查如此设置的目的所在................

posted on 2008-12-10 19:12  Bob&xiaobo.liu  阅读(1098)  评论(0编辑  收藏  举报