提供的 URI 方案“https"无效;预期'http'.参数名称:通过 [英] The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via

查看:37
本文介绍了提供的 URI 方案“https"无效;预期'http'.参数名称:通过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 basicHttpBinding 创建一个 WCF 服务,以便通过 https 使用.这是我的 web.config:

I am trying to make a WCF service over basicHttpBinding to be used over https. Here's my web.config:

<!-- language: xml -->
<service behaviorConfiguration="MyServices.PingResultServiceBehavior"
         name="MyServices.PingResultService">
    <endpoint address="" 
              binding="basicHttpBinding" 
              bindingConfiguration="defaultBasicHttpBinding"
              contract="MyServices.IPingResultService">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint>
    <endpoint address="mex" 
              binding="mexHttpBinding" 
              contract="IMetadataExchange" />
</service>
...

<bindings>
  <basicHttpBinding>
    <binding name="defaultBasicHttpBinding">
      <security mode="Transport">
        <transport clientCredentialType="None"/>
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
...
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServices.UpdateServiceBehavior">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我使用 WCFStorm 进行连接,它能够正确检索所有元数据,但是当我调用实际方法时:

I am connecting using WCFStorm which is able to retrieve all the meta data properly, but when I call the actual method I get:

提供的 URI 方案https"无效;预期'http'.范围名称:通过

The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via

推荐答案

尝试在 app.config 中添加消息凭据,例如:

Try adding message credentials on your app.config like:

<bindings> 
<basicHttpBinding> 
<binding name="defaultBasicHttpBinding"> 
  <security mode="Transport"> 
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
    <message clientCredentialType="Certificate" algorithmSuite="Default" />
  </security> 
</binding> 
</basicHttpBinding> 
</bindings> 

这篇关于提供的 URI 方案“https"无效;预期'http'.参数名称:通过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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