tags:

views:

19941

answers:

4

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>
+1  A: 

I think you are trying to configure your service in a similar way to the following config. There is more information here: Specify a Service with Two Endpoints Using Different Binding Values. Also, other than for development, it's probably not a good idea to have both HTTP & HTTPS endpoints to the same service. It kinda defeats the purpose of HTTPS. Hope this helps!

<service type="HelloWorld, IndigoConfig, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null">
    <endpoint
        address="http://computer:8080/Hello"
        contract="HelloWorld, IndigoConfig, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
        binding="basicHttpBinding"
        bindingConfiguration="shortTimeout"
    </endpoint>
    <endpoint
        address="http://computer:8080/Hello"
        contract="HelloWorld, IndigoConfig, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
        binding="basicHttpBinding"
        bindingConfiguration="Secure"
     </endpoint>
</service>
<bindings>
    <basicHttpBinding 
        name="shortTimeout"
        timeout="00:00:00:01" 
     />
     <basicHttpBinding 
        name="Secure" />
        <Security mode="Transport" />
</bindings>
Sixto Saez
that looks like a typo in the MSDN. Shouldn't the second basicHttpBinding be closed AFTER the Security mode="Transport" ?also interesting that the secure address starts with http, not https.
Mike Blandford
+3  A: 

It turned out that my problem was that I was using a load balancer to handle the SSL, which then sent it over http to the actual server, which then complained.

Description of a fix is here: http://blog.hackedbrain.com/archive/2006/09/26/5281.aspx

Edit: I fixed my problem, which was slightly different, after talking to microsoft support.

My silverlight app had its endpoint address in code going over https to the load balancer. The load balancer then changed the endpoint address to http and to point to the actual server that it was going to. So on each server's web config I added a listenUri for the endpoint that was http instead of https

<endpoint address="" listenUri="http://[LOAD_BALANCER_ADDRESS]" ... />
Mike Blandford
A: 

Mike,

We use a load balancer with an SSL accelerator internally as well and I would like to know more about your solution if you can share.

Thanks, Doug

Doug Lott
A: 

Make sure SSL is enabled for your server!

I got this error when trying to use a HTTPS configuration file on my local box which doesn't have that certificate. I was trying to do local testing - by converting some of the bindings from HTTPS to HTTP. I thought it would be easier to do this than try to install a self signed certificate for local testing.

Turned out I was getting this error becasue I didn't have SSL enabled on my local IIS even though I wasn't intending on actually using it.

There was something in the configuration for HTTPS. Creating a self signed cert in IIS7 allowed HTTP to then work :-)

Simon_Weaver