0

IIS Developer Express で"WCF 4 Rest Service Template"プロジェクト (テンプレートから)をホストすると、次のようになります。

IIS は認証スキーム 'IntegratedWindowsAuthentication, Anonymous' を指定しましたが、バインディングは正確に 1 つの認証スキームの指定のみをサポートします。有効な認証方式は、Digest、Negotiate、NTLM、Basic、または Anonymous です。1 つの認証スキームのみが使用されるように IIS 設定を変更します。

JSON を返すために、 automaticFormatSelectionEnabledを false に設定する以外に、構成を明示的に変更していません。

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <standardEndpoints>
      <webHttpEndpoint>
            <!--Configure the WCF REST service base address via the global.asax.cs file and the default endpoint 
            via the attributes on the <standardEndpoint> element below-->
        <standardEndpoint name="" 
                          helpEnabled="true" 
                          automaticFormatSelectionEnabled="false"
                          />
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

エンドポイント構成が明示的に設定されていないことが問題である場合、iis 開発者エクスプレスでこの問題を回避するためにサービスの認証スキームを明示的に設定するには、この種のサービスに対してどのようにすればよいでしょうか?

注: 次のアセンブリMicrosoft.Web.dll & Microsoft.Web.Administration.dllが、アプリケーションの Web サービス プロジェクト/binフォルダーにあり、iss チーム ブログの WCF サービスをホッピングするための回避策で説明されています: http:// blogs.iis.net/vaidyg/archive/2010/07/21/wcf-workaround-for-webmatrix-beta.aspx

4

1 に答える 1

2

不要な認証スキームを無効にする必要があります.Windows認証だと思います。そう:

  1. メモ帳を起動
  2. メモ帳ファイルで開く: %userprofile%\Documents\IISExpress8\config\applicationhost.config
  3. <windowsAuthentication を検索します
  4. enabled 属性を true から false に変更します
  5. 保存

これにより、すべてのサイトの Windows 認証が無効になります。代わりに、特定のサイト (この場合は YourSite) の最後の </configuration> 行の直前に、ファイルの下部に場所のパスを追加することもできます。

<location path="YourSite" overrideMode="Allow">
    <system.webServer>
        <security>
            <windowsAuthentication enabled="false" />
        </security>
    </system.webServer>
</location>

これにより、特定のサイトでのみ無効になります。

于 2010-08-12T20:53:13.120 に答える