Esempio n. 1
0
 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);            
 }
Esempio n. 2
0
        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";
            }
        }
Esempio n. 3
0
        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";
            }
        }
Esempio n. 4
0
 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?";
 }
Esempio n. 5
0
 public ExampleController(SecuredServiceClient client)
 {
     _client = client;
 }
Esempio n. 6
0
 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?";
 }