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

来源:互联网 发布:紫鸟数据魔方 编辑:程序博客网 时间:2024/04/27 19:06

在本项目中使用的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>

 

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

原创粉丝点击