在本項目中使用的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>
注意修改紅色字體就可以了。