none
SecurityNegotiationException was unhandled RRS feed

  • Question

  • here is my code:

    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;
    using WindowsAppClient.ServiceReference1;


    namespace WindowsAppClient
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {
                MyNumericServeClient obj = new MyNumericServeClient("WSHttpBinding_IMyNumericServe");
              int res = obj.add(int.Parse(textBox1.Text), int.Parse(textBox2.Text));
              label1.Text = " addiont Result is:" + res.ToString();
            }
        }
    }

    
    Sunday, January 5, 2014 4:08 AM

Answers

  • Hi,

    By default wsHttpBinding uses the message level security and basicHttpBinding is not secure. If you disable security on your wsHttpBinding application or use the basicHttpBinding for instead, then in my mind, it should work.

    For disabling the security on your wsHttpBinding, please try to refer to:

     <wsHttpBinding>
         <binding name="WSHttpBinding_IMyNumericServe">
           <security mode="None"/>
         <binding>
     </wsHttpBinding>

    For using the basicHttpBinding for instead, please try to check:

    <basicHttpBinding>
        <binding name="basicHttpBinding_IMyNumericServe" />
    <basicHttpBinding>   

    Then in the client side, you can use the basicHttpBinding.

    Also please try to check this similar thread:
    http://stackoverflow.com/questions/9092688/wcf-wshttpbinding-soap-security-negotiation-failed .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, January 7, 2014 2:33 AM
    Moderator

All replies

  • this is my

    app.config

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_IMyNumericServe" />
                </basicHttpBinding>
                <wsDualHttpBinding>
                    <binding name="WSDualHttpBinding_IMyNumericServe" />
                </wsDualHttpBinding>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_IMyNumericServe" />
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8090/whereever/xxx" binding="wsHttpBinding"
                    bindingConfiguration="WSHttpBinding_IMyNumericServe" contract="ServiceReference1.IMyNumericServe"
                    name="WSHttpBinding_IMyNumericServe">
                              <identity>
                        <userPrincipalName value="username" />
                    </identity>
                </endpoint>
                <endpoint address="http://localhost:8090/whereever/yyy" binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpBinding_IMyNumericServe" contract="ServiceReference1.IMyNumericServe"
                    name="BasicHttpBinding_IMyNumericServe" />
                <endpoint address="http://localhost:8090/whereever/zzz" binding="wsDualHttpBinding"
                    bindingConfiguration="WSDualHttpBinding_IMyNumericServe" contract="ServiceReference1.IMyNumericServe"
                    name="WSDualHttpBinding_IMyNumericServe">
                    <identity>
                        <userPrincipalName value="username" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>


    • Edited by Btb4198 Sunday, January 5, 2014 5:11 AM
    Sunday, January 5, 2014 5:07 AM
  • now it says:

    can anyone help me

    ?

    Monday, January 6, 2014 3:21 PM
  • Hi,

    By default wsHttpBinding uses the message level security and basicHttpBinding is not secure. If you disable security on your wsHttpBinding application or use the basicHttpBinding for instead, then in my mind, it should work.

    For disabling the security on your wsHttpBinding, please try to refer to:

     <wsHttpBinding>
         <binding name="WSHttpBinding_IMyNumericServe">
           <security mode="None"/>
         <binding>
     </wsHttpBinding>

    For using the basicHttpBinding for instead, please try to check:

    <basicHttpBinding>
        <binding name="basicHttpBinding_IMyNumericServe" />
    <basicHttpBinding>   

    Then in the client side, you can use the basicHttpBinding.

    Also please try to check this similar thread:
    http://stackoverflow.com/questions/9092688/wcf-wshttpbinding-soap-security-negotiation-failed .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, January 7, 2014 2:33 AM
    Moderator