none
Net.Tcp port 809 connectivity issues RRS feed

  • Question

  • Hi,

    We have two services deployed on IIS. Both the services are communicated through Net.Tcp protocol. One of the service is deployed with Port 808 and I'm able to access this service. The other one is a new service and we had to port it on 809. I'm unable to access the service. When I try to access the service in the server using WCF test client it works as expected, but out of the server the service is not accessible. Below is the error message 

    In the error, it seems service is still looking at 808 port when accessed out of the server. But in the server it is able to identify the port.

    TCP error code 10061: No connection could be made because the target machine actively refused it xxx.xx.xx.xxx:808.     No connection could be made because the target machine actively refused it xxx.xx.xx.xxx:808

    Error: Cannot obtain Metadata from net.tcp://services.com/DataAccessor.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: net.tcp://services.com/DataAccessor.svc    Metadata contains a reference that cannot be resolved: 'net.tcp://services.com/DataAccessor.svc'.    Could not connect to net.tcp://services.com/DataAccessor.svc. The connection attempt lasted for a time span of 00:00:01.1153465. TCP error code 10061: No connection could be made because the target machine actively refused it xxx.xx.xx.xxx:808.     No connection could be made because the target machine actively refused it xxx.xx.xx.xxx:808

    Please review this and guide me.

    Thanks in advance.



    Sandeep

    Friday, August 25, 2017 5:00 PM

All replies

  • Hello Sandeep, 

    Have you checked windows firewall to see if the ports are open.


    Cheers, Jeff

    Saturday, August 26, 2017 12:44 AM
  • Hi Sandeep,

    >> In the error, it seems service is still looking at 808 port when accessed out of the server. But in the server it is able to identify the port

    According the error message, I agree with you, it still connect through 808. Could you share us how did you connect the server? What is the URL did you use?

    In my option, for tcp, the default port is 808, and your error message indicates that you did not specify the port in the URL, I suggest you make a test with below URL.

    net.tcp://services.com:809/DataAccessor.svc

    If you got the error refused on 809, I suggest you disable firewall and try again.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, August 28, 2017 2:07 AM
  • Yes, the ports are open.

    Sandeep

    Tuesday, August 29, 2017 4:07 PM
  • I tried specifying the port number as you suggested in the URL (net.tcp://services.com:809/DataAccessor.svc) but didn't work.

    Thanks for the suggestion.


    Sandeep

    Tuesday, August 29, 2017 4:08 PM
  • Hi Sandeep,

    >> (net.tcp://services.com:809/DataAccessor.svc) but didn't work

    What is the error while using this address?

    Could you share us the detail steps to create such service and how to host on IIS with 809 port? We will try to reproduce your issue per to your description.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 30, 2017 2:28 AM
  • Hi,

    Sorry for the late response.

    I have created two WCF services with same signatures. One of the service is ported on 808 and the other on 809. I'm able to access both the services, I tested it using the WCFTestClient in the local environment.

    We have similar kind of configuration on the production server, but the production server has additional firewall setup. My support team confirmed that the 808, 809 ports are opened for the firewall. We are able to access the service deployed on 808 port but not able to access the service deployed on 809 port.

    Attaching the projects, iis configuration, wcftestclient project. Please review the applications and guide me.

    namespace NetTcpServicePort808
    {
        // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
        // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
        public class DataAccessor : IDataAccessor
        {
            public string GetDatabaseConnectionString()
            {
                return "Connection String: 808 Port";
            }
        }
    }
    
    namespace NetTcpServicePort808
    {
        // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
        // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
        public class DataAccessor : IDataAccessor
        {
            public string GetDatabaseConnectionString()
            {
                return "Connection String: 808 Port";
            }
        }
    }
    
    using System.ServiceModel;
    
    namespace NetTcpServicePort809
    {
        [ServiceContract]
        interface IDataAccessor
        {
            [OperationContract]
            string GetDatabaseConnectionString();
        }
    }
    
    namespace NetTcpServicePort809
    {
        // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.
        // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging.
        public class DataAccessor : IDataAccessor
        {
            public string GetDatabaseConnectionString()
            {
                return "Connection String: 809 Port";
            }
        }
    }
    
    <?xml version="1.0"?>
    <configuration>
    
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" targetFramework="4.5.2" />
        <httpRuntime targetFramework="4.5.2"/>
      </system.web>
      <system.serviceModel>
        <bindings>
          <customBinding>
            <binding name="netTcp" closeTimeout="04:01:00" openTimeout="04:01:00" receiveTimeout="04:01:00" sendTimeout="04:01:00">
              <binaryMessageEncoding>
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
              </binaryMessageEncoding>
              <tcpTransport maxReceivedMessageSize="2147483647" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" listenBacklog="200">
                <connectionPoolSettings maxOutboundConnectionsPerEndpoint="8000"/>
              </tcpTransport>
            </binding>
          </customBinding>
        </bindings>
        <services>
          <!--/////////////////////////////////////////////////////////////////////////////////////////////////-->
          <!--Data Accessor-->
          <!--/////////////////////////////////////////////////////////////////////////////////////////////////-->
          <service name="NetTcpServicePort809.DataAccessor">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8080/DataAccessor"/>
              </baseAddresses>
            </host>
            <endpoint address="" binding="customBinding" contract="NetTcpServicePort809.IDataAccessor" bindingConfiguration="netTcp"/>
            <endpoint address="mex" binding="customBinding" contract="IMetadataExchange" bindingConfiguration="netTcp" listenUriMode="Explicit"/>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>    
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true"/>
      </system.webServer>
    
    </configuration>
    


    Thanks,

    Sandeep


    Sandeep

    Thursday, September 7, 2017 11:49 PM
  • Hi Sandeep,

    >> We are able to access the service deployed on 808 port but not able to access the service deployed on 809 port.

    To check whether it is related with firewall, I suggest you access your service on the production server instead of you own machine.

    >> Attaching the projects, iis configuration, wcftestclient project. Please review the applications and guide me.

    For these settings, it works on local, right? I suggest you try to publish them to production server to check whether it will be accessed.

    In general, the error message is caused by firewall, could your support team share you a screen shot about firewall setting like Protocols and Ports which enables 809 port?

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 8, 2017 3:06 AM