1

Silverlight で正常に動作するwcf二重サービスがあります。しかし、同じサービスが Windows フォームで使用したいと考えています。それはどのように可能ですか。私のコードは次のとおりです。

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);

それは私にエラーを与えます:

バインディング 'CustomBinding' は、チャネル タイプの作成をサポートしていません。これは多くの場合、CustomBinding の BindingElements が正しくスタックされていないか、間違った順序でスタックされていることを示しています。スタックの一番下にトランスポートが必要です。BindingElements の推奨される順序は、TransactionFlow、ReliableSession、Security、CompositeDuplex、OneWay、StreamSecurity、MessageEncoding、Transpor です。

WCFWindows フォームで双方向サービスを使用する方法のサンプル コードを提供してください。

4

0 に答える 0