Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Contract requires Duplex, but Binding 'CustomBinding' doesn't support it or isn't configured properly to support it


What I have tried:

I got above error while accessing the WCF service using proxy, any one can suggest what the error or cofiguration required in my web.config fileor something else be needed.

below client configuration code snippet.


<pre><system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ILoginServer" />
      </basicHttpBinding>
      <customBinding>
        <binding name="PollingDuplexHttpBinding_IDialServer">
          <binaryMessageEncoding />
          <httpTransport />
        </binding>
      </customBinding>
      <netTcpBinding>
        <binding name="NetTcpBinding_IDialServer">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>

    <client>
      <endpoint address="http://XXX.XXX.XX.XX:8086/LoginServer" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_ILoginServer" contract="LoginServerRef.ILoginServer"
        name="BasicHttpBinding_ILoginServer" />
      <endpoint address="http://XXX.XXX.XX.XX:8084/DialServer" binding="customBinding"
        bindingConfiguration="PollingDuplexHttpBinding_IDialServer"
        contract="DialServerRef.IDialServer" name="PollingDuplexHttpBinding_IDialServer" />
      <endpoint address="net.tcp://localhost:8085/DialServer" binding="netTcpBinding"
        bindingConfiguration="NetTcpBinding_IDialServer" contract="DialServerRef.IDialServer"
        name="NetTcpBinding_IDialServer" />    
    </client>
  </system.serviceModel>


Below code for accessing methods.

public static IDialServer Proxy
{
get
{
var ctx = new InstanceContext(new TestServiceCallBack());
return new DuplexChannelFactory<idialserver>
(ctx, "WSDualHttpBinding_INotificationServices").CreateChannel();
}
}


static void Main(string[] args)
{
// Proxy.RegisterAgent(5,1)
Console.ReadLine();
}

public class TestServiceCallBack : IDialServer
{
}
Please suggest if i am doing wrong or something else.
Posted
Comments
F-ES Sitecore 11-Jan-17 9:40am    
Have you googled the error message? Followed any of the suggestions? Have anything you've tried that didn't fix the problem so people don't suggest the same things?
Vikash Kumar Raja 11-Jan-17 9:47am    
yes i got the faulted state service.

but i didn't get any proper solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900