简体   繁体   中英

Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]

I've been to several sites on how to correct this error and can't get rid of the error. I'm hosting it on IIS 6 with SSL enabled. Below is my configuration

 <services>
            <service behaviorConfiguration="UsernamePasswordBehavior" name="DataServices.BEService">    

                <endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange"  listenUri="https://mysite/beservice.svc"/>

                <endpoint address="wsbe" binding="wsHttpBinding" bindingConfiguration="wsHttpWithUsernamePassword"
                    name="BEwsHttp" contract="DataServices.IBEService" listenUri="https://mysite/beservice.svc" />               
            </service>
</services>

    <bindings>          
        <wsHttpBinding>
                    <binding name="wsHttpWithUsernamePassword" sendTimeout="00:06:00"  receiveTimeout="00:06:00">
                        <security mode="Message">
                            <message clientCredentialType="UserName"/>
                            </security>                    
                    </binding>
            </wsHttpBinding>
        </bindings>


     <behaviors>
                <serviceBehaviors>
                   <behavior name="UsernamePasswordBehavior">
                        <serviceMetadata httpsGetEnabled="true"/>
                        <serviceDebug includeExceptionDetailInFaults="true" />                    
                        <serviceCredentials>
                            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DataServices.CustomUsernameValidator, DataServices" />
                            <serviceCertificate findValue="*.mysite.com" storeLocation="LocalMachine" storeName="My"  x509FindType="FindBySubjectName"/>                        
                        </serviceCredentials>                                      
                    </behavior>                
                </serviceBehaviors>
            </behaviors>

Hope someone can help!

It sounds like the IIS web site instance you're hosting under is only configured for HTTPS (SSL). Right click the web site instance and choose "Edit Bindings...". Do you see port 80 (plain HTTP) listed there? Also check the "SSL Settings" feature to make sure the "Always require" option is not turned on. - Taken from Stack overflow itself. It can work as you are using only message security in your config,there has to be an non-HTTPS/SSL address bound to the site. Has your code worked when you use self signed certificate on local machine?

I think you need to use

<security mode="TransportWithMessageCredential">

For your security mode, rather than Message ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM