#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0

    IIS Can't access Database -- Possible Application Pool issue?


    I'm running IIS 7.5 on Windows 7 Home Premium.

    I'm finishing chapter one in WCF 4 Step-by-Step. I just finished configuring the IIS Manger. The app was running fine before but now I'm trying to publish the website and it seems it can't read from the Entity Model.

    The book gives these clues or notes:

    "If the address is correct but the application still fails, the most likely cause is that the account used by the application pool hosting the service does not have appropriate access to the AdventureWorks database. The account must be a member of the db_owner role in the AdventureWorks database. For examples of how to add an account with this privilege to the database, see the aspnet.sql script in the Microsoft Press\ WCF Step By Step\ Setup folder."

    Yeah but i went THROUGH A LOT OF TROUBLE TO MAKE SURE THIS SCRIPT RAN as the book specified. So I don't understand what the problem is. How do i check to see if this has been done right?

    This link looks like it has some related advice, but I don't know how to implement it.

    http://forums.asp.net/t/1295298.aspx/1

    http://www.iis.net/learn/manage/configuring-security/application-pool-identities

    http://www.codeproject.com/Questions/328554/IIS-hosted-website-cannot-access-database

    I read this article but not sure what to do or if it applicable: http://technet.microsoft.com/en-us/library/cc771170(v=ws.10).aspx

    I really don't know what to do with this information.

    This is all the Script was supposed to do: (The app ran before i started configuring IIS.)

    Code:
    USE [AdventureWorks]
    GO
    CREATE USER [IIS APPPOOL\DefaultAppPool] FOR LOGIN [IIS APPPOOL\DefaultAppPool]
    GO
    EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\DefaultAppPool]
    GO
    GO
    CREATE USER [IIS APPPOOL\ASP.NET v4.0] FOR LOGIN [IIS APPPOOL\ASP.NET v4.0]
    GO
    EXEC sp_addrolemember N'db_owner', [IIS APPPOOL\ASP.NET v4.0]
    GO
    Here is the error message:

    Test 1: List all products

    Unhandled Exception: System.TimeoutException: The request channel timed out while waiting for a reply after 00:00:58.8749356. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The HTTP request to'http://localhost/ProductsService/Service.svc' has exceeded the allotted timeout of 00:00:59.0370000. The time allotted to this operation may have been a portion of a longer timeout. ---> System.Net.WebException: The operation has timed out

    at System.Net.HttpWebRequest.GetResponse()
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
    --- End of inner exception stack trace ---
    at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    --- End of inner exception stack trace ---

    Server stack trace:
    at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCall
    Message methodCall, ProxyOperationRuntime operation)
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
    Msg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at ProductsClient.ProductsService.IProductsService.ListProducts()
    at ProductsClient.ProductsService.ProductsServiceClient.ListProducts() in C:\
    Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Service References\ProductsService\Reference.cs:line 154
    at ProductsClient.Program.Main(String[] args) in C:\Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Program.cs:line 22
    Press any key to continue . . .
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    4
    Rep Power
    0
    This is resolved

IMN logo majestic logo threadwatch logo seochat tools logo