[英]How to convert wcf http web service to https
我已经使用WCF构建了一个基于http的Web服务应用程序,并且一切正常。 现在,我尝试将其转换为通过https运行,但无法使其正常工作。 我只收到“错误请求”。 当前,此Web服务正在IIS 7.5和.NET 4.5上运行。 任何人都知道我将如何将其从http转换为https,以及我将在客户端进行哪些更改以便能够请求https而不是http的服务。
谢谢高级!
对于服务配置,请使用此
<services>
<service behaviorConfiguration="webServiceClientBehavior" name="My.Service.ServiceName">
<endpoint address="http://localhost/WCFClient" binding="basicHttpBinding" bindingConfiguration="secureBinding" contract="My.Service.IServiceName"/>
</service>
对于绑定配置,请在下面使用
<bindings>
<basicHttpBinding>
<binding name="secureBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
对于行为配置,请在下面使用
<serviceBehaviors>
<behavior name="webServiceClientBehavior">
<!--For MetaData-->
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost/WCFClientMD"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.