How to create a WCF service without the need of a Service Certificate?
I'm trying to create a basic webservice with WCF. It's small, and will only be used internally between two servers, so there is no need for security of any kind. Unfortunately WCF demands a certificate:
The service certificate is not provided. Specify a service certificate in ServiceCredentials.
I don't want to configure a certificate anywhere. Certificates are great for security, but also invariably come packaged with two days worth of headaches until you get them right just so, and I don't want that right now.
I'm googling all around but开发者_开发百科 cannot find an answer anywhere - can you disable this feature of WCF?
Added: Almost forgot, here's my bindings 'n stuff, just in case they're useful:
<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>
Added 2: Oh, right, VS2010, .NET 4.0. Windows 7, integrated VS webserver.
What does your web.config
bindings section look like? Using basicHttpBinding
with clientCredentialType="None"
should as far as I know run without any certificates. Ie:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IServiceWS">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
....
If you don't want to use security why are you using WsFedarationBinding
which is designed for federated security? Use BasicHttpBinding
instead. It doesn't use any security by default or if all communication will be performed in the same windows domain with users and service using domain accounts you can use WsHttpBinding
with default configuration - it will use Windows security without need for any certificate.
You are using wsFederationHttpBinding
in the service. If it is not important to push in so much of security, you could have gone for simple HTTP binding called basicHTTP
binding. Consider appropriate binding for the service.
精彩评论