View Single Post
  #3 (permalink)  
Old September 2nd, 2013, 02:22 PM
maurices5000 maurices5000 is offline
Authorized User
Points: 94, Level: 1
Points: 94, Level: 1 Points: 94, Level: 1 Points: 94, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 24
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Thanks for your help. I greatly appreciate it. I've been working on this for days and I'm very frustrated. You have to forgive me. it is hard knowing how to articulate the problem I'm having. IIS and getting the database to cooperate isn't the main focus of my book; it is only mention in passing.

Q1) How do i verify that my app still runs in VS development server? When I run it now it automatically tries to use IIS. I don't think anything is wrong with the app but after a while i started getting an new error message. I'm assuming the problem is still with IIS and not some mistake i made because i would have seen a * by the tab indicating something had changed. (I'm more concerned about getting IIS up and running so if this is too much just don't worry.)

Q2) I went to RUN on the start menu and typed aspnet_regiis.exe but i got an error. Is this what you intended for me to do?

The book that i used to develop the WCF services gives these clues or notes:

"If the [end point] 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."

Well I did what the book said up to this point and I dont know what the problem is.

Below is the script it was talking about aspnet.sql. I did check and the database does have those users and roles.

Quote:
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
I am using the "ASP.NET v4.0" appliation pool. I don't know if that helps.

In IIS when i click on my site and click Basic Setting in the right panel, i get an Edit Application window. There I see the path: C:\inetpub\wwwroot\ProductsService along with two buttons Connect as... and Test Settings... Connect As... is set to Application User (Pass-through authentication). When i press Test AS... I get an error: "There was an error while performing this operation. Details: Invalid application path." When i use my own name with admin access, it is ok. But my app still does not work.

Someone on another forum said i needed to add permissions for IUSR and Network Service to the C:\inetpub\wwwroot\ProductsService. So i gave them full access.

Nothing is still working.

The latest error that I'm getting in the application's Test Console is:

Test 1: List all products

Test 2: Display the details of a product

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at ProductsClient.Program.Main(String[] args) in C:\Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Progr am.cs:line 38
Press any key to continue . . .

The original error was (I don't know if either of these are helpful are provide any additional information but I'm posting so you can see):

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.Ht tpRequestChannel.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.Ht tpRequestChannel.HttpChannelRequest.WaitForReply(T imeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Reques t(Message message, TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.RequestChannel.Reques t(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinde r.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvokeService(IMethodCall
Message methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at ProductsClient.ProductsService.IProductsService.Li stProducts()
at ProductsClient.ProductsService.ProductsServiceClie nt.ListProducts() in C:\
Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Servi ce References\ProductsService\Reference.cs:line 154
at ProductsClient.Program.Main(String[] args) in C:\Users\Sam Johnson\documents\visual studio 2010\projects\ProductsService\ProductsClient\Progr am.cs:line 22
Press any key to continue . . .
Reply With Quote