private static ResponseRd GetOrderFromStore(string orderAtoId, string wsAddress)
 {
     using (var client = new QueryFunctionClient(new BasicHttpBinding(), new EndpointAddress(wsAddress + SettingsData.Constants.StoreOrder.WsQueryFunction)))
     {
         var iTries = 0;
         while (iTries < 2)
         {
             try
             {
                 var result = client.GetOrderById(long.Parse(orderAtoId));
                 if (!result.IsSuccess)
                 {
                     continue;
                 }
                 client.Close();
                 return(result);
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.Message);
             }
             Thread.Sleep(200);
             iTries++;
         }
         client.Close();
     }
     return(null);
 }
示例#2
0
        private void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }
            if (_client == null)
            {
                return;
            }

            try
            {
                _client.Close();
                _client = null;
            }
            catch (Exception)
            {
                _client = null;
            }
        }