public ControllerSoapClient GetHDClient() { if (_HDSoapClient == null) { //BasicHttpBinding binding = new BasicHttpBinding(); //binding.MaxReceivedMessageSize = 2147483647; //binding.MaxBufferSize = 2147483647; //EndpointAddress address = new EndpointAddress(this.GetHDURL()); //_HDSoapClient= new ControllerSoapClient(binding, address); _HDSoapClient = new ControllerSoapClient(); } return _HDSoapClient; }
private void button1_Click(object sender, RoutedEventArgs e) { ControllerSoapClient HDClient = new ControllerSoapClient(); ErrorLog.WriteLog("InitDevice:", "011"); //string Result = HDClient.InitDevice(1, "011"); //ErrorLog.WriteLog("InitDevice:_Result", Result); ErrorLog.WriteLog("GetDeviceStatus:", "011"); string Result = HDClient.GetDeviceStatus(1, "011", 0, 0, 10); ErrorLog.WriteLog("GetDeviceStatus:_Result", Result); string fjqAddress = "011"; for (int i = 0; i < 10; i++) { ErrorLog.WriteTestLog("#CheckMsg#", "GetDeviceMSG Address" + fjqAddress); string Msg = HDClient.GetDeviceMSG(1, fjqAddress, 10); ErrorLog.WriteTestLog("#CheckMsg#", Msg); } }
public bool PrintSlip(string mBillNo) { ////票号#业务名称#当前业务人数#当前网点人数 if (string.IsNullOrEmpty(mBillNo)) { return false; } try { string[] arr = mBillNo.Split('#'); if (arr.Length >= 4) { //Branch=#Number=MA098#BusinessType=个人现金#Count=108#TipMsg2=#Time=2010-3-26 22:31:22#Birthday=## string Content = "Branch=#Number=<#PH>#BusinessType=<#bussNmae>#Count=<#WaitUserLen>#TipMsg2=#Time=<#Time>#Birthday=##"; Content = Content.Replace("<#PH>", arr[0]) .Replace("<#bussNmae>", arr[1]) .Replace("<#WaitUserLen>", arr[3]) .Replace("<#Time>", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); ControllerSoapClient HDClient = new ControllerSoapClient(); ErrorLog.WriteLog("PRINT_MSG", Content); string msg = HDClient.PrintSlip(Content,5); ErrorLog.WriteLog("PrintSlip#OK", msg); } } catch (Exception ex) { ErrorLog.WriteLog("PrintSlip#ex", ex.Message); return false; } return true; }
public ControllerSoapClient GetHDClient() { ControllerSoapClient HDClient=new ControllerSoapClient(); return HDClient; }