public static string RequestToServer(string request) { string response = @"{error_code:'96',error_message:'Có lỗi trong quá trình xử lý. Vui lòng thử lại sau'}"; if (client.State != System.ServiceModel.CommunicationState.Opened) { try { client.Abort(); client = new CoreAPI.ChannelAPIClient(); client.Open(); } catch { } } try { response = client.Process(request); } catch { } return response; }
public static dynamic RequestToServer(string request) { string response = @"{error_code:'96',error_message:'Có lỗi trong quá trình xử lý. Vui lòng thử lại sau'}"; if (client.State != System.ServiceModel.CommunicationState.Opened) { try { client.Abort(); client = new CoreAPI.ChannelAPIClient(); client.Open(); } catch { } } try { response = client.Process(request); } catch { } if (String.IsNullOrEmpty(response)) { response = @"{error_code:'96',error_message:'Có lỗi trong quá trình xử lý. Vui lòng thử lại sau'}"; } return new eWallet.Data.DynamicObj(response); }
public static dynamic RequestToServer(string request) { string response = @"{error_code:'96',error_message:'Có lỗi trong quá trình xử lý. Vui lòng thử lại sau'}"; if (client.State != System.ServiceModel.CommunicationState.Opened) { try { client.Abort(); client = new CoreAPI.ChannelAPIClient(); client.Open(); } catch { } } try { response = client.Process(request); } catch { } if (String.IsNullOrEmpty(response)) { response = @"{error_code:'96',error_message:'Có lỗi trong quá trình xử lý. Vui lòng thử lại sau'}"; } return(new eWallet.Data.DynamicObj(response)); }
public ActionResult Index(string src, string dest, string moseq, string cmdcode, string msgbody, string username, string password) { CoreAPI.ChannelAPIClient client = new CoreAPI.ChannelAPIClient(); dynamic request = new Data.DynamicObj(); request.module = "sms"; request.function = "echo"; dynamic response = new Data.DynamicObj(client.Process(request.ToString())); return new HttpStatusCodeResult(HttpStatusCode.OK); // OK = 200 }