Forum Xamarin.iOS
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Why still not be solved WCF Timeout Problem For Months?

hasanirmakhasanirmak CHMember ✭✭
edited April 2015 in Xamarin.iOS

I saw that many people have this problem and they created bug in bugzilla, but there is not any solution yet.

https://bugzilla.xamarin.com/show_bug.cgi?id=25251
https://bugzilla.xamarin.com/show_bug.cgi?id=18029

I have also the same problem.. I tried the service in desktop app, it works but in ios, i suppose that timeout is not considered by service.

this is the my code

public class ClientHelper
{
    // DM Service Address
    private static readonly EndpointAddress EndPoint = new EndpointAddress("https://xxxxxxx/aaaaa/bbbbb.svc/basic");

    public static DMServiceClient CreateClient ()
    {
        var binding = CreateBasicHttp();

        return    new DMServiceClient(binding, EndPoint);
    }


    private static BasicHttpBinding CreateBasicHttp()
    {
        var binding = new BasicHttpBinding()
        {
            Name = "BSHttpBinding",
            MaxReceivedMessageSize = 2147483647,
            MaxBufferSize = 2147483647  
        };

        binding.ReaderQuotas = new System.Xml.XmlDictionaryReaderQuotas()
        {
            MaxArrayLength = 2147483646,
            MaxStringContentLength = 524288045

        };

        var timeout = new TimeSpan(0, 0, 2);
        binding.SendTimeout = timeout;
        binding.OpenTimeout = timeout;
        binding.ReceiveTimeout = timeout;
        binding.CloseTimeout = timeout;

        binding.Security.Mode = BasicHttpSecurityMode.Transport;
        return binding;
    }
}

Could you fix the bug as soon as possible?

Tagged:

Posts

  • hasanirmakhasanirmak CHMember ✭✭

    I found the other way ,but i dont know why team doesnt inform about this solution,its interesting..

    service.InnerChannel.OperationTimeout = TimeSpan.FromSeconds(30.0);

    so it solved my problem..
    http://stackoverflow.com/a/10108281/1022138

  • MattButlerMattButler USUniversity ✭✭

    Has there been any movement on this issue? I'm facing the same issue. I have a PCL that is singleton controller into a WCF endpoint. I'm getting timeout exceptions and have done basically the same things that @hasanirmak tried above and then took the road to nowhere in the stackoverflow case above. Has anyone figured out how to set the Timeout for a WCF call that is in a PCL?

  • Thibault_VellicusThibault_Vellicus CHUniversity ✭✭

    I had a similar WCF timeout problem (first WCF call was ok, but next calls were always getting a timeout). I found a workaround: I have added a cache into my ServiceClientFactory to store the created ClientBase instance instead of creating a new one => It worked! No more timeouts.

    See attached file (_servicesDic is a Dictionary<Type, object>).

    I hope this can help.

Sign In or Register to comment.