I have some more info on this issue (bug ?)
While everything pointed to the maximum messagesize, it has to do with relationships between the entities.
I have a GridEntity, which has some parameter fields, and a collection of CellEntities (that have a foreign key GridId)
On the client side, I have the following code :
GridEntity grid = new GridEntity();
grid.Rows = numRows;
grid.Columns = numColumns;
for (int i = 0; i < numRows; i++)
{
for (int j = 0; j < numColumns; j++)
{
CellEntity cell = new CellEntity();
cell.Row = i;
cell.Column = j;
grid.CellEntities.Add(cell);
}
}
Then I sent this entity to my WCF Proxy , using the channelfactory :
IGridService gridservice = ChannelFactory.CreateChannel();
Here's the interesting part : when there is no related entity, the WCF call proceeds. When there is a relationship, i get the "400 bad request" error (with no innerexception). This is both when using the NetDataContractSerializer, as well as the default llblgen serializer
These are the case :
gridservice.SaveGrid(grid); <-- 400 BAD REQUEST
grid.Cells.Clear();
gridservice.SaveGrid(grid); <-- succeeds
CellEntity cell = grid.Cells[0];
gridservice.SaveCell(cell); <-- 400 BAD REQUEST
CellEntity cell = grid.Cells[0];
cell.GridEntity = null;
gridservice.SaveCell(cell); <-- succeeds
This leads me to believe there is an issue with serializing relationships of newly created entities ? When I serialized entities fetched from the database using prefetchpaths, I can successfully sent them from the server to the client.