我已经用WCF构建了一个基于http的web服务应用程序,一切正常。现在,我尝试将其转换为在https上运行,但我无法使其正常工作。我只收到"Bad Request“。当前,此web服务在IIS7.5和.NET 4.5上运行。任何人都知道我应该做什么来将它从http转换为https,以及我应该在客户端进行哪些更改,以便能够请求https web服务而不是http。
Thx在进阶!
发布于 2014-06-09 14:36:23
对于服务配置,请使用以下内容
<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>
https://stackoverflow.com/questions/22382057
复制相似问题