views:

333

answers:

0

I have a wcf duplex service with work fine in silverlight. but the same service want to consume in windows forms. how it possible. my code as folow:-

EndpointAddress address;
            address = new EndpointAddress("http://server08:2508/JakayaChatService");
            CustomBinding binding = new CustomBinding(
                new PollingDuplexBindingElement(),
              new BinaryMessageEncodingBindingElement(),
              new HttpTransportBindingElement());

            WindowsFormsApplication2.DuplexService.JakayaChatServiceClient c = new WindowsFormsApplication2.DuplexService.JakayaChatServiceClient(new InstanceContext(new myClass()),binding,address);

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, Transpor

please provide me a sample code how to consume wcf duplex service in windows forms. Thanks