Have you ever had the issue when you get the following error:
Server Error in '/Services' Application.
Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].
Well a strange ( and annoying ) thing happened to me lately where by I had configured and tested an implementation locally and on a secondary dev machine and all was good. I had a service endpoint configured inside xml with security of TransportWithMessageCredential on a BasicHttpBinding. and I also had a programmatic endpoint added at runtime if it was running against a DEBUG build. When I committed all the work back down into trunk developers started to raise a strange issue with the above being the reason why the service could not activate. I remember having this error during development but I could not remember what i did for resolution.
I finally found how to replicate this literally turn this error ON and OFF with the flick of a switch and it is of course due to IIS. I am using IIS 6 locally so I am not sure of the exact location in IIS 7 but here is basically what the issue was.
Noticed that I have not got an entry for the SSL port. I have not added a self cert intentionally for the reason that I did not want to have to develop under HTTPS, so just to point out I am not referring to this property in the same context as a SSL Certificate. There is not SSL Certificate added to this default website.
So if you have a configuration with a binding that specifies a type of Transport security mode then you will probably experience the above error like I did, Again there is not SSL, during development the service is consumed over HTTP but I still wanted to have the configuration present as opposed to a deploy task as there may be instances where I might want to just add a self cert and debug on HTTPS. Once you add the port e.g. 443 to this property box and apply, Upon clicking the “Advanced” button you should now see an entry appear like the image below:
Just as a side point this now means that when my service activates and more specifically inside the ServiceHostFactory, 2 default base addresses get passed in being HTTP and HTTPS as opposed to simply the HTTP base address.
I hope this is of some use to people and saves them the headache that it gave me. Ahh the constant learning curve of the programming industry,
Cheers,
Andrew