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>

 

注意修改紅色字體就可以了。

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