Last post Nov 08, 2017 08:09 PM by mahskeet
Nov 08, 2017 03:23 AM|mahskeet|LINK
I have a classic asp app that uses a web service. We are moving servers and I need to update the web service web.config file to point to a new database. When I do this, the web service no longer works in the application.
There are 3 files associated with the web service in my app folder:
I open the web service code in .NET and update the web.config file (to point to the new database). Build and publish the site. Then I copy over the web.config file to my app folder. Obviously I'm doing something wrong...can anyone offer some advice?
Nov 08, 2017 08:27 AM|PatriceSc|LINK
The first general advice would be to never stop at seeing that "it doesn't work" but to always check how it fails exactly. Don't you have an error message in the Windows event log or as part of the service response (if the response comes with a http 500
status code it would confirm a server side error). Knowing the exact error, it will be much easier to just fix this error.
For now we can only guess the likely cause such as (my understanding being that only the db server changed) :
- the server db being not available at all because of firewall rules
- or wrong permissions on the db not allowing the connection wth the account you are using
- if a SQL Server account is used, you may miss additional configuration stuff to re-enable using this db user
- something less likely I didn't thought
- and finally some rare particular situation that would be really hard to guess
So try perhaps the first 2 and if further help is needed please tell the exact error that happens.
Nov 08, 2017 01:43 PM|mahskeet|LINK
There is no runtime error (app doesn't crash). The application hits the same database as the web service with the same credentials.
Here's what I've found in the event viewer -
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 08/11/2017 13:36:20
Event time (UTC): 08/11/2017 13:36:20
Event ID: e6c19948bb294d05ab07c108cf77dd00
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application domain: /LM/W3SVC/1/ROOT/SiteAgreements-3-131546217807059756
Trust level: Full
Application Virtual Path: /SiteAgreements
Application Path: C:\inetpub\wwwroot\SiteAgreements\
Machine name: CIIFAPPS2DEV
Process ID: 2020
Process name: w3wp.exe
Account name: IIS APPPOOL\.NET v2.0
Exception type: HttpException
Exception message: The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications.
Request path: /SiteAgreements/LookupService.asmx/GetPartyList
User host address: ::1
Is authenticated: False
Thread account name: IIS APPPOOL\.NET v2.0
Thread ID: 10
Thread account name: IIS APPPOOL\.NET v2.0
Is impersonating: False
Stack trace: at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Custom event details:
Any thoughts? Thanks again for your help,
Nov 08, 2017 04:41 PM|PatriceSc|LINK
The relevant part is :
"The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications."
More likely your service uses the SqlDependency class ? Direclty or indirectly by using some component relying on this? If confirmed see for example
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/sqldependency-in-an-aspnet-app or check the previous server. You have to enable this at the SQL Server level.
Nov 08, 2017 05:59 PM|mahskeet|LINK
Thanks for your help!
Nov 08, 2017 06:43 PM|PatriceSc|LINK
Happy to help ;-)
As a side note it is a nice example of how much harder it would have been to guess your actual issue compared with seeing the actual error message. This is why I insist often in forums about providing an error message we can start from, rather than just telling
that "it doesn't work".
Nov 08, 2017 08:09 PM|mahskeet|LINK
Oh no, I completely understand. I'm still learning! Thanks again!