信頼できるセッション + メッセージ セキュリティ + カスタム ユーザー名バリデーターを備えた wsHttpBinding を使用する WCF サービスがあります。
内部的には、デモ アプリケーションを使用するすべてのユーザーが、カスタムの障害例外を取得できます。
catch (FaultException<EPIFault> fx) -- break point on this works
アプリケーションをテストしているサードパーティベンダーが外部から受け取る
catch (CommunicationException exception) - 3rd party vendor break point lands here
このサービスは、Message Security を使用して HTTP ポート 80 でホストされます。サーバー証明書は内部で生成されます。
<serviceCertificate findValue="*.au.mycompany.net"
データの取得は、内部/外部の両方で正常に機能します。カスタム フォールトだけが受信されていません。次のメッセージで通信例外のみをキャッチします。
System.ServiceModel.CommunicationException: The underlying secure session has faulted before the reliable session fully completed. The reliable session was faulted.\r\n\r\nServer stack trace: \r\n at System.ServiceModel.Channels.ReliableRequestSessionChannel.SyncRequest.WaitForReply(TimeSpan timeout)\r\n
以下に詳細を追加
serviceSecurityAudit を使用して WCF 監査を有効にし、一貫してこのメッセージを取得します
The nonce is invalid or replayed
以下のカスタムバインディングを使用して、これを一時的に修正しました
以下のカスタムバインディング
<customBinding>
<binding name="myCustomBinding" closeTimeout="00:15:00" openTimeout="00:15:00" receiveTimeout="00:15:00" sendTimeout="00:15:00">
<reliableSession inactivityTimeout="00:15:00" maxRetryCount="8192" maxPendingChannels="5" ordered="true" />
<transactionFlow />
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation"
requireDerivedKeys="true" includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="false" requireSignatureConfirmation="false"
canRenewSecurityContextToken="true">
<secureConversationBootstrap defaultAlgorithmSuite="Default"
authenticationMode="UserNameForCertificate" requireDerivedKeys="true" allowInsecureTransport="true"
includeTimestamp="true" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSignatureConfirmation="false">
</secureConversationBootstrap>
</security>
<sslStreamSecurity requireClientCertificate="false"/>
<binaryMessageEncoding maxReadPoolSize="2147483647" maxSessionSize="2147483647" maxWritePoolSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="200000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binaryMessageEncoding>
<httpTransport decompressionEnabled="true" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered" ></httpTransport>
</binding>
</customBinding>