WCF JSON SSL 配置
我有一个返回 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://machinename/Service/Analytics.svc?wsdl
时应为 http://mysite/Service/Analytics.svc?wsdl
也可以任意 Get请求失败 前任: http://mysite/Service/Analytics.svc/MyURITemplate/Id/1
谢谢。
I have a WCF server returning JSON working fine.
Until I access the page via SSL (Certificate is installed)
I have the following configuration
<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>
What do I need to change to enable my service to be SSL enabled?
I access the entry page with https://mysite/Service/Analytics.svc
but the message gives
svcutil.exe http://machinename/Service/Analytics.svc?wsdl
when it should be http://mysite/Service/Analytics.svc?wsdl
Also any Get Requests fail
ex:
http://mysite/Service/Analytics.svc/MyURITemplate/Id/1
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要定义一个绑定元素并将安全性设置为传输。
在此处查看示例。
You need to define a binding element and set the security to transport.
Have a look at a sample here.
我找到了解决方案。
我必须将 IIS SSL 设置关闭为需要 SSL 并遵循此配置。
使用 SSL 上的 JSONP 的 WCF 服务
我仍然在 Analytics 中收到错误的 URL。 svc "主页"
"svcutil.exe http://machinename/Service/Analytics.svc?wsdl ”
I found the solution.
I had to turn off IIS SSL Setting to Require SSL and follow this configuration.
WCF service with JSONP over SSL
I still get the wrong URL in the Analytics.svc "homepage"
"svcutil.exe http://machinename/Service/Analytics.svc?wsdl "