【发布时间】:2015-08-01 05:44:21
【问题描述】:
我正在尝试使用 WCF 创建一个基本的 Web 服务。它很小,只能在两台服务器之间内部使用,因此不需要任何类型的安全性。不幸的是,WCF 需要证书:
未提供服务证书。在 ServiceCredentials 中指定服务证书。
我不想在任何地方配置证书。证书非常适合安全性,但也总是伴随着两天的头痛,直到你把它们弄好就这样,我现在不想那样。
我到处搜索,但在任何地方都找不到答案 - 你能禁用 WCF 的这个功能吗?
补充:差点忘了,这是我的绑定的东西,以防万一它们有用:
<bindings>
<wsFederationHttpBinding>
<binding name="XXXServiceBinding" maxReceivedMessageSize="1073741824">
<readerQuotas maxStringContentLength="1073741824" maxArrayLength="2147483647"/>
</binding>
</wsFederationHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="XXXServiceBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="XXX.XXX" behaviorConfiguration="XXXServiceBehavior">
<endpoint address="xxx" contract="XXX.IXXX" binding="wsFederationHttpBinding" bindingConfiguration="XXXServiceBinding">
<identity>
<dns value="XXX Test Service"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
添加2:哦,对了,VS2010,.NET 4.0。 Windows 7,集成 VS 网络服务器。
【问题讨论】:
-
您能详细说明一下步骤吗?你用的是 Visual Studio 吗?你到底是从哪里得到这个问题的?您可以发布代码。
-
我采用了一个现有的(非常简单的)WCF web 服务,并从中删除了所有内容,直到剩下一个基本骨架,我用我自己的 web 服务填充了它。现在它包含一个服务接口、一个实现该接口的类、几个帮助程序类(非 WCF 相关)和 web.config。这就是 web.config 中的所有内容,除了一些不相关的 appSettings。
-
所以你有答案了。所有的答案都指向同一个。绑定不合适。
标签: wcf wcf-security