1

奇妙な動作を示す VB.NET でプログラムされた WCF サービスがあります。web.config には次の xml があります。

<system.serviceModel>
  <services>
    <service behaviorConfiguration="CentricBasicHttpBehavior" name="OnbaseService">
      <endpoint binding="basicHttpBinding" bindingConfiguration="CentRicBasicHttpServerBinding" contract="IOnbaseService">
        <identity>
          <servicePrincipalName value="HTTP/JFOLKENDT7E" />
        </identity>
      </endpoint>
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="CentricBasicHttpBehavior">
        <serviceAuthorization impersonateCallerForAllOperations="true" />
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
        <dataContractSerializer maxItemsInObjectGraph="2147483646" />
        <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" maxConcurrentInstances="100" />
      </behavior>
      <behavior name="">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  <bindings>
    <basicHttpBinding>
      <binding name="CentRicBasicHttpServerBinding" maxReceivedMessageSize="5000000">
        <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Windows" />
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>
</system.serviceModel>

wcf テスト クライアントでサービスを構成すると、Binding Mode と TransportClientCredentialType の両方が "None" になります。それぞれ「TransportCredentialOnly」と「Windows」になると予想していました。

WCF テスト クライアントがバインド構成を推測する方法と、この問題を修正する方法を教えてください。最終的な結果として、サービスのソース コード内で、WindowsIdentity は期待どおりにユーザーを偽装していません。

ありがとう、

ジェイソン

4

2 に答える 2

1

私はジェイソンと一緒に仕事をしていて、一緒にこれを見ました。サービス構成には、完全修飾サービス クラス名および完全修飾連絡先インターフェイス名と一致する名前および連絡先プロパティが必要でした。それ以外の場合は、デフォルト サービス用の楽しい新しい .Net 4.0 デフォルト バインディングを取得していました。

于 2011-07-29T15:39:40.103 に答える
0

WCF での私自身の経験では、構成ファイルでセッション タイムアウトと接続タイムアウトの設定を変更しましたが、WCF テスト クライアントはそれらの設定を尊重していませんでした。WCF テスト クライアントは、WCF サービスと通信するために既定値を使用しているようです。したがって、app.config とプロキシを生成して、独自のカスタム WCF テスト クライアントを使用して WCF サービスをテストします。cs から svcutil.exe 。

于 2011-07-29T14:43:45.733 に答える