相关文章推荐
气势凌人的拐杖  ·  SQL character-阿里云·  1 月前    · 
听话的香菜  ·  【深度学习目标检测】_深度学习目标检测问题与 ...·  3 周前    · 
大方的铁板烧  ·  【HPPTDNS】WebView为什么只设置 ...·  2 周前    · 
个性的小刀  ·  RuoYi-Vue-Plus 发布 ...·  2 周前    · 
爱运动的奔马  ·  在龙岗诞生的大语言模型:凤凰GPT | ...·  14 小时前    · 
痴情的可乐  ·  C#实体框架:关键字不支持:‘端口’-腾讯云 ...·  11 月前    · 
爱笑的草稿本  ·  基于Tensorflow2.x ...·  1 年前    · 
酒量小的热带鱼  ·  关于mysql8.0版本和PHP7不兼容的问 ...·  1 年前    · 
幸福的豆腐  ·  Python使用Redis:五类数据类型操作 ...·  1 年前    · 
才高八斗的椅子  ·  Unity ...·  1 年前    · 
Code  ›  提供的URI方案'https‘无效;预期的'http’。参数名称: via开发者社区
uri https
https://cloud.tencent.com/developer/ask/sof/108937683
曾经爱过的墨镜
1 年前
首页
学习
活动
专区
工具
TVP 最新优惠活动
返回腾讯云官网
提问

问 提供的URI方案'https‘无效;预期的'http’。参数名称: via

Stack Overflow用户
提问于 2010-03-12 20:53:00
EN

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

代码语言: javascript
复制
<!-- 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>
...
代码语言: javascript
复制
<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进行连接,它能够正确检索所有元数据,但是当我调用实际方法时,我得到:

提供的URI方案'https‘无效;预期的'http’。参数名称: via

17 429.3K 0 票数 322
EN
c#
wcf
https

回答 17

Stack Overflow用户

发布于 2010-03-15 03:14:08

尝试在您的app.config上添加消息凭据如下:

代码语言: javascript
复制
<bindings> 
<basicHttpBinding> 
<binding name="defaultBasicHttpBinding"> 
  <security mode="Transport"> 
    <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
    <message clientCredentialType="Certificate" algorithmSuite="Default" />
  </security> 
</binding> 
</basicHttpBinding> 
</bindings> 
票数 271
EN

Stack Overflow用户

发布于 2014-01-15 15:55:37

添加这个作为一个答案,就因为你不能在注释中做很多花哨的格式化。

我也有同样的问题,只是我完全用代码来创建和绑定我的web服务客户端。

原因是DLL被上传到一个系统中,禁止使用配置文件。

下面是需要更新的代码,以便通过SSL进行通信.

代码语言: javascript
复制
Public Function GetWebserviceClient() As WebWorker.workerSoapClient
    Dim binding = New BasicHttpBinding()
    binding.Name = "WebWorkerSoap"
    binding.CloseTimeout = TimeSpan.FromMinutes(1)
    binding.OpenTimeout = TimeSpan.FromMinutes(1)
    binding.ReceiveTimeout = TimeSpan.FromMinutes(10)
    binding.SendTimeout = TimeSpan.FromMinutes(1)
    '// HERE'S THE IMPORTANT BIT FOR SSL
 
推荐文章
气势凌人的拐杖  ·  SQL character-阿里云
1 月前
听话的香菜  ·  【深度学习目标检测】_深度学习目标检测问题与内容精选-阿里云
3 周前
大方的铁板烧  ·  【HPPTDNS】WebView为什么只设置拦截GET请求,不能拦截带body的POST请求?_问答-阿里云开发者社区
2 周前
个性的小刀  ·  RuoYi-Vue-Plus 发布 5.2.3 与 Cloud 2.2.2 正式版 -
2 周前
爱运动的奔马  ·  在龙岗诞生的大语言模型:凤凰GPT | 香港中文大学(深圳)数据科学学院
14 小时前
痴情的可乐  ·  C#实体框架:关键字不支持:‘端口’-腾讯云开发者社区-腾讯云
11 月前
爱笑的草稿本  ·  基于Tensorflow2.x Object Detection API构建自定义物体检测器 - 知乎
1 年前
酒量小的热带鱼  ·  关于mysql8.0版本和PHP7不兼容的问题 - youngxs - 简书
1 年前
幸福的豆腐  ·  Python使用Redis:五类数据类型操作 - 简书
1 年前
才高八斗的椅子  ·  Unity 3D触发器(Trigger)_51CTO博客_unity触发器
1 年前
今天看啥   ·   Py中国   ·   codingpro   ·   小百科   ·   link之家   ·   卧龙AI搜索
删除内容请联系邮箱 2879853325@qq.com
Code - 代码工具平台
© 2024 ~ 沪ICP备11025650号