I created a project with winforms and used the mvp pattern.
The data with validations is transefered with a wcf.service.
This is the model that is used to make the response.
Code:
public IList<KlantModel> GetKlanten(string sortExpression)
{
var request = PrepareRequest(new KlantRequest());
request.LoadOptions = new string[] { "Klanten" };
request.Criteria = new KlantCriteria { SortExpression = sortExpression };
var response = Client.GetKlanten(request);
//if (response.CorrelationId != request.RequestId)
// throw new ApplicationException("GetCustomers: RequestId and CorrelationId do not match.");
//if (response.Acknowledge != AcknowledgeType.Success)
// throw new ApplicationException(response.Message);
return Mapper.FromDataTransferObjects(response.Klanten);
}
The request works gets all the data with the wcf.service.
But when the service wants to return the response. It doesn't give an error but goes in time out after 10 min. (See code below)
Code:
public KlantResponse GetKlanten(KlantRequest request)
{
var response = new KlantResponse(request.RequestId);
IEnumerable<Klant> klanten;
klanten = _klantDao.GetKlanten(sort);
response.Klanten = klanten.Select(c =>
//Transfer BO to DTO
DataTransferObjectMapper.Mapper.ToDataTransferObject(c)).ToList();
//This is the part where it doesn't do anything anymore
return response;
}
It seems that these are class fields and you are keeping connections open after you are finished with them. The problem with this approach is these connections could be in a bad state the next time you attempt to use them (which could result in the problem you are seeing).
Unlikely. In the WCF service code, put a breakpoint on the
Code:
return list;
statement.
I'll bet the list contains more than 149 records. If it doesn't check out your sql query statement. If it does, you most like have a problem running into the default limit of how much data you can return from the WCF service. To fix, increase the size of maxBufferSize, maxReceivedMessageSize, and maxStringContextLength params inside the binding config.
Bookmarks