0

TCPバインディングとWindows認証を備えた次のサーバー構成ファイルがあります。

<customBinding>
        <binding name="NewBindingTcpSecure">
          <security authenticationMode="SecureConversation">
            <secureConversationBootstrap authenticationMode="SspiNegotiated"   />
          </security>

          <binaryMessageEncoding maxSessionSize="1000000">
            <readerQuotas maxDepth="64" maxStringContentLength="131072" maxArrayLength="16384"
              maxBytesPerRead="16384" maxNameTableCharCount="16384" />
          </binaryMessageEncoding>
          <!--<windowsStreamSecurity protectionLevel="None" />-->

          <tcpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"
            portSharingEnabled="true" />
        </binding>

Windowsアプリケーションを使用して消費すると機能します。しかし、Silverlight 4 を使用して消費すると機能しません。

Silverlight での私のクライアント バインディングは次のとおりです。

 <bindings>
            <customBinding>
                <binding name="DefaultTcp">
                    <binaryMessageEncoding />
                    <tcpTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="net.tcp://localhost:4502/HelloWcf/Service1.svc"
                binding="customBinding" bindingConfiguration="DefaultTcp"
                contract="ServiceReference1.IService1" name="DefaultTcp" />
        </client>

私が受け取るエラーは次のとおりです。

The message could not be processed. This is most likely because the action 'http://tempuri.org/IService1/GetData' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding.

助けてください...

4

2 に答える 2

0

このスレッドが少し古いことは知っていますが、誰かがチェックアウトした場合に備えて、答えを用意しておく価値があります - ここに記載されているように、Silverlight はセキュリティ付きの TCP バインディングをサポートしていません: http://msdn.microsoft.com/en- us/library/cc645026(v=vs.95).aspx

于 2012-10-09T12:47:16.337 に答える
0

TCP 通信を許可するクロス ドメイン アクセス ポリシーを作成しましたか?

<?xml version="1.0" encoding ="utf-8"?> 
 <access-policy>   
  <cross-domain-access>     
   <policy>       
   <allow-from>         
   <domain uri="*"/>       
   </allow-from>       
   <grant-to>         
   <socket-resource port="4502-4506" protocol="tcp" />       
   </grant-to>     
   </policy>   
</cross-domain-access> 
</access-policy>

この記事をチェックしてください: http://www.silverlightshow.net/items/WCF-NET.TCP-Protocol-in-Silverlight-4.aspx

于 2011-10-04T17:25:14.873 に答える