我有一个应用程序和一个WCF服务,它是该应用程序的一部分。如果我直接调用该服务会发生以下异常:
“System.Web.Services.Protocols.SoapException:Server无法处理请求.---> System.Data.SqlClient.SqlException:用户'Kanix'登录失败。\ u000a在System.Data.SqlClient .SqlInternalConnection.OnError(SqlException异常,Boolean breakConnection,Action 1 wrapCloseInAction)\u000a at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\u000a at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\u000a at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)\u000a at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)\u000a at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)\u000a at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)\u000a at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)\u000a at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)\u000a at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)\u000a at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)\u000a at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\u000a at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)\u000a at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)\u000a at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource
1 retry,DbConnectionOptions userOptions,DbConnectionInternal& connection)\ u000a at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource 1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)\u000a at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1在SystemADataLayer.SQLHelper.GetMultipleResultSets上的System.Data.SqlClient.SqlConnection.Open()\ u000a处的System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource 1 retry)\u000a at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource
1重试)\ u000a处重试(DbConnectionOptions userOptions)\ u000a字符串strSQlSPName,字典2& params, List
1 outParams)在D:\ TFS SAAS \ HighriseLicensing- \ DataAccessLayer \ SqlHelper.vb:第162行\ u000a at DataAccessLayer.LoginDL.AuthenticateKey(String key,Int32 guid,String userid,Int32 Mode) )在D:\ TFS SAAS \ HighriseLicensing- \ DataAccessLayer \ LoginDL.vb:在D:\ TFS SAAS \ HighriseLicensing- \ BusinessLogicLayer \ LoginBL.vb:line 18 \ u000a at中的BusinessLogicLayer.LoginBL.AuthenticateKey(String key,Int32 guid,String userid,Int32 Mode)中的第20行\ u000a Lincensing.GetFaith.CheckKey中的Lincensing.GetFaith.CheckKeyvalidity(字符串键,Int32 guid,字符串InstallationId,Int32模式)在D:\ TFS SAAS \ HighriseLicensing- \ Lincensing \ GetFaith.asmx.vb:第53行\ u000a(字符串键, Int32 guid,String InstallationId,Int32 Mode)在D:\ TFS SAAS \ HighriseLicensing- \ Lincensing \ GetFaith.asmx.vb:第23行\ u000a ---内部异常堆栈跟踪结束---“
一件重要的事情是,当我从应用程序登录时,此服务正常工作,但如果我从应用程序注销,则会出现此错误。
答案 0 :(得分:0)
看起来你有登录问题。请直接从sql server management studio或使用相同凭据连接服务器。凭证无效。