WCF timeout issue

I run EFLayers sample that I download from John Papa website. Whenever I click at customer about 5-6 times, there is an error:

The request channel timed out while waiting for a reply after 00:01:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

I searching on the web and realize that we must close WCF Proxy.

private Customer FindCustomer()
{
    var customer = new Customer();
    if (view.CurrentCustomer.CustomerID != null)
    {
        string customerID = view.CurrentCustomer.CustomerID.ToString();
        using (var svc = new NWServiceClient())
        {
            customer = svc.FindCustomer(customerID);
        }
    }
    return customer;
}

private List<Order> FindOrderList()
{
    List<Order> orderList = null;
    if (view.CurrentCustomer.CustomerID != null)
    {
        string customerID = view.CurrentCustomer.CustomerID.ToString();
        using (var svc = new NWServiceClient())
        {
            orderList = svc.FindOrderList(customerID);
        }
    }
    return orderList;
}

ThinhNQ.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: