private void TrainPropertiesDlg_Closed(object sender, EventArgs e) { TrainPropertiesDlg dlg = sender as TrainPropertiesDlg; if ((dlg != null) && !(!dlg.DialogResult.HasValue ? true : !dlg.DialogResult.Value)) { TISWebServiceSoapClient client = this.GetClient(); client.SetTrainDataCompleted += new EventHandler <SetTrainDataCompletedEventArgs>(this.TISWebService_SetTrainDataCompleted); client.SetTrainDataAsync(dlg.Train.ID, dlg.TrainIdNew, dlg.Locomotive, dlg.Description, this.m_strUserName); } }
private TISWebServiceSoapClient GetClient() { TISWebServiceSoapClient client = new TISWebServiceSoapClient(); if (Application.get_Current().get_Host().get_Source().AbsoluteUri.StartsWith("https") && client.Endpoint.Address.Uri.AbsoluteUri.StartsWith("http")) { client.Endpoint.Address = new EndpointAddress(client.Endpoint.Address.Uri.AbsoluteUri.Replace("http", "https")); (client.Endpoint.Binding as BasicHttpBinding).Security.Mode = BasicHttpSecurityMode.Transport; } return(client); }
private void OnTimerGetState() { if (!this.m_bInsideTimerForTrains) { this.m_bInsideTimerForTrains = true; TISWebServiceSoapClient client = this.GetClient(); client.GetStateCompleted += new EventHandler <GetStateCompletedEventArgs>(this.TISWebService_GetStateCompleted); TISWebServiceGetStateSupportIN tin = new TISWebServiceGetStateSupportIN { clientLastRealTimeTrainGraphTime = this.m_serverInfo.LastTrainGraphTime, getRegularTraingraphData = this.m_needToFillTrainGraph, traingraphStart = (this.m_tgd != null) ? this.m_tgd.TimeStart : DateTime.MinValue, traingraphStop = (this.m_tgd != null) ? this.m_tgd.TimeStop : DateTime.MinValue }; string strIn = DCSerializer.SerializeWithDCS(tin); if (Application.get_Current().get_Host().get_Source().AbsoluteUri.StartsWith("https") && client.Endpoint.Address.Uri.AbsoluteUri.StartsWith("http")) { client.Endpoint.Address = new EndpointAddress(client.Endpoint.Address.Uri.AbsoluteUri.Replace("http", "https")); (client.Endpoint.Binding as BasicHttpBinding).Security.Mode = BasicHttpSecurityMode.Transport; } client.GetStateAsync(strIn); } }
private TISWebServiceSoapClient GetClient() { TISWebServiceSoapClient client = new TISWebServiceSoapClient(); if (Application.get_Current().get_Host().get_Source().AbsoluteUri.StartsWith("https") && client.Endpoint.Address.Uri.AbsoluteUri.StartsWith("http")) { client.Endpoint.Address = new EndpointAddress(client.Endpoint.Address.Uri.AbsoluteUri.Replace("http", "https")); (client.Endpoint.Binding as BasicHttpBinding).Security.Mode = BasicHttpSecurityMode.Transport; } return client; }