I go to https://mywebsite/MyApp/Myservice.svc and get the following error:
(The link works if I use http:// )
"The service '/MyApp/MyService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].."
EDIT: So if I change address=""
to address="https:// ..."
then I get this error instead:
"Error: The protocol 'https' is not supported..... The ChannelDispatcher at 'https://.../Annotation.svc' with contract(s) '"Annotation"' is unable to open its IChannelListener."
Here's what my Web.Config
looks like:
<services> <service behaviorConfiguration="AnnotationWCF.AnnotationBehavior" name="AnnotationWCF.Annotation"> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Annotation" contract="AnnotationWCF.Annotation" /> <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SecureTransport" contract="AnnotationWCF.Annotation" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service>
<bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Annotation" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> <binding name="SecureTransport" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <security mode="Transport"> <transport clientCredentialType="None"/> </security> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding>
You need to create the SSL certificate in IIS server. 2. In IIS, you need add https binding (SSL) and select the certificate that you created in 1 step..
WSHttpBinding(SecurityMode, Boolean) Initializes a new instance of the WSHttpBinding class with a specified type of security used by the binding and a value that indicates whether a reliable session is enabled.
I had this exact same problem. Except my solution was to add an "s" to the binding value.
Old: binding="mexHttpBinding"
New: binding="mexHttpsBinding"
web.config snippet:
<services> <service behaviorConfiguration="ServiceBehavior" name="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService"> <endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" contract="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService" /> <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> </service>
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