Я вызываю службу WCF с прокси-сервера WCF (клиента), используя другую службу WCF, следующим образом:
Клиент -> Сервис1 -> Прокси.Метод -> Сервис2
Я использую ASPNet Compatability везде, где членство ASP.Net настроено и работает везде. Если я вызываю Service2 с прокси-сервера с использованием TransactionSope, я всегда получаю сообщение об ошибке безопасности на Service2, которое не может проверить сообщение.
Если посмотреть на трассировку службы WCF (ниже), то похоже, что проблема в SqlProvider в Service2. Я могу только думать, что каким-то образом транзакция может быть заблокирована, но вызовы других служб ДО того, как все транзакции успешно завершены, и они вообще не используют транзакции.
Если я не заверну вызов службы в TransactionScope, все будет отлично! Кто-нибудь есть идеи, пожалуйста?
Brian
131075
3
0
2
BRIANFURLONG-HP
http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx
Бросать исключение.
/LM/W3SVC/1/ROOT/Nad.CheckoutServices.Host-20-129243786426619315
System.ServiceModel.Security.MessageSecurityException, System.ServiceModel, версия = 3.0.0.0, культура = нейтральная, PublicKeyToken = b77a5c561934e089
Проверка безопасности сообщения не удалась.
в System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage (сообщение и сообщение, время ожидания TimeSpan)
в System.ServiceModel.Security.SecurityProtocol.VerifyIncomingMessage (сообщение и сообщение, время ожидания TimeSpan, SecurityProtocolCorrelationState [] correlationStates)
at System.ServiceModel.Channels.SecurityChannelListener 1.ServerSecurityChannel
1.VerifyIncomingMessage (Сообщение и сообщение, Тайм-аут TimeSpan, SecurityProtocolCorrelationState [] correlationState)
в System.ServiceModel.Channels.SecurityChannelListener 1.SecurityReplyChannel.ProcessReceivedRequest(RequestContext requestContext, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelListener
1.ReceiveRequestAndVerifySecurityAsyncResult.ProcessInnerItem (RequestContext innerItem, TimeSpan timeout)
в System.ServiceModel.Channels.SecurityChannelListener 1.ReceiveItemAndVerifySecurityAsyncResult
2.OnInnerReceiveDone ()
в System.ServiceModel.Channels.SecurityChannelListener 1.ReceiveItemAndVerifySecurityAsyncResult
2.StartInnerReceive ()
в System.ServiceModel.Channels.SecurityChannelListener 1.ReceiveItemAndVerifySecurityAsyncResult
2.Start ()
в System.ServiceModel.Channels.SecurityChannelListener 1.SecurityReplyChannel.BeginTryReceiveRequest(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Dispatcher.ReplyChannelBinder.BeginTryReceive(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.BeginTryReceive(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Dispatcher.ChannelHandler.BeginTryReceive()
at System.ServiceModel.Dispatcher.ChannelHandler.EnsurePump()
at System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump()
at System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump(Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.OnSecurityContextCallback(Object o)
at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks()
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(Object state)
at System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</StackTrace>
**<ExceptionString>System.ServiceModel.Security.MessageSecurityException: Message security verification failed. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.**
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved)
at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)
at System.IdentityModel.Selectors.UserNamePasswordValidator.MembershipProviderValidator.Validate(String userName, String password)
at System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore(String userName, String password)
at System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken token)
at System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken token)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList
1 allowTokenAuthenticators, SecurityTokenAuthenticator & usedTokenAuthenticator)
в System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken (читатель XmlDictionaryReader, позиция Int32, Byte [] decryptedBuffer, SecurityToken encryptionToken, строка idInEncryptedForm, время ожидания TimeSpan)
в System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass (читатель XmlDictionaryReader)
в System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses (ReceiveSecurityHeader securityHeader, читатель XmlDictionaryReader)
в System.ServiceModel.Security.ReceiveSecurityHeader.Process (Тайм-аут TimeSpan, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
в System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore (сообщение и сообщение, время ожидания TimeSpan)
в System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage (сообщение и сообщение, время ожидания TimeSpan)
--- Конец внутренней трассировки стека исключений ---
System.Data.SqlClient.SqlException, System.Data, версия = 2.0.0.0, культура = нейтральная, PublicKeyToken = b77a5c561934e089
Тайм-аут истек. Время ожидания истекло до завершения операции или сервер не отвечает.
в System.Data.SqlClient.SqlConnection.OnError (исключение SqlException, логическое breakConnection)
в System.Data.SqlClient.SqlInternalConnection.OnError (исключение SqlException, логическое breakConnection)
в System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning (TdsParserStateObject stateObj)
в System.Data.SqlClient.TdsParser.Run (RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
в System.Data.SqlClient.SqlDataReader.ConsumeMetaData ()
в System.Data.SqlClient.SqlDataReader.get_MetaData ()в System.Data.SqlClient.SqlCommand.FinishExecuteReader (SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) в System.Data.SqlClient.SqlCommand.RunExecuteReaderTds (CommandBehavior Boost для внешнего интерфейса.SqlCommand.RunExecuteReader (CommandBehavior cmdBehavior, RunBehavior runBehavior, булево значение returnStream, метод String, результат DbAsyncResult) в System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehaeSataChataChataWehaSigner.Exchange.Exchange.Ex бы.ExecuteReader (поведение CommandBehavior, метод String) в System.Data.SqlClient.SqlCommand.ExecuteReader (поведение CommandBehavior) в System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat (имя пользователя для строки состояния, пароль для паролей, логическая переменная типа String;passwordSalt, Int32 и failedPasswordAttemptCount, Int32 и failedPasswordAnswerAttemptCount, Boolean & isApproved, DateTime и lastLoginDate, DateTime и lastActivityDate) на System.Web.Security.SqlMembershipProvider.CheckPassword (String имя пользователя, String пароль, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String & соль, Int32 & passwordFormat) в System.Web.Security.SqlMembershipProvider.CheckPassword(Строковое имя пользователя, Строковый пароль, Boolean updateLastLoginActivityDate, Логическое значение failIfNotApproved) в System.Web.Security.SqlMembershipProvider.ValidateUser (Строковое имя пользователя, Строковый пароль) в System.IdentityModel.Selectors.System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore (строковое userName, строковый пароль) в System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenTicenTenTenenToTenToTenToTenToTenToTenToTenToTenToTenToTenToTenToTeToToTTTT)токен tyToken) в System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken (читатель XmlReader, токен SecurityTokenResolver tokenResolver, IList 1 allowedTokenAuthenticators, SecurityTokenAuthenticator& usedTokenAuthenticator)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader reader, Int32 position, Byte[] decryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan timeout)
at System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader reader)
at System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader, XmlDictionaryReader reader)
at System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan timeout, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy)
at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(Message& message, TimeSpan timeout)
at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout)
</StackTrace>
<ExceptionString>System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat)
at System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved)
at System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password)
at System.IdentityModel.Selectors.UserNamePasswordValidator.MembershipProviderValidator.Validate(String userName, String password)
at System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore(String userName, String password)
at System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken token)
at System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken token)
at System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList
1 selectedTokenAuthenticators, SecurityTokenAuthenticator & usedTokenAutheReaderReaderTechReaderTech.DaderReaderSystemReaderTech.ReaderTimedecryptedBuffer, SecurityToken encryptionToken, String idInEncryptedForm, TimeSpan тайм-аут) в System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass (XmlDictionaryReader читателя) в System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses (ReceiveSecurityHeader securityHeader, XmlDictionaryReader читателя) в System.ServiceModel.Security.ReceiveSecurityHeader.Process (тайм-аут TimeSpan, ChannelBinding channelBinding, ExtendedProtectionPolicy extendedProtectionPolicy) в System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore (сообщение и сообщение, тайм-аут TimeSpan) в System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage (сообщение и сообщение, время ожидания TimeSpan)