首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将wcf http web服务转换为https

如何将wcf http web服务转换为https
EN

Stack Overflow用户
提问于 2014-03-13 22:40:30
回答 1查看 2.2K关注 0票数 0

我已经用WCF构建了一个基于http的web服务应用程序,一切正常。现在,我尝试将其转换为在https上运行,但我无法使其正常工作。我只收到"Bad Request“。当前,此web服务在IIS7.5和.NET 4.5上运行。任何人都知道我应该做什么来将它从http转换为https,以及我应该在客户端进行哪些更改,以便能够请求https web服务而不是http。

Thx在进阶!

EN

回答 1

Stack Overflow用户

发布于 2014-06-09 14:36:23

对于服务配置,请使用以下内容

代码语言:javascript
复制
<services>
<service behaviorConfiguration="webServiceClientBehavior" name="My.Service.ServiceName">
        <endpoint address="http://localhost/WCFClient"  binding="basicHttpBinding" bindingConfiguration="secureBinding" contract="My.Service.IServiceName"/>
</service>

要使用以下绑定配置,请使用以下内容

代码语言:javascript
复制
<bindings>
  <basicHttpBinding>
    <binding name="secureBinding">
      <security mode="Transport" />
    </binding>
  </basicHttpBinding>

对于行为配置,请使用下面的内容

代码语言:javascript
复制
 <serviceBehaviors>
   <behavior name="webServiceClientBehavior">
      <!--For MetaData-->
      <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost/WCFClientMD"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22382057

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档