Entity framework issue with WCF and IIS

jonyzinho

New Member
I have a WCF service, a MS SQL database, and the Visual Studio 2008 development environment all in one machine.The operating system is Windows Server 2008 with IIS 7 on it.The IIS 7 hosts my WCF service and the service is connecting to a database using Microsoft Entity Framework. Currently, I'm testing the WCF service using the WCF Test Client program from Microsoft.The problem is that when I declare an entity like this in my WCF method:\[code\]NewTestDBEntities db = new NewTestDBEntities();\[/code\]the WCF service client shows an error if I connecting to the WCF service hosting on IIS.This is the error message form the WCF service client:Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.I know this line throws an error because if I take this line away, then the WCF call completes. I also tried to test the WCF service by running the debugger (the WCF service client is connected to the ASP.NET Development Server, not IIS), and this line of code\[code\]NewTestDBEntities db = new NewTestDBEntities();\[/code\]runs without error. Does anyone know why this happen?Thank you very much.
 
Top