Entity Structure Problem with WCF and IIS

I have a WCF service, MS SQL database and Visual Studio 2008 development environment on the same machine. The operating system is Windows Server 2008 with IIS 7. IIS 7 hosts my WCF service and the service connects to the database using the Microsoft Entity Framework. I am currently testing the WCF service using Microsoft's WCF client testing program.

The problem is that when I declare such an object in my WCF method:

NewTestDBEntities db = new NewTestDBEntities();

The WCF service client shows an error if I connect to the WCF service hosting in IIS.

This error message forms the WCF service client:

Failed to call the service. Possible reasons: the service is unavailable or unavailable; client side configuration does not match proxy; existing proxy is invalid. See stack trace for more details. You can try to restore by starting a new proxy server, restoring the default configuration, or updating the service.

I know that this line is causing an error, because if I delete this line, the WCF call will end.

I also tried to test the WCF service by running a debugger (the WCF service client is connected to the ASP.NET development server, not IIS), and this line of code

NewTestDBEntities db = new NewTestDBEntities();

works without errors. Does anyone know why this is happening?

Many thanks.

+3
source share
1 answer

WCF IIS - , EF4, web.config, ?

(NewTestDBEntities) , - , - (: IIS).

+1

Source: https://habr.com/ru/post/1755405/


All Articles