POST Method in wcf Rest Service

后端 未结 1 932
广开言路
广开言路 2021-01-26 05:42

i am getting the same error:

protected void Button1_Click(object sender, EventArgs e)
            {
            BasicHttpBinding binding = new BasicHttpBinding()         


        
相关标签:
1条回答
  • 2021-01-26 06:03

    You are using the wrong WCF binding in you code. The config XML shows the WCF service using the WebHttpBinding. Refactor your client creation code to something like:

    WebHttpBinding binding = new WebHttpBinding();
    // The rest of the configuration
    

    Don't know if all the properties you are setting will be valid for this binding but the compiler will know :)

    0 讨论(0)
提交回复
热议问题