net.TCP
-
Thursday, May 03, 2012 6:53 AM
Hi,
I took the duplex calculature example (using wsDualHTTPBinding), which run and works, and change it to netTcpBinding, run the service from my vs (I see it added to IIS), I had some error, such as unsupport protocol (solved by adding net.tcp to supported protocol of the application in IIS advanced setting).
Now the service run, but when run the client, I got the following error:
Could not connect to net.tcp://localhost:4502/TCPService/. The connection attempt lasted for a time span of 00:00:02.0541126. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:4502.
I tried to add rule to my inbound/outbound firewall, but not success so I remove it.
Can help?
Here my web.config:
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.serviceModel> <services> <service name="DuplexService.CalculatorService" > <!-- Service Endpoints --> <endpoint name ="NetTcpEndPoint" address="" binding="netTcpBinding" bindingConfiguration ="duplex" contract="DuplexService.ICalculatorDuplex"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint name ="NetTcpMetadataPoint" address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress = "net.tcp://localhost:4502/TCPService/" /> </baseAddresses> </host> </service> </services> <bindings > <netTcpBinding > <binding name="duplex" portSharingEnabled="false"> <security mode ="None" /> </binding> </netTcpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="true"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="false"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
here my app.config:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="WSDualHttpBinding_ICalculatorDuplex" 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" portSharingEnabled ="false" > <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="None" /> </binding> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://localhost:4502/TCPService/" binding="netTcpBinding" bindingConfiguration="WSDualHttpBinding_ICalculatorDuplex" contract="DuplexRef.ICalculatorDuplex" name="WSDualHttpBinding_ICalculatorDuplex" /> </client> </system.serviceModel> </configuration>
All Replies
-
Thursday, May 03, 2012 9:15 AMModerator
Hello, can you make sure you've installed WCF non-HTTP activation components? This Windows feature is required to make TCP work in IIS. Refer to http://msdn.microsoft.com/en-us/library/ms731053.aspx for more information. In addition, IIS usually gives your service its own base address. Usually it uses port 808 for TCP. So try to remove the baseAddress configuration, and use net.tcp://localhost:808/yourappname/yourservice.svc. You need an svc file just like when hosting HTTP services in IIS.Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.- Marked As Answer by Markos_King Thursday, May 03, 2012 11:27 AM
-
Thursday, May 03, 2012 11:30 AM
Hi, As your recomendation i changed the address and install the non http activation. it work in my localhost.
Now I moved the service to my server and try to connect from client, I got the following exception:
No DNS entries exist for host xxx.xxxx.com.
What should I do?
BTW, I removed the
<host> <baseAddresses> <add baseAddress = "net.tcp://localhost:4502/TCPService/" /> </baseAddresses> </host>
from my web.config, to work in localhost, should I return it back?
- Edited by Markos_King Thursday, May 03, 2012 11:32 AM update
-
Thursday, May 03, 2012 11:57 AM
tried to change address to IP, got an exception:
Could not connect to net.tcp://xx.xx.xx.xx:4502/netTCP_Service/CalculatorService.svc. The connection attempt lasted for a time span of 00:00:21.0395999. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:4502.
-
Friday, May 04, 2012 2:18 AMModeratorLooks like it's a DNS issue. Can you make sure you're able to connect to the host server from the client machine using the host name?
Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email. -
Friday, May 04, 2012 5:01 AM
Hi, thanks,
It works, issue was router port (not open),

