Having trouble connecting to SQl after moving Service to server
-
27 января 2012 г. 16:27
I created a webservice in Studio 2010 and ran and tested it in Studio using the built in interface. I then moved the service to my local machines IIS instance and also to an intranet server. The problem is now through IIS or the Intranets IIS I can an access error
Message=System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Login failed for user 'DEVELOP_ST_3$'. at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) at BankAccountChanges.BankAccountChange.dtGetChangeStatusTypes() in C:\inetpub\wwwroot\XMLWebServices\IMS.BankAccountChanges\IMS.BankAccountChanges\BankAccountChanges.asmx.vb:line 30 --- End of inner exception stack trace ---
The error itself I assume is because when running through studio the active directory settings allowed me access to SQl but through IIS it is using my machine name which does not have access to the server. Now all the connections and validations for data are completed in a DLL on the backend and eventually this will be hosted externally. I am checking usernames for access to methods in the soap header but they will not have access to DB either. So I need to allow impersonating or anonymous access in my web config file or in IIS.Can someone please help me to understand how to do that(So I need to allow impersonating or anonymous access in my web config file or in IIS)?
TIA
Все ответы
-
27 января 2012 г. 17:42МодераторWhy not use SQL Server authentication in stead of Windows?
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects -
27 января 2012 г. 17:56All the SQL connections are completed in a DLL that is running behind the webservice
-
27 января 2012 г. 19:28МодераторThat doesn't answer my question. Why not change the connection strings to use SQL authentication? Then you don't have to think about impersonation or anything.
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects -
28 января 2012 г. 14:31
Because, if I am understanding you correctly You are sugesting that I change the code that accesses the data. That code lives in a dll that is already in use with multiple applications and functions fine. THis web service is asking for the data from the DLL it does no SQL connections at all. (so in short I don't have access to change the connection strings) The thing is when running in Studio, studio handles the "IIS functionality" and uses a profile that has access to run SQL however IIS is using the aspnet profile which apparently does not.
Is that clearer?
-
29 января 2012 г. 20:31МодераторI was hoping that your connection strings were stored in the web.config, in which case you could change the credentials in the connection strings without changing the code.
John Saunders
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects -
6 февраля 2012 г. 7:12checkout any service is not stopped or try using sql authentication
-
7 февраля 2012 г. 10:23http://www.windowspages.com/net-framework/4082-having-trouble-connecting-sql-after-moving-service-server/
-
16 февраля 2012 г. 22:24
The old machine appears to have had a machine to machine trust to the SQL Server. I persoanlly prefer this as it simplifies the DBA of the SQL Server and it avoids auditing type people that do not like People or accounts used to access data. the user DEVELOP_ST_3$ that should be in your domain needs database access to your data. A lot of System/DBA type people like to throw the user in a group and provide the group access. Then it should work.
There is no reason to change the code for this issue. If you want to do what John suggested, Go to the identity in the application pool running the service and change it to a global user or someone that has access. You will need to provide a password as well.
Fred
- Помечено в качестве ответа DanRowe 17 февраля 2012 г. 3:29

