【发布时间】:2015-08-11 17:41:48
【问题描述】:
我知道过去曾有过这个问题的答案,但是在经历了很多之后我仍然遇到问题,所以我希望有人可以查看这个配置并告诉我它的去向错了……
这是我正在部署的自托管 rest WCF 服务的配置:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<services>
<service name="SampleService.SampleService" behaviorConfiguration="ServiceBehavior" >
<endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttpTransportSecurity" behaviorConfiguration="web" contract="SampleService.ISampleService"/>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="webHttpTransportSecurity">
<security mode="Transport" >
<transport clientCredentialType="None" proxyCredentialType="None" />
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
</configuration>
服务器上的错误表明该服务想要使用 http 而不是 https,我终生无法弄清楚配置有什么问题。在一天中的大部分时间里,我已经完成了它。这是一个相对微不足道的小服务。
【问题讨论】:
-
为什么将
clientCredentialType和proxyCredentialType设置为"None" on the` 元素?这不是违背了目的吗? -
无 指定匿名身份验证。我不想让用户提示输入用户名/密码。
标签: web-services wcf azure wcf-rest