WCF 服务创建 wcf 客户端代理、启动事务、调用代理方法,但在 Message Security 上失败

发布于 2024-09-11 07:52:06 字数 13973 浏览 7 评论 0原文

我正在使用另一个 WCF 服务从 WCF 代理(客户端)调用 WCF 服务,如下所示:

客户端 ->服务1->代理.方法-> Service2

我在任何地方都使用 ASPNet 兼容性,并且配置了 ASP.Net 成员资格并在任何地方都可以工作。如果我使用 TransactionSope 从代理调用 Service2,我总是会在 Service2 上收到消息安全错误,该错误无法验证消息。

查看 WCF 服务跟踪(如下),问题似乎出在 Service2 中的 SqlProvider。我只能认为,不知何故,事务可能会陷入僵局,但在事务之前对其他服务的调用都已成功完成,并且它们根本不使用事务。

如果我不将服务调用包装在 TransactionScope 中,一切都会正常工作!有人知道吗?

布莱恩

131075 3 0 2 布莱恩弗朗-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) 在 System.ServiceModel.Channels.SecurityChannelListener1.ServerSecurityChannel1.VerifyIncomingMessage(Message& 消息,TimeSpan 超时,SecurityProtocolCorrelationState[] correlationState) 在 System.ServiceModel.Channels.SecurityChannelListener1.SecurityReplyChannel.ProcessReceivedRequest(RequestContext requestContext,TimeSpan 超时) 在 System.ServiceModel.Channels.SecurityChannelListener1.ReceiveRequestAndVerifySecurityAsyncResult.ProcessInnerItem(RequestContext innerItem,TimeSpan 超时) 在 System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.OnInnerReceiveDone() 在 System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.StartInnerReceive() 在 System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.Start() 在 System.ServiceModel.Channels.SecurityChannelListener1.SecurityReplyChannel.BeginTryReceiveRequest(TimeSpan 超时,AsyncCallback 回调,对象状态) 在System.ServiceModel.Dispatcher.ReplyChannelBinder.BeginTryReceive(TimeSpan超时,AsyncCallback回调,对象状态) 在 System.ServiceModel.Dispatcher.ErrorHandlingReceiver.BeginTryReceive(TimeSpan 超时,AsyncCallback 回调,对象状态) 在 System.ServiceModel.Dispatcher.ChannelHandler.BeginTryReceive() 在 System.ServiceModel.Dispatcher.ChannelHandler.EnsurePump() 在 System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump() 在 System.ServiceModel.Dispatcher.ChannelHandler.OpenAndEnsurePump(对象状态) 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2() 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.OnSecurityContextCallback(对象 o) 在 System.Security.SecurityContext.Run(SecurityContext securityContext,ContextCallback 回调,对象状态) 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke() 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ProcessCallbacks() 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.CompletionCallback(对象状态) 在 System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.ScheduledOverlapped.IOCallback(UInt32 errorCode,UInt32 numBytes,NativeOverlapped* nativeOverlapped) 在 System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误,UInt32 bytesRead,NativeOverlapped* nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode,UInt32 numBytes,NativeOverlapped * pOVERLAP) **System.ServiceModel.Security.MessageSecurityException:消息安全验证失败。 ----> System.Data.SqlClient.SqlException:超时已过期。操作完成之前超时时间已过,或者服务器没有响应。** 在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,BulkCopySimpleResultSetbulkCopyHandler,TdsParserStateObject stateObj) 在 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() 在 System.Data.SqlClient.SqlDataReader.get_MetaData() 在System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,字符串resetOptionsString) 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、布尔异步) 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、字符串方法、DbAsyncResult 结果) 在System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为) 在 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(字符串用户名,布尔 updateLastLoginActivityDate,Int32&状态,String&密码,Int32&passwordFormat,String&passwordSalt,Int32&failedPasswordAttemptCount,Int32& ; failedPasswordAnswerAttemptCount、Boolean&isApproved、DateTime&lastLoginDate、DateTime& 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved,字符串和盐,Int32和密码格式) 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved) 在 System.Web.Security.SqlMembershipProvider.ValidateUser(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNamePasswordValidator.MembershipProviderValidator.Validate(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken 令牌) 在 System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken 令牌) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList1 allowedTokenAuthenticators, SecurityTokenAuthenticator&usedTokenAuthenticator) 在System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader阅读器,Int32位置,Byte[]解密缓冲区,SecurityToken cryptoToken,String idInEncryptedForm,TimeSpan超时) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader,XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan 超时、ChannelBinding 通道绑定、ExtendProtectionPolicy 扩展保护策略) 在 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,BulkCopySimpleResultSetbulkCopyHandler,TdsParserStateObject stateObj) 在 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() 在 System.Data.SqlClient.SqlDataReader.get_MetaData() 在System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,字符串resetOptionsString) 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、布尔异步) 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、字符串方法、DbAsyncResult 结果) 在System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为) 在 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(字符串用户名、布尔 updateLastLoginActivityDate、Int32& 状态、String& 密码、Int32& 密码格式、String& 密码Salt、Int32& failedPasswordAttemptCount、Int32& failedPasswordAnswerAttemptCount、Boolean& isApproved、DateTime& lastLogin日期、日期时间& ; 上次活动日期) 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved,字符串和盐,Int32和密码格式) 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved) 在 System.Web.Security.SqlMembershipProvider.ValidateUser(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNamePasswordValidator.MembershipProviderValidator.Validate(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken 令牌) 在 System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken 令牌) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList1 allowedTokenAuthenticators, SecurityTokenAuthenticator&usedTokenAuthenticator) 在System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader阅读器,Int32位置,Byte[]解密缓冲区,SecurityToken cryptoToken,String idInEncryptedForm,TimeSpan超时) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader,XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan 超时、ChannelBinding 通道绑定、ExtendProtectionPolicy 扩展保护策略) 在 System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(Message& 消息,TimeSpan 超时) 在 System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message& 消息,TimeSpan 超时)System.Data.SqlClient.SqlException:超时已过期。操作完成之前超时时间已过,或者服务器未响应。 在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,BulkCopySimpleResultSetbulkCopyHandler,TdsParserStateObject stateObj) 在 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() 在 System.Data.SqlClient.SqlDataReader.get_MetaData() 在System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,RunBehavior runBehavior,字符串resetOptionsString) 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、布尔异步) 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior runBehavior、布尔 returnStream、字符串方法、DbAsyncResult 结果) 在System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,布尔returnStream,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为,字符串方法) 在System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior行为) 在 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(字符串用户名,布尔 updateLastLoginActivityDate,Int32&状态,String&密码,Int32&passwordFormat,String&passwordSalt,Int32&failedPasswordAttemptCount,Int32& ; failedPasswordAnswerAttemptCount、Boolean&isApproved、DateTime&lastLoginDate、DateTime& 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved,字符串和盐,Int32和密码格式) 在System.Web.Security.SqlMembershipProvider.CheckPassword(字符串用户名,字符串密码,布尔值updateLastLoginActivityDate,布尔值failIfNotApproved) 在 System.Web.Security.SqlMembershipProvider.ValidateUser(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNamePasswordValidator.MembershipProviderValidator.Validate(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.CustomUserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore(字符串用户名,字符串密码) 在 System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateTokenCore(SecurityToken 令牌) 在 System.IdentityModel.Selectors.SecurityTokenAuthenticator.ValidateToken(SecurityToken 令牌) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlReader reader, SecurityTokenResolver tokenResolver, IList1 allowedTokenAuthenticators, SecurityTokenAuthenticator&usedTokenAuthenticator) 在System.ServiceModel.Security.ReceiveSecurityHeader.ReadToken(XmlDictionaryReader阅读器,Int32位置,Byte[]解密缓冲区,SecurityToken cryptoToken,String idInEncryptedForm,TimeSpan超时) 在 System.ServiceModel.Security.ReceiveSecurityHeader.ExecuteFullPass(XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.StrictModeSecurityHeaderElementInferenceEngine.ExecuteProcessingPasses(ReceiveSecurityHeader securityHeader,XmlDictionaryReader 阅读器) 在 System.ServiceModel.Security.ReceiveSecurityHeader.Process(TimeSpan 超时、ChannelBinding 通道绑定、ExtendProtectionPolicy 扩展保护策略) 在 System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessageCore(消息和消息,TimeSpan 超时) 在 System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(消息和消息,TimeSpan 超时)

I am calling a WCF service from a WCF proxy(client) withing another WCF service as follows:

Client -> Service1 -> Proxy.Method -> Service2

I use ASPNet Compatability everywhre with ASP.Net Membership configured and working everywhere. If I call the Service2 from the proxy using a TransactionSope I always get a message security error on Service2 which is unable to verify the message.

Looking at a WCF service trace (below) it looks like the problem seems to be the SqlProvider in Service2. I can only think that somehow a transaction might be deadlocked but calls to other services BEFORE the transaction have all completed successfully and they DON'T use transactions at all.

If I don't wrap the service call in a TransactionScope everything works fine! Anyone got any idea please?

Brian

131075
3
0
2

BRIANFURLONG-HP

http://msdn.microsoft.com/en-IE/library/System.ServiceModel.Diagnostics.ThrowingException.aspx
Throwing an exception.
/LM/W3SVC/1/ROOT/Nad.CheckoutServices.Host-20-129243786426619315

System.ServiceModel.Security.MessageSecurityException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message security verification failed.

at System.ServiceModel.Security.TransportSecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout)
at System.ServiceModel.Security.SecurityProtocol.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationStates)
at System.ServiceModel.Channels.SecurityChannelListener1.ServerSecurityChannel1.VerifyIncomingMessage(Message& message, TimeSpan timeout, SecurityProtocolCorrelationState[] correlationState)
at System.ServiceModel.Channels.SecurityChannelListener1.SecurityReplyChannel.ProcessReceivedRequest(RequestContext requestContext, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelListener
1.ReceiveRequestAndVerifySecurityAsyncResult.ProcessInnerItem(RequestContext innerItem, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.OnInnerReceiveDone()
at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.StartInnerReceive()
at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult2.Start()
at System.ServiceModel.Channels.SecurityChannelListener1.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 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)
--- End of inner exception stack trace ---

System.Data.SqlClient.SqlException, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
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, IList1 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 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倾城月光淡如水﹏ 2024-09-18 07:52:06

此错误看起来像是您正在使用 http 上调用服务,但它想使用 https。

This error looks like you are using calling a service on http but it wants to use https.

后来的我们 2024-09-18 07:52:06

最后我意识到该事务阻止了对会员资格的访问,这是由访问 Service2 引起的。问题在于会员处理交易的方式。当它应该简单地加入环境事务(如果存在)时,它会专门强制“新事务”

In the end I realised the transaction was blocking the access to membership which was caused by accessing the Service2. Tnis was an issue with the way in which Membership handles transactions. It specifically forces "New Transaction" when it should simply enlist in the ambient transaction if it exists

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文