I created a project with winforms and used the mvp pattern.
The WCF service handles the data control.
From Bussines objects tot Data Transfer objects and back.
Everything works fine until the return statement.
Tested it with an sql statement that shows less customers.
Found the problem but can't figure out a solution without throwing the whole pattern over.
It shows up to 149 customers. When I change the criteria in the sql statement, to more then 149 records to show then it stops at return response and goes in Time Out after 10 minutes.
Maybe a limit on the capacity?
This is a method in the model that is used to make the request and the response.
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);
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)
public KlantResponse GetKlanten(KlantRequest request)
{
var response = new KlantResponse(request.RequestId);
IEnumerable<Klant> klanten;
klanten = _klantDao.GetKlanten(sort);
response.Klanten = klanten.Select(c =>
DataTransferObjectMapper.Mapper.ToDataTransferObject(c)).ToList();
return response;
}
The web.config is configured also <servicemodel>.
<system.serviceModel>
<services>
<service behaviorConfiguration="behaviorAction" name="NameSpace.Service">
<endpoint binding="wsHttpBinding" bindingConfiguration="bindingAction" contract="NameSpace.IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorAction">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="bindingAction" transactionFlow="false" sendTimeout="00:30:00" receiveTimeout="00:30:00">
<reliableSession enabled="true"/>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
</servicemodel>
the response is handled with the response class. Klantrequest.cs
[DataContract(Namespace = "http://www.yourcompany.com/types/")]
public class KlantRequest : RequestBase
{
/// <summary>
/// Selection criteria and sort order
/// </summary>
[DataMember]
public KlantCriteria Criteria;
/// <summary>
/// Klant object.
/// </summary>
[DataMember]
public KlantDto Klant;
}
Does anyone knows how it comes that just the return doesn't work without any error?
Thanks in advance.