简体   繁体   中英

Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding

I am trying to create a WCF Service with only Transport Security so I do not need SSL.

I keep geting this error message when I run it:

Could not find a base address that matches scheme https for the endpoint with binding 
BasicHttpBinding.

My Web.config file looks like this:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>      
        <binding name="Binding1">
          <security mode="Transport">
            <transport clientCredentialType="Basic"></transport>
          </security>
        </binding>      
      </basicHttpBinding>

    </bindings>
    <services>
      <service behaviorConfiguration="ServiceBehavior" name="AutoSenderWCFService.AutoSenderService">        
        <endpoint binding="basicHttpBinding"  bindingConfiguration="Binding1"
          contract="AutoSenderWCFService.IService1" />        
      </service>
    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceCredentials>

            <userNameAuthentication userNamePasswordValidationMode="Custom"
              customUserNamePasswordValidatorType="AutoSenderWCFService.MyValidator, AutoSenderWCFService"/>

          </serviceCredentials>

          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

Transport security means securing your channel with SSL and hence you would need a certificate.

If you dont want to use SSL but want to pass username password over the channel then you can use ClearUsernameBinding that sends the username password over the channel in clear text.

NOTE: Make sure you use this only when you are confident that you client and server channel is secure like behind a firewall that provides security.

I cant see any address in there - add an address to your endpoint and should be ok

so:

<endpoint binding="basicHttpBinding" address="https://address" bindingConfiguration="Binding1" 
          contract="AutoSenderWCFService.IService1" />  

In my case I was trying to test a wcf web service setup on a testing server without ssl. I changed the security mode to none and it started working for me.

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