Ajax経由でデータを返すために使用されるAsp.Netアプリケーション内でホストされているいくつかのWCFサービスがあります。IIS (6.0) では、Windows 認証がオンになっていて、匿名アクセスがオフになっています。web.config のサービス モデル セクションでさまざまな設定の組み合わせを試しましたが、適切な組み合わせが得られないようです。私が取得し続けるエラーは次のとおりです。
このサービスのセキュリティ設定には「匿名」認証が必要ですが、このサービスをホストする IIS アプリケーションでは有効になっていません。
これが私のweb.configです
<configuration> <system.web> <authentication mode="Windows"/> </system.web>
<location path="~/Services">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web> </location>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<bindings>
<webHttpBinding>
<binding name="default">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" proxyCredentialType="Windows"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="AspNetAjaxBehavior">
<enableWebScript />
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="defaultServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="WFS.SIG.Client.USM.Web.Services.Desks">
<endpoint address="" behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" contract="WFS.SIG.Client.USM.Web.Services.Desks"/>
</service>
</services>
</system.serviceModel>
</configuration>
この問題を明確にするための助けは素晴らしいでしょう。