Custom Binding In wcf

Jun 11 2015 7:58 AM

Hi Good Evening,

I am facing issue with custom binding.

I m using wsHTTPBinding but client machine time and server machine time are dufferent so I wrote on server configuration file with custom binding as

<bindings>

<customBinding>

<binding name="UpdateReportParameters_Config">

<transactionFlow />

<security authenticationMode="UserNameForSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">

<localClientSettings cacheCookies="false" detectReplays="false" maxCookieCachingTime="00:30:00" />

<localServiceSettings replayCacheSize="9" maxClockSkew="00:30:00" replayWindow="00:07:22.2190000" />

<secureConversationBootstrap>

<localClientSettings maxClockSkew="00:30:00" />

<localServiceSettings maxClockSkew="00:30:00" />

</secureConversationBootstrap>

</security>

<textMessageEncoding />

<httpTransport />

</binding>

</customBinding>

</bindings>

Instead of

<bindings>

<wsHttpBinding>

<binding name="UpdateReportParameters_Config" transactionFlow="true" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00">

<security mode="Message">

<message establishSecurityContext="false" clientCredentialType="UserName" />

</security>

</binding>

</wsHttpBinding>

</bindings>

Now when I run the project after consuming service below error is thrown.

Please help me


Answers (1)

0
Satyapriya Nayak

Satyapriya Nayak

  • 0
  • 39.3k
  • 13.3m
Aug 12 2013 4:08 AM
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Validation_on_textbox { public partial class Form2 : Form { public Form2() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { foreach (Control c1 in this.Controls) { if (c1 is TextBox) { if (c1.Text == "") { MessageBox.Show("Name Field cannnot be blank"); c1.BackColor = Color.Orange; textBox1.Focus(); } else { MessageBox.Show("Correct"); c1.BackColor = Color.White; } } } } } }
0
Anubhav Chaudhary

Anubhav Chaudhary

  • 27
  • 41.8k
  • 20m
Aug 12 2013 3:58 AM
Just write this code on the click of button and your problem will be solved.

        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text=="")
            {
                textBox1.BackColor = Color.Red;
            }

        }
0
Mahesh Babu

Mahesh Babu

  • 0
  • 6
  • 2.1k
Aug 12 2013 3:50 AM
this only console program.......
0
Iftikar Hussain

Iftikar Hussain

  • 0
  • 12.6k
  • 449.2k
Aug 12 2013 3:48 AM
Hi,
        You can do like this

private void button1_Click(object sender, EventArgs e)
{
            bool isValid = true;
            textBox1.BackColor = System.Drawing.Color.White;
            textBox2.BackColor = System.Drawing.Color.White;
            textBox3.BackColor = System.Drawing.Color.White;
            if (textBox1.Text == "")
            {
                isValid = false;
                textBox1.BackColor = System.Drawing.Color.Red;
            }
            if (textBox2.Text == "")
            {
                isValid = false;
                textBox2.BackColor = System.Drawing.Color.Red;
            }
            if (textBox3.Text == "")
            {
                isValid = false;
                textBox3.BackColor = System.Drawing.Color.Red;
            }
            if (isValid)
            {
                //do your code
            }
}

Regards,
Iftikar
0
Mahesh Babu

Mahesh Babu

  • 0
  • 6
  • 2.1k
Aug 12 2013 3:46 AM
still it is showing the only my project name i.e oppsproject only...it is not showing my added class