-1

我有一个可以通过 http 或 https 访问的wcf 服务。它在共享主机环境中运行。

我取消了 SSL 托管。即 SSL 的私有 IP 被删除,等等。

我没有对我的配置进行任何更改。

现在,如果我只是尝试访问我的服务,例如

http://myservice.com/myservice.svc?wsdl

我收到以下错误:

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

请注意,错误消息提到了https的方案。不知道为什么。

对此有任何帮助吗?

更新配置信息:

  <baseAddressPrefixFilters>
    <add prefix="http://mysite.com/"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>
<services>
  <service behaviorConfiguration="MySiteServiceBehavior" name="MySite.MyService">
    <clear/>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MySiteBasicBinding" name="MySiteBasicEndpoint"
      contract="MySite.IMyService"/>
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="MySiteBasicSslBinding" name="MySiteBasicSslEndpoint"
      contract="MySite.IMyService"/>
    <endpoint address="json" endpointConfiguration="myJson" kind="webHttpEndpoint" binding="webHttpBinding" bindingConfiguration="MySiteBasicBinding"
      name="jsonEndpoint" contract="MySite.IMyService" behaviorConfiguration="MySite.MyServiceBehavior.json"/>
    <endpoint address="json" endpointConfiguration="myJson" kind="webHttpEndpoint" binding="webHttpBinding" bindingConfiguration="MySiteBasicSslBinding"
      name="jsonSslEndpoint" contract="MySite.IMyService" behaviorConfiguration="MySite.MyServiceBehavior.json"/>
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="http://MySite.com/MyService.svc"/>
        <add baseAddress="https://MySite.com/MyService.svc"/> **--- still have problem with this line commented out**
      </baseAddresses>
    </host>
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="MySiteBasicBinding"/>
    <binding name="MySiteBasicSslBinding">
      <security mode="Transport"/>
    </binding>
  </basicHttpBinding>
  <webHttpBinding>
    <binding name="MySiteBasicBinding"/>
    <binding name="MySiteBasicSslBinding">
      <security mode="Transport"/>
    </binding>
  </webHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="MySiteServiceBehavior">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/> **--- still have problem with httpsGetEnabled set to false**
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="MySite.MyServiceBehavior.json">
      <!--<enableWebScript/>-->
    </behavior>
  </endpointBehaviors>
</behaviors>
<standardEndpoints>
  <webHttpEndpoint>
    <standardEndpoint name="myJson" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
  </webHttpEndpoint>
</standardEndpoints>

更新

我删除了任何/所有引用,甚至与 https 远程相关并且它有效。我很惊讶这是必需的。

4

1 回答 1

1

听起来您在 serviceBehaviors 中的行为元素上仍然有 httpsGetEnabled。

于 2012-07-09T22:12:05.103 回答