Have a simple test app that calls a simple WCF service that responds with
message if service is present. This demonstrates errors we receive in our
App that on the 10th call to a WCF service in a app session the app crashes.
Have tried dispose, close, server setting changes etc with not sucess. Below
is code segment of the test code. Nine hits of ui button respond with
message from servic. 10th one crashes.

Running latest monotouch 4.0.3. 

  public override void ViewDidLoad ()
    {
        base.ViewDidLoad ();


        mailButton.TouchUpInside += (o, e) =>
        {

        BasicHttpBinding BindType = new BasicHttpBinding();
        BindType.ReceiveTimeout = new TimeSpan(0,0,15);

        EndpointAddress ep = new
EndpointAddress(@"http://myservice.mydomain.com/MyBusServiceBusService/MFService.svc/BaseService";);
        BaseServiceClient MFService = new BaseServiceClient(BindType, ep);
        MFService.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0,0,10);
        MFService.BaseServiceTestCompleted += delegate(object sender,
BaseServiceTestCompletedEventArgs ex) 
          {
              UIAlertView alert = new UIAlertView();
              alert.Title = "Base Service Test";
              alert.AddButton("Ok");
              ++timesThrough;
              alert.Message = ex.Result + " Times=" +
timesThrough.ToString();;
              alert.InvokeOnMainThread(delegate{alert.Show();  });
              var clientObject = sender as BaseServiceClient;
                if (clientObject != null && clientObject.State ==
System.ServiceModel.CommunicationState.Opened)
                {
                       (clientObject.ChannelFactory).Close();
                     (clientObject).Close();
                      ((IDisposable)clientObject).Dispose();
                     clientObject = null;
                }
              if (MFService != null)
                 {

                    (MFService.ChannelFactory).Close();
                     (MFService).Close();
                      ((IDisposable)MFService).Dispose();
                     MFService = null;
                 }

             GC.Collect();



        };

        try
        {
          MFService.BaseServiceTestAsync();

        }
        catch (Exception ex)
        {
          UIAlertView alert = new UIAlertView();
          alert.Title = "Base Service Test";
          alert.AddButton("Ok");

          alert.Message = ex.Message ;
          alert.InvokeOnMainThread(delegate{alert.Show();});
          MFService = null;
          GC.Collect();
        }



        };
    }


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Urgent-WCF-call-fails-on-10th-attempt-SIGILL-error-tp3622923p3622923.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to