开发者

Could not find a base address that matches scheme HTTPS error in IIS-hosted WCF

I almost have everything set up to use my WCF service over https. IIS application is up and running, I can read the svc and wsdl at localhost. So I went back to Visual Studio and tried to write a Client that can call the service. When adding the ServiceReference I get the following error:

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

I've tried with the built-in development server and with IIS Express also. They both gave the same err开发者_运维技巧or.

Here's my web.config:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="TransportSecurity">
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SmartCook2.Server.ISmartCookServiceBehavior">
          <serviceMetadata httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
      <service behaviorConfiguration="SmartCook2.Server.ISmartCookServiceBehavior" 
        name="SmartCook2.Server.SmartCookService">
        <endpoint address="https://localhost:6344/SmartCookService.svc" 
          binding="wsHttpBinding" bindingConfiguration="TransportSecurity" 
          contract="SmartCook2.Server.ISmartCookService" />
        <endpoint address="mex" binding="mexHttpsBinding" 
          contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

What am I doing wrong?


It seems VS didn't discover the address right, since it left out the application part. So the correct address for the service reference is :

https://localhost/IISHostedSmartCook/SmartCookService.svc

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜