2012-01-11 12 views
0

これはエラーが発生しています:WCFセキュリティ実装エラー

メッセージを処理できませんでした。これは、アクション「http://tempuri.org/xxxxxx」が正しくないか、メッセージに無効または有効期限が切れているセキュリティコンテキストトークンが含まれているか、またはバインディング間に不一致があるためです。セキュリティコンテキストトークンは、サービスが非アクティブなためにチャネルを強制終了した場合は無効になります。途中でサービスエンドポイントのは、HERE

を結合に受信タイムアウトを増やすアイドルセッションを中断からサービスを防ぐためには、私のweb.configファイルコピーは次のとおりです。

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
     <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
     </assemblies> 
    </compilation> 
    </system.web> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="wsUserNameToken"> 
      <security mode="TransportWithMessageCredential"> 
      <transport clientCredentialType="None"/> 
      <message clientCredentialType="UserName"/> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <services> 
     <service name="ServiceName" behaviorConfiguration="userNameTokenBehavior"> 
     <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsUserNameToken" name="userNameTokenService" contract="ContractName"/> 
     <endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="wsUserNameToken" name="MexHttpsBindingEndpoint" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="userNameTokenBehavior"> 
      <serviceMetadata httpsGetEnabled="true"/> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
      <serviceCredentials> 
      <serviceCertificate findValue="xxxxxxxxxxxxx" x509FindType="FindByThumbprint" storeLocation="LocalMachine" storeName="My" /> 
      <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="xxxxx.xxxxx.UsernameValidator, App_Code"/> 
      </serviceCredentials> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

誰もが私の設定ファイルでいただきました!間違って把握していただけますか?

+1

WCFはクライアントとサーバーの間のダンスです。クライアントの設定も含めることができますか? –

+0

サービス名属性とエンドポイント契約属性は完全修飾名である必要があります。また、あなたのサービスのトレースを有効にして、失敗する理由を知ることができます。 – Rajesh

答えて

0

wsHttpBinding要素には、プロパティrecieveTimeoutを追加し、その値を大きな値に設定してチェックできますか?以下はサンプルです。また、あなたのサービスにTracingを有効にしようとすると、要求が失敗した理由について理由を判別するために、ログを調べ

<binding name="wsUserNameToken" closeTimeout="00:01:00" openTimeout="00:01:00" 
      receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" 
      transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" 
      useDefaultWebProxy="true" allowCookies="false"> 

希望に役立ちます。

+1

これは明らかに彼の問題に対する解決策ではありません。 WCFバインディングの問題は、ほとんどの場合、タイムアウトの問題が原因ではありません。 – user989056

0

メタデータバインディングを確認してください。バインドはmexHttpsBindingでwsHttpBindingでなければなりません。