开发者

WCF Error - Could not find a base address that matches scheme

开发者 https://www.devze.com 2023-01-05 22:08 出处:网络
I\'m trying to get a WCF web service to work with SSL, as you can imagine it works on my machine, however when I run it on the production environments I get this instead:

I'm trying to get a WCF web service to work with SSL, as you can imagine it works on my machine, however when I run it on the production environments I get this instead:

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

Despite many hours of wrestling with this problem I still have very little idea what this error message actually means - googling for this error message finds loads of people saying that I should either specify an address in my endpoint configuration or add a base address to my service, however:

  • My service worked perfectly fine without specifying either with SSL disabled
  • In fact, my service works perfectly fine with SSL with the exact same configuration on another machine
  • Besides, I've found a post which reliably informs me that when hosting under IIS the base address is ignored anyway.

As you can probably tell, I'm currently feeling a very fustrated at my utter failure to achieve what I believed to be a relatively simple task, so:

  • What does this error message actually mean?
  • How are base addresses determined when hosting under IIS?
  • Where can I find reliable, understandable documentation about what all of my copy-pasted configuration actually means?
  • What do I need to do to get my service to actually work?

The interesting bits of my web.config are:

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
  <services>
    <service name="MyService" behaviorConfiguration="MyBehavior">
      <endpoint binding="basicHttpBinding" bindingConfiguration="SecureTransport" 
                bindingNamespace="http://MyNamespace/Service" name="Basic"
                contract="MyContract" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="MyBehavior">
        <serviceMetadata httpsGetEnabled="true"/>
        <serviceDebug includeExceptionDetailInFaults="true"/>
      </be开发者_JAVA百科havior>
    </serviceBehaviors>
  </behaviors>
  <bindings>
    <basicHttpBinding>
      <binding name="SecureTransport">
        <security mode="Transport" />
      </binding>
    </basicHttpBinding>
  </bindings>
</system.serviceModel>


One thing that is off field but can cause this message is if the SSL certificate on the server is expired or not set up correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消