I have configured my WCF services to work with SSL but it works ONLY if the HTTP binding exists in the IIS Web Site. When the HTTP binding not exists and exists only HTTPS binding I get the following error:
The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address.
How can I resolve this issue?
Thanks.
There are three types of hosting environments for WCF services: IIS, WAS, and self-hosting. The term “self-hosting” refers to any application that provides its own code to initialize the hosting environment. This includes console, Windows Forms, WPF, and managed Windows services.
Bindings are objects that are used to specify the communication details that are required to connect to the endpoint of a Windows Communication Foundation (WCF) service. Each endpoint in a WCF service requires a binding to be well-specified.
This feature is only available to WCF services that are hosted under IIS. This feature is not enabled by default. To enable it you must add the multipleSiteBindingsEnabled attribute to the < serviceHostingEnvironment > element in your Web. config file and set it to true , as shown in the following example.
Modify your configuration this way:
<behaviors>
<serviceBehaviors>
<behavior> <!-- behavior can have name (must have name in WCF 3.x) -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
you need to use mexHTTPSBinding unstead of mexHTTPBinding
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With