2

WSHttpBindingHTTPSではなく、Windows認証とHTTPプロトコルを使用してWCFサービスをセットアップしようとしました。出来ますか?IIS 7 を使用しています。現在の構成ファイルは以下のとおりです。

この構成アプリケーションでは、例外がスローされます。

バインディング WSHttpBinding を持つエンドポイントのスキーム http に一致するベース アドレスが見つかりませんでした。登録されているベース アドレス スキームは [] です。

私のコードは次のとおりです。

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WsBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

    <services>
      <service behaviorConfiguration="WsBehavior" name="LoginService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WsBinding" contract="ILoginService">
          <identity>
            <dns value="http://localhost:50001/Ws/" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" minFreeMemoryPercentageToActivateService="1">
      <baseAddressPrefixFilters>
        <add prefix="http://localhost:50001/Ws/" />
      </baseAddressPrefixFilters>
    </serviceHostingEnvironment>

    <bindings>
      <wsHttpBinding>
        <binding name="WsBinding" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="Windows" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>
4

2 に答える 2

1

次のエラーが発生しました

ホストで構成された認証スキーム ('IntegratedWindowsAuthentication') は、バインディング 'WSHttpBinding' ('Anonymous') で構成されたものを許可しません。SecurityMode が Transport または TransportCredentialOnly に設定されていることを確認してください。さらに、この問題は、IIS 管理ツール、ServiceHost.Authentication.AuthenticationSchemes プロパティ、アプリケーション構成ファイル内のエレメント、バインディングの ClientCredentialType プロパティの更新、または調整によって、このアプリケーションの認証スキームを変更することによって解決される場合があります。 HttpTransportBindingElement の AuthenticationScheme プロパティ。

だから私の質問に答えてください。それは不可能だ。

于 2012-10-01T11:35:10.683 に答える
0

host/baseAddresses 構成ノードにベースアドレスを登録する必要があります。また、DNS ID はエンドポイント アドレスではなく、ホスト名である必要があります。

<services> 
  <service behaviorConfiguration="WsBehavior" name="LoginService">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:50001/Ws"/>
      </baseAddresses>
    </host> 
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WsBinding" contract="ILoginService"> 
      <identity> 
        <dns value="localhost" /> 
      </identity> 
    </endpoint> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
  </service> 
</services> 
于 2012-09-26T14:55:19.490 に答える