带有WCF错误的https:“无法找到与方案https匹配的基址” [英] https with WCF error: "Could not find base address that matches scheme https"

查看:173
本文介绍了带有WCF错误的https:“无法找到与方案https匹配的基址”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



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



编辑:因此,如果我将 address =更改为 address =https:// ...然后我收到此错误:



错误:不支持协议https....... https://www./注释中的ChannelDispatcher .svc 'with contract(s)'Annotation'无法打开其IChannelListener。



这是我的 Web.Config 看起来像:

 < services> 
< service behaviorConfiguration =AnnotationWCF.AnnotationBehavior
name =AnnotationWCF.Annotation>
< endpoint address =binding =basicHttpBindingbindingConfiguration =BasicHttpBinding_Annotation
contract =AnnotationWCF.Annotation/>
< endpoint address =
binding =basicHttpBindingbindingConfiguration =SecureTransport
contract =AnnotationWCF.Annotation/>
< endpoint address =mexbinding =mexHttpBindingcontract =IMetadataExchange/>
< / service>

 <绑定> 
< basicHttpBinding>
< binding name =BasicHttpBinding_AnnotationmaxBufferSize =2147483647
maxReceivedMessageSize =2147483647>
< readerQuotas maxDepth =2147483647maxStringContentLength =2147483647
maxArrayLength =2147483647maxBytesPerRead =2147483647
maxNameTableCharCount =2147483647/>
< / binding>
< binding name =SecureTransportmaxBufferSize =2147483647
maxReceivedMessageSize =2147483647>
< security mode =Transport>
< transport clientCredentialType =None/>
< / security>
< readerQuotas maxDepth =2147483647maxStringContentLength =2147483647
maxArrayLength =2147483647maxBytesPerRead =2147483647
maxNameTableCharCount =2147483647/>
< / binding>
< / basicHttpBinding>


解决方案

原来我的问题是我在使用负载平衡器,用于处理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]... /> 


I go to https://mywebsite/MyApp/Myservice.svc and get the following error:

(The link works if I use http:// )

"The service '/MyApp/MyService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding. Registered base address schemes are [http].."

EDIT: So if I change address="" to address="https:// ..." then I get this error instead:

"Error: The protocol 'https' is not supported..... The ChannelDispatcher at 'https://.../Annotation.svc' with contract(s) '"Annotation"' is unable to open its IChannelListener."

Here's what my Web.Config looks like:

<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>

<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>

解决方案

It turned out that my problem was that I was using a load balancer to handle the SSL, which then sent it over http to the actual server, which then complained.

Description of a fix is here: http://blog.hackedbrain.com/2006/09/26/how-to-ssl-passthrough-with-wcf-or-transportwithmessagecredential-over-plain-http/

Edit: I fixed my problem, which was slightly different, after talking to microsoft support.

My silverlight app had its endpoint address in code going over https to the load balancer. The load balancer then changed the endpoint address to http and to point to the actual server that it was going to. So on each server's web config I added a listenUri for the endpoint that was http instead of https

<endpoint address="" listenUri="http://[LOAD_BALANCER_ADDRESS]" ... />

这篇关于带有WCF错误的https:“无法找到与方案https匹配的基址”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆