带有WCF错误的https:"找不到与方案https匹配的基址"

Mik*_*ord 41 https wcf

我转到https://mywebsite/MyApp/Myservice.svc并收到以下错误:

(如果我使用http://链接有效)

" 由于编译期间的异常,无法激活服务'/MyApp/MyService.svc'.例外消息是:找不到与绑定BasicHttpBinding的端点的方案https匹配的基址.注册的基址方案是[http ] .. "

编辑:所以如果我address=""改为address="https:// ..."那么我得到这个错误:

" 错误:不支持协议'https'..... '带有合同的' https://.../Annotation.svc ' 的ChannelDispatcher '"Annotation"'无法打开其IChannelListener. "

这是我的Web.Config样子:

<services>
      <service behaviorConfiguration="AnnotationWCF.AnnotationBehavior"
              name="AnnotationWCF.Annotation">
              <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Annotation"
                      contract="AnnotationWCF.Annotation" />
              <endpoint address="" 
                  binding="basicHttpBinding" bindingConfiguration="SecureTransport"
                  contract="AnnotationWCF.Annotation" />
              <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
Run Code Online (Sandbox Code Playgroud)

<bindings>
<basicHttpBinding>
    <binding name="BasicHttpBinding_Annotation" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647"
            maxNameTableCharCount="2147483647" />
    </binding>
    <binding name="SecureTransport" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647">
        <security mode="Transport">
        <transport clientCredentialType="None"/>
        </security>
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647"
            maxNameTableCharCount="2147483647" />
    </binding>
</basicHttpBinding>
Run Code Online (Sandbox Code Playgroud)

Mac*_*ver 28

我有同样的问题.除了我的解决方案是在绑定值上添加"s".

旧: binding ="mexHttpBinding"

新: 绑定="mexHttpsBinding"

web.config片段:

<services>
    <service behaviorConfiguration="ServiceBehavior" name="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService">
        <endpoint behaviorConfiguration="AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="webBinding" 
            contract="LIMS.UI.Web.WCFServices.Accessioning.QuickDataEntryService" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    </service>
Run Code Online (Sandbox Code Playgroud)


Mik*_*ord 20

事实证明,我的问题是我使用负载均衡器来处理SSL,然后通过http将其发送到实际的服务器,然后抱怨.

修复说明如下:http://blog.hackedbrain.com/2006/09/26/how-to-ssl-passthrough-with-wcf-or-transportwithmessagecredential-over-plain-http/

编辑:在与微软支持人员交谈后,我修复了我的问题,这个问题略有不同.

我的silverlight应用程序的代码中的端点地址超过https到负载均衡器.然后,负载均衡器将端点地址更改为http并指向它将要访问的实际服务器.因此,在每个服务器的Web配置中,我为端点添加了一个listenUri,它是http而不是https

<endpoint address="" listenUri="http://[LOAD_BALANCER_ADDRESS]" ... />
Run Code Online (Sandbox Code Playgroud)

  • 链接 - > http://blog.hackedbrain.com/archive/2006/09/26/5281.aspx无效. (2认同)

Sim*_*ver 8

确保为您的服务器启用了SSL!

尝试在没有该证书的本地盒子上使用HTTPS配置文件时出现此错误.我试图通过将一些绑定从HTTPS转换为HTTP来进行本地测试.我认为这样做比尝试为本地测试安装自签名证书更容易.

原来我得到了这个错误,因为我没有在我的本地IIS上启用S​​SL,即使我不打算实际使用它.

HTTPS的配置中有一些东西.在IIS7中创建自签名证书允许HTTP随后工作:-)

  • 我发现确保IIS(6.0)正在侦听端口443(右键单击默认网站,属性,SSL端口,重启)就足够了.我没有创建证书. (2认同)