I have a wcf duplex service with work fine in silverlight. but the same service I want to consume in windows console application. My code as follow:
var context = new InstanceContext(this);
var address = new EndpointAddress("http://localhost:31881/PubSubService.svc");
var binding = new CustomBinding(
new PollingDuplexBindingElement(),
new BinaryMessageEncodingBindingElement(),
new HttpTransportBindingElement());
var client = new PubSubClient(context, binding, address);
client.Publish("topic", "content");
App.config is "empty":
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
It give me an error:
Binding 'CustomBinding' doesn't support creating any channel types. This often indicates that the BindingElements in a CustomBinding have been stacked incorrectly or in the wrong order. A Transport is required at the bottom of the stack. The recommended order for BindingElements is: TransactionFlow, ReliableSession, Security, CompositeDuplex, OneWay, StreamSecurity, MessageEncoding, [...]
Could you help me? Thanks in advance.