//SecurityReference.SecuritySoapClient client = new SecurityReference.SecuritySoapClient(); void Retrive_DomainsUrlCallback(IAsyncResult result) { txtResult.Text = string.Empty; ServiceReference1.CoreSecurityClient clientProxy = new ServiceReference1.CoreSecurityClient("wcf_iis"); try { AuthenticateService(clientProxy); txtResult.Text = clientProxy.GetDomainNames(); clientProxy.Close(); } catch (FaultException fx) { txtResult.Text = "FaultException\r\n" + Fwk.Exceptions.ExceptionHelper.GetAllMessageException(fx); clientProxy.Abort(); } catch (Exception err) { txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(err); clientProxy.Abort(); } }
private void Authenticate_Click(object sender, EventArgs e) { txtResult.Text = string.Empty; ServiceReference1.CoreSecurityClient clientProxy = null; try { clientProxy = new ServiceReference1.CoreSecurityClient("wcf_iis"); AuthenticateService(clientProxy); CentralizedSecurity.W32.Test.ServiceReference1.LoogonUserResult loogonRes = clientProxy.Authenticate(txtAuthenticate_UserName.Text, txtAuthenticate_Password.Text, txtAuthenticate_Domain.Text); string x = GetLoogonUserResult(loogonRes); // string x = clientProxy.Test(); txtResult.Text = x; clientProxy.Close(); } catch (FaultException fx) { txtResult.Text = "FaultException\r\n" + Fwk.Exceptions.ExceptionHelper.GetAllMessageException(fx); if (clientProxy != null) { clientProxy.Abort(); } } catch (Exception err) { txtResult.Text = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(err); if (clientProxy != null) { clientProxy.Abort(); } } }