Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WCF Service with NetTcpBinding and X509 authentication

769 views
Skip to first unread message

Kottan1970

unread,
Mar 26, 2009, 6:11:03 PM3/26/09
to
I want to implement a WCF Service which should fullfill the following
conditions:

# 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>

shamed...@gmail.com

unread,
Aug 4, 2012, 7:29:03 AM8/4/12
to
hello my dear friend

if you want to use NetTcpBinding in IIS7 ,you must use WAS (windows activation service) and add NetTcpPort to IIS.
0 new messages