0

多数の WCF サービスを呼び出す Silverlight アプリがあります。Silver Light クライアントの一般的なバインディングは次のようになります。

<basicHttpBinding>
    <binding name="ClientBindingName" maxBufferSize="2147483647"
        maxReceivedMessageSize="2147483647">
        <security mode="TransportCredentialOnly" />
    </binding>
</basicHttpBinding>

そして、それは次のようなサーバーバインディングとペアになっています:

<basicHttpBinding>
    <binding name="ServerbindingName" sendTimeout="00:02:00">
        <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows"/>
        </security>                    
    </binding>
</basicHttpBinding>

サービスの 1 つでカスタム バインディングが必要ですが、403 エラーにならないバインディングの組み合わせが見つかりません。

クライアントのために私が思いつくことができる最高のものは次のとおりです。

<customBinding>
    <binding name="CustomBinding_IZipService_StreamedResponse" closeTimeout="00:10:00"
             openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
        <binaryMessageEncoding />
        <httpTransport maxReceivedMessageSize="2147483647"
                       maxBufferSize="2147483647"
                       transferMode="StreamedResponse" />
    </binding>
</customBinding>

そしてサービスのために:

<customBinding>
    <binding name="FS.SUV.Services.ZipService.customBinding"
             receiveTimeout="00:10:00" sendTimeout="00:10:00">
      <binaryMessageEncoding>
        <readerQuotas maxStringContentLength="524288000"/>
      </binaryMessageEncoding>
      <httpTransport transferMode="StreamedResponse"
                     maxBufferSize="524288000"
                     maxBufferPoolSize="524288000"
                     maxReceivedMessageSize="524288000" />
      <security authenticationMode="SecureConversation" requireSecurityContextCancellation="true">
        <secureConversationBootstrap authenticationMode="UserNameOverTransport" />
      </security>
    </binding>
  </customBinding>

カスタム バインディングを Silverlight over Windows 認証でうまく機能させるにはどうすればよいですか?

4

2 に答える 2

2

複雑になりすぎていたことがわかりました。クライアント バインディングは良好だったので、次のようにしました。

<binding name="CustomBinding_IZipService_StreamedResponse" closeTimeout="00:10:00"
         openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
    <binaryMessageEncoding />
    <httpTransport maxReceivedMessageSize="2147483647"
                   maxBufferSize="2147483647"
                   transferMode="StreamedResponse" />
</binding>

サーバーバインディングは次のように設定する必要がありました。

<customBinding>
    <binding name="ClientBindingName"
             receiveTimeout="00:10:00" sendTimeout="00:10:00">
        <binaryMessageEncoding>
            <readerQuotas maxStringContentLength="524288000"/>
        </binaryMessageEncoding>
        <httpTransport transferMode="StreamedResponse"
                       maxBufferSize="524288000"
                       maxBufferPoolSize="524288000"
                       maxReceivedMessageSize="524288000"
                       authenticationScheme="Negotiate" />
    </binding>
</customBinding>

この世代のツールを使用して、バインドを正しく行うことができました: http://webservices20.cloudapp.net/default.aspx

于 2011-03-25T10:43:27.360 に答える
1

構成が正しくありません。両側でこれを試してください(必要に応じてリーダーの割り当てとメッセージサイズの制限を変更してください):

<customBinding>
    <binding name="CustomBinding_IZipService_StreamedResponse" closeTimeout="00:10:00"
             openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
        <binaryMessageEncoding />
        <httpTransport authenticationMode="Negotiate"
                       maxReceivedMessageSize="2147483647"
                       maxBufferSize="2147483647"
                       transferMode="StreamedResponse" />
    </binding>
</customBinding>
于 2011-03-25T10:41:45.120 に答える