Hello,
I follow the following documents and have quick tests in my side. I can
consume the WCF service that hosted in a remote Windows Service.
(http)
http://msdn.microsoft.com/en-us/library/ms733069.aspx
(tcp)
http://msdn.microsoft.com/en-us/library/cc949080.aspx
I think we need to check the following three points,
1. Make sure our Windows Service is started
2. Make sure we have changed the client configuration to align the server
address.
3. Make sure we specify the client credential like the following codes,
-----------Client Configurations-----
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<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="Windows"
protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://YOURSERVERNAME:8523/Service1"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_IService1"
contract="ServiceReference1.IService1"
name="NetTcpBinding_IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
-----------Client Codes----------------
ServiceReference1.Service1Client client = new
ConsoleApplication1.ServiceReference1.Service1Client();
client.ClientCredentials.Windows.ClientCredential.UserName =
"abc";
client.ClientCredentials.Windows.ClientCredential.Password =
"abc";
Console.WriteLine(client.GetData(23));
Best regards,
Colbert Zhou ((E-Mail Removed), remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).