找不到与绑定WebHttpBinding的端点的方案https匹配的基址。注册的基地址方案是[http]

时间:2012-06-27 08:23:32

标签: wcf

我知道他们中的很多人都犯了同样的错误。我尝试了所有可能的答案,但我仍然收到此错误。

我的服务的Web.config。

    <serviceBehaviors>
        <behavior name="AjaxServiceHttpsBehavior">
          <serviceMetadata httpsGetEnabled ="true"/>
        </behavior>
      </serviceBehaviors>
    <endpointBehaviors>
        <behavior name="AjaxServiceAspNetAjaxBehavior">
        <enableWebScript />
        </behavior>
    </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service name="AjaxService"  behaviorConfiguration="AjaxServiceHttpsBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="https://servername/websitefolder" />
          </baseAddresses>
        </host>
    <endpoint address="" behaviorConfiguration="AjaxServiceAspNetAjaxBehavior"  binding="webHttpBinding" bindingConfiguration="webHttpsBinding" contract="AjaxService" />
        </service>
    </services>
        <bindings>
   <webHttpBinding>
      <binding name="webHttpsBinding">
        <security mode="Transport"></security>
      </binding>
    </webHttpBinding>
   <basicHttpBinding>

该服务位于“https://servername/websitefolder/AjaxService.svc”,并且正确配置了ssl。

是我的基地址错了?这项服务只有一个终点。我尝试了所有可能的组合,但我仍然收到此错误。

2 个答案:

答案 0 :(得分:2)

我遇到了与wsHttpBinding相同的问题,发现根本没有我的基地址问题,但我在我的元素中定义了

 <wsHttpBinding><binding name="wsHttpBinding_Administration">
      <security mode="Message"> <!-- changed this to "message" -->
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </wsHttpBinding>

答案 1 :(得分:0)

检查IIS内部网站的绑定。应该在那里添加https绑定。