private void button1_Click(object sender, EventArgs e) { bool allowedUser = ClientSideCheck(); if (allowedUser) { SimpleWCFService.Service1Client ss = new SimpleWCFService.Service1Client(); //Token in message body string token = ss.Authenticate(tbxUsername.Text, tbxPassword.Text); lblResult.Text = ss.GetSecretData(numericUpDown1.Value.ToString(), token); } else lblResult.Text = "Your IP is not allowed or Not authenticated!"; }
private void btSubmit_Click(object sender, EventArgs e) { bool allowedUser = ClientSideCheck(); if (allowedUser) { SimpleWCFService.Service1Client ss = new SimpleWCFService.Service1Client(); string token = ss.Authenticate(tbxUsername.Text, tbxPassword.Text); //Token in Message header using (OperationContextScope scope = new OperationContextScope(ss.InnerChannel)) { MessageHeader header = MessageHeader.CreateHeader("Token", "http://tempuri.org/", token); OperationContext.Current.OutgoingMessageHeaders.Add(header); lblResult.Text = ss.GetData(numericUpDown1.Value.ToString()); } } else lblResult.Text = "Your IP is not allowed or Not authenticated!"; }