我有一个返回 JSON 的 WCF 服务器工作正常。 直到我通过 SSL 访问该页面(已安装证书) 我有以下配置
<system.serviceModel>
<services>
<service name="Analytics">
<endpoint name="jsonEP"
address=""
binding="webHttpBinding"
behaviorConfiguration="json"
contract="IAnalytics"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="json">
<webHttp faultExceptionEnabled="true" helpEnabled="true" />
</behavior>
</endpointBehaviors>
</behaviors>
我需要更改什么才能使我的服务启用 SSL?
我使用 https://mysite/Service/Analytics.svc 访问入口页面 但消息给出 svcutil.exe http://机器名/Service/Analytics.svc?wsdl
什么时候应该是 http://mysite/Service/Analytics.svc?wsdl
还有任何获取请求失败 前任: http://mysite/Service/Analytics.svc/MyURITemplate/Id/1
谢谢。
最佳答案
您需要定义一个绑定(bind)元素并将安全设置为传输。
查看示例 here .
关于.net - WCF JSON SSL 配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5588254/