我正在尝试使用 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>
Run Code Online (Sandbox Code Playgroud)
添加2:哦,对了,VS2010,.NET 4.0。Windows 7,集成 VS 网络服务器。
你的web.config绑定部分是什么样的?据我所知,使用basicHttpBindingwithclientCredentialType="None"应该在没有任何证书的情况下运行。IE:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServiceWS">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
....
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2903 次 |
| 最近记录: |