Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26542

IIS can't read from my Database

$
0
0

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 is all the Script was supposed to do:  (The app ran before i started configuring IIS.)

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(TimeSpan 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(TimeSpan 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 . . .


Viewing all articles
Browse latest Browse all 26542


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>