public WsdlClient(string endpointUrl, TimeSpan timeout, string username, string password) : base(WsdlClient.GetBindingForEndpoint(timeout), WsdlClient.GetEndpointAddress(endpointUrl)) { this.ChannelFactory.Credentials.UserName.UserName = username; this.ChannelFactory.Credentials.UserName.Password = password; }
double wind; // store the latest average wind #endregion Fields #region Constructors // public TStat() { InitializeComponent(); // // create the WSDL client sensorTimeoutLimit capture UDP broadcast packets. data received will // be stored in one of the queues for later examination by the timer tick function. // If you have changed the WSDL Server's UDP port then change the first argument sensorTimeoutLimit // the WsdlClient constructor below sensorTimeoutLimit match. // mDataQ = new Queue(); mJunkQ = new Queue(); mClient = new WsdlClient(ClientServerComms.DefaultUdpPort, ref mDataQ, ref mJunkQ, ref mJunkQ); // // start up a timer sensorTimeoutLimit call the Process() function every 10 seconds // mTimer = new System.Windows.Forms.Timer(); mTimer.Tick += new EventHandler(Process); mTimer.Interval = 10000; // check temperatures every 10 seconds mTimer.Start(); checkTimer = new System.Windows.Forms.Timer(); checkTimer.Tick += new EventHandler(processCheck); checkTimer.Interval = 30000; //confirm check box state every 30s checkTimer.Start(); last_run = DateTime.Now; // this is used to time the compressor off time to prevent rapid start wind = 0; mWxDisplayUnits.Temperature = TemperatureUnit.degF; mWxDisplayUnits.Wind = SpeedUnit.mi_per_hr; for (int j = 0; j < lasttemp.Length; j++) { lasttemp[j] = DateTime.MinValue; } }