When I call WCF ,The simulator will die .

1 reply. Last post: July 27, 2015 2:03 AM by Arief Handany
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Zhou WanghuaMember

When I call WCF ,The simulator will die .The following code .When I finished executing"ClientOnSayHelloToCompleted" The simulator will die .What I do is crosslight ios

 

 

public static readonly EndpointAddress EndPoint = new EndpointAddress("http://192.168.1.113:8082/WCF/Report/MouthReportPie.svc");

        private ZwoMobileDnc.Core.WcfMouthPie.MouthReportPieClient _client;
        private void InitializeHelloWorldServiceClient()
        {
            BasicHttpBinding binding = CreateBasicHttp();

            _client = new ZwoMobileDnc.Core.WcfMouthPie.MouthReportPieClient(binding, EndPoint);
            _client.DoWorkCompleted += ClientOnSayHelloToCompleted;
            _client.DoWorkAsync("001", "2015-1-2", "2015-6-7", "192.168.1.113:8082", "");
        
        }
        private static BasicHttpBinding CreateBasicHttp()
        {
            BasicHttpBinding binding = new BasicHttpBinding
            {
                Name = "basicHttpBinding",
                MaxBufferSize = 2147483647,
                MaxReceivedMessageSize = 2147483647
            };
            TimeSpan timeout = new TimeSpan(0, 0, 30);
            binding.SendTimeout = timeout;
            binding.OpenTimeout = timeout;
            binding.ReceiveTimeout = timeout;
            return binding;
        }
        private void ClientOnSayHelloToCompleted(object sender, Core.WcfMouthPie.DoWorkCompletedEventArgs e)
        {
            try
            {
                Exception exce = e.Error;
                if (exce == null)
                {
                  

                }
                else
                {
                    this.ToastPresenter.Show("网络连接异常");
                }
            }
            catch (Exception ex)
            {
                string sd = ex.ToString();
            }
         
        }

All times are GMT -5. The time now is 6:35 PM.
Previous Next