カーストWCFファシリティを自分のサービスとうまく統合しました。次に、BasicHttpBindingに基づいてHTTPS通信を構成しようとします。
次のブログ投稿によると、これは大したことではないはずです:http: //blog.adnanmasood.com/2008/07/16/https-with-basichttpbinding-note-to-self/
これが私の設定です。クライアント側では、次のコードを使用してWindsorコンテナーを構成します。
BasicHttpBinding clientBinding = new BasicHttpBinding();
// These two lines are the only thing I changed here to allow HTTPS
clientBinding.Security.Mode = BasicHttpSecurityMode.Transport;
clientBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
// Everything else worked well with HTTP
clientBinding.MaxReceivedMessageSize = 163840;
clientBinding.MaxBufferSize = (int)clientBinding.MaxReceivedMessageSize;
container = new WindsorContainer();
container.AddFacility<WcfFacility>();
container.Register(
Component.For<IClientService>()
.AsWcfClient(new DefaultClientModel {
Endpoint = WcfEndpoint.BoundTo(clientBinding)
.At(configuration.Get(CFGKEY_SERVICE_CLIENT))
})
);
それ以外に、クライアント側の構成はありません。これは、HTTP通信を使用してうまく機能しました。
サーバー側は、Web.config内で次の構成を取得しました。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
https://を介して接続しようとすると、次の例外が発生します。
System.ServiceModel.EndpointNotFoundException:メッセージを受け入れることができるhttps://myuri.com/Services/Client.svcでリッスンしているエンドポイントがありませんでした。
何が欠けているのかアイデアはありますか?前もって感謝します。