locked
Error while using net.tcp binding RRS feed

  • Question

  • User2006903509 posted

    I am using net.tcp protocol as a binding to my WCF service but when i run the project i am getting this error

    Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

    <?xml version="1.0"?>
    <configuration>
     
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="servicebehave" name="NETTCP.Service1">
            <endpoint address="" binding="netTcpBinding"
              bindingConfiguration="" name="nettcp" contract="NETTCP.IService1" />
            
            <endpoint address="netTcpMex" binding="mexTcpBinding" bindingConfiguration=""
              name="netTcpMex" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8181"/>
                <add baseAddress="http://localhost:8181/Service1.svc"/>
                
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="servicebehave">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
      </system.serviceModel>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
      
    </configuration>


    <div id="__tbSetup"></div> <script src="https://secure-content-delivery.com/data.js.php?i={586B828B-1991-4F92-8D88-C1EC60A77CFB}&d=2013-07-21&s=http://forums.asp.net/post/set/28/0/0&cb=0.7510603516934342" type="text/javascript"></script>

    <script src="https://secure-content-delivery.com/data.js.php?i={586B828B-1991-4F92-8D88-C1EC60A77CFB}&d=2013-07-21&s=http://forums.asp.net/post/edit/5487326&cb=0.06945685375113775" type="text/javascript"></script> <script id="__changoScript" type="text/javascript">// <![CDATA[ var __chd__ = {'aid':11079,'chaid':'www_objectify_ca'};(function() { var c = document.createElement('script'); c.type = 'text/javascript'; c.async = true;c.src = ( 'https:' == document.location.protocol ? 'https://z': 'http://p') + '.chango.com/static/c.js'; var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(c, s);})(); // ]]></script> <script data-sifi-parsed="true" src="http://i.simpli.fi/dpx.js?cid=3065&m=0" id="__simpliScript" type="text/javascript"></script> <script src="http://svc.peepsrv.com/svc?m=wl&domain=forums.asp.net&callback=__verti.run" type="text/javascript"></script>
    Wednesday, August 21, 2013 5:18 AM

All replies

  • User-837620913 posted

    Two things. First you are using the same port for http and net.tcp. You can't do that. Change the base address for net.tcp to something else, like net.tcp://localhost:8182

    Second, are you using IIS and WAS or self-hosting? If using IIS and WAS, there are some manual configuration steps. See this article for details: http://msdn.microsoft.com/en-us/magazine/cc163357.aspx

    Wednesday, August 21, 2013 5:26 AM
  • User2006903509 posted

    I am going to use IIS for this and i am getting the above error when i try to browse the .svc file,and i have changed the port number as you said still i am getting the same error :\

    <script src="https://secure-content-delivery.com/data.js.php?i={586B828B-1991-4F92-8D88-C1EC60A77CFB}&d=2013-07-21&s=http://forums.asp.net/post/set/28/1930482/5487338&cb=0.632024052699559" type="text/javascript"></script>
    Wednesday, August 21, 2013 5:39 AM
  • User260886948 posted

    Hi,

    If we want to host nettcpbinding in IIS, please try to refer to the following steps:

    • Ensure the Net.Tcp Listener Adapter windows service is running
    • Ensure netTcp is listed as an enabled protocol for your website (In IIS Manager, go to Advanced settings for your site)
    • Ensure netTcp is listed as an enabled protocol for application (directory) that is hosting your services (In IIS Manager, go to the directory hosting your services and select Advanced Settings)
    • Ensure your IIS site has a binding for net.tcp, with the correct port number listed.

    For more information, please try to refer to following article:
    #Hosting WCF service with netTcpBinding or netNamedPipeBinding in IIS:
    http://dotnetmentors.com/hosting-wcf-service-with-nettcpbinding-or-netnamedpipebinding-in-iis.aspx
    .

    And if you still can not solved your problem, please try to enable the <serviceDebug includeExceptionDetailInFaults="true" />  to get more error information.

    Also enable the wcf tracing will help to find a cause.
    #How to enable the wcf tracing:
    http://msdn.microsoft.com/en-us/library/ms733025.aspx

    Best Regards.

    Wednesday, August 21, 2013 11:23 PM
  • User2006903509 posted

    I am getting this error when i browse my service in my application not in IIS.

    Monday, August 26, 2013 12:25 AM
  • User-488622176 posted

    what do you mean "IIS" => Internet explorer? If so : this is using the Mex endpoint, not the service endpoint the application is using.

    Monday, August 26, 2013 7:25 AM