# NetTcpBinding
# Tranport Security
# X509 Authentication (Smartcard)
# Hosting on an IIS 7 (Windows 2008 Server)
I have already developed a scenario with WsHttpBinding, which works very
fine !!
(Rem.: All necessary certifates are imported into the store on the server
side.
On the client I use ClientCredentials.ClientCertificate.Certificate of the
service proxy to set the client certificate. )
Unfortunately when I use NetTcpBinding I get the following error message on
my testclient (which uses the service):
"The requested upgrade is not supported by 'net.tcp://..../Service1.svc'.
This could be due to mismatched bindings (for example security enabled on
the client and not on the server)."
Has anyone an idea how to solve that problem ??
Here are my configurations:
IIS 7:
net.tcp binding, SSL and Client certificate is required
web.config:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="Simple_IIS7_WCF.Service1"
behaviorConfiguration="Simple_IIS7_WCF.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="netTcpBinding"
contract="Simple_IIS7_WCF.IService1">
</endpoint>
<endpoint address="mex" binding="mexTcpBinding"
contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8000/Service1"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Simple_IIS7_WCF.Service1Behavior">
<serviceMetadata httpsGetEnabled="true" httpGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
app.config (client):
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IService1"
closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536"
maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32"
maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"
/>
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Certificate" />
<message clientCredentialType="Certificate" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint
address="net.tcp://........:8000/Simple_IIS7_WCF/Service1.svc"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IService1"
contract="ServiceReference1.IService1"
name="NetTcpBinding_IService1">
<identity>
<servicePrincipalName value="host/......." />
</identity>
</endpoint>
</client>
</system.serviceModel>