wcf访问出现的安全问题:the caller was not authenticated by the service.

在本项目中使用的wcf技术,调用发布服务的服务时出现“the caller was not authenticated by the service.错误”,经过在网上搜索,终于找到了解决方法,现记录如下:

修改配置文件中的节点信息:

 

   <service behaviorConfiguration="NewMedia.Portal.Service.Service1Behavior"
    name="CRI.NewMedia.Portal.Service.Service1">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConfiguration" contract="CRI.NewMedia.Portal.Service.IService1">
     <identity>
      <dns value="localhost" />
     </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
   </service>

 

 

<bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingConfiguration">
          <security mode="None" />
        </binding>
      </wsHttpBinding>
    </bindings>

 

 

  <behavior name="NewMedia.Portal.Service.Service1Behavior">
     <serviceMetadata httpGetEnabled="true" />
     <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>

 

注意修改红色字体就可以了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章