private static void Main(string[] args) { ServiceClient serviceClient = new ServiceClient(); ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(IgnoreCertificateErrorHandler); serviceClient.ClientCredentials.UserName.UserName = "******"; serviceClient.ClientCredentials.UserName.Password = "******"; string isOK = serviceClient.GetData(); Console.WriteLine(isOK); Console.ReadLine(); }
static void Main(string[] args) { ServiceClient client = new ServiceClient(); try { client.Open(); writeConsole(client.GetData(3)); client.Close(); } catch { } System.Threading.Thread.Sleep(5000); }