static BiometricContext() { _proxy = new SecuredServiceClient(); SecuredServiceClient client = new SecuredServiceClient(); client.ChannelFactory.Credentials.UserName.UserName = "******"; client.ChannelFactory.Credentials.UserName.Password = "******"; //client.Endpoint.Behaviors.Add(new LoginBehavior()); //EndpointAddress address = new EndpointAddress("http://localhost:8000/SecuredService"); //WSHttpBinding binding = new WSHttpBinding(); //ChannelFactory<ISecuredService> cf = new ChannelFactory<ISecuredService>(binding, address); }
private void cmdCallWorkflowService_Click(object sender, EventArgs e) { //if the proxy isn't created or is for some reason not opened, create a new instance of the proxy if (proxy == null || proxy.State == System.ServiceModel.CommunicationState.Opened) proxy = new SecuredServiceClient("SecuredEndpoint"); try { int response = proxy.AskQuestion(txtRet.Text).Value; txtAnswer.Text = response.ToString(); MessageBox.Show("You have the magic character!"); } catch (SecurityAccessDeniedException ex) { MessageBox.Show( "Request Denied! You must have the magic character (see Constants.cs) in your name in order to get an answer!" + "\n\t" + ex.Message.ToString() ); txtAnswer.Text = "Denied"; } }
private void cmdCallWorkflowService_Click(object sender, EventArgs e) { //if the proxy isn't created or is for some reason not opened, create a new instance of the proxy if (proxy == null || proxy.State == System.ServiceModel.CommunicationState.Opened) { proxy = new SecuredServiceClient("SecuredEndpoint"); } try { int response = proxy.AskQuestion(txtRet.Text).Value; txtAnswer.Text = response.ToString(); MessageBox.Show("You have the magic character!"); } catch (SecurityAccessDeniedException ex) { MessageBox.Show( "Request Denied! You must have the magic character (see Constants.cs) in your name in order to get an answer!" + "\n\t" + ex.Message.ToString()); txtAnswer.Text = "Denied"; } }
private void Form1_Load(object sender, EventArgs e) { Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); proxy = new SecuredServiceClient("SecuredEndpoint"); txtRet.Text = "What is your favorite number?"; }
public ExampleController(SecuredServiceClient client) { _client = client; }