I have a WCF service which works, but it uses Standard ADO.net to call some stored procedures.
This is a bit messy and annoying to maintain because any stored procs i call, i have to map to DataContracts i have to create manually and then return as JSON.
I would like to convert the WCF service to return EntityFramework entities (so i dont have to keep mapping and creating datacontracts manually).
I have something like this in my method, eg:
public List<GetStuff_Result> GetStuff(string param1)
{
...
StuffEntities ctx = new DataContracts.StuffEntities();
List<GetStuff_Result> list = ctx.GetStuff(5463, "test").ToList();
return list;
}
I have setup the stored proc in the edmx model to return a GetStuff_Result (i imported the stored procedure and used the "create complex function")
I have debugged this, and i get 2 results in the list, but when my WCF method is called via the browser, i get a message on the browser (chrome):
No data received
Unable to load the web page because the server sent no data.
Here are some suggestions:
Reload this web page later.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.
Can anyone tell me how to fix this or at least why it's happening?
note (1): i have also right clicked on the edmx file and disabled lazy loading.
note (2): i have setup a DbContext generator
note (3): i use response format of WebMessageFormat.Json
thanks