Silverlight で正常に動作する wcf デュプレックス サービスがあります。しかし、Windowsコンソールアプリケーションで消費したいのと同じサービスです。次のように私のコード:
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 は「空」です:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
</configuration>
それは私にエラーを与えます:
バインディング 'CustomBinding' は、チャネル タイプの作成をサポートしていません。これは多くの場合、CustomBinding の BindingElements が正しくスタックされていないか、間違った順序でスタックされていることを示しています。スタックの一番下にトランスポートが必要です。BindingElements の推奨される順序は、TransactionFlow、ReliableSession、Security、CompositeDuplex、OneWay、StreamSecurity、MessageEncoding、[...] です。
私たちを手伝ってくれますか?前もって感謝します。