locked
The protocol 'net.tcp' is not supported issue regarding WCF RRS feed

  • Question

  • User88744855 posted

    first i create a WCF service application where svc file is created. then i write my small service related code. when i hit F5 then wcf test client appear fine and when i select svc file and select view in browser option then everything works fine. initially i have only one endpoint in config file...that is wsDualHttpBinding then everything working fine.

    the moment i add another endpoint called netTcpBinding then problem start. after adding netTcpBinding endpoint in config file and when i try to browse svc file again in browser then i got error message called The protocol 'net.tcp' is not supported and when i hit F5 then wcf test client show error message called ** Cannot obtain Metadata from http://localhost:30996/ChatService.svc**

    i just do not understand why it happens when i add netTcpBinding. onething i like to say that i have not hosted my service anywhere. i just create WCF service application and add all the entries in web.config file and just press F5. is this the reason i am getting error because i have not hosted my services anywhere?

    so here is my config details as follows

    <?xml version="1.0"?>
    <configuration>

        <system.web>
            <compilation debug="true" targetFramework="4.0" />
        </system.web>

      <system.serviceModel>
        <services>
          <service name="BBAChatService.ChatService" behaviorConfiguration="BBAChatService.ChatServiceBehavior" >
            <host>
              <baseAddresses>
                <add baseAddress ="http://localhost:30996/ChatService.svc/"/>
                <add baseAddress ="net.tcp://localhost:30997/ChatService/"/>
              </baseAddresses>
            </host>

            <endpoint name="dual_bind"
                      address="dual"
                      binding="wsDualHttpBinding"
                      bindingConfiguration="WSDualHttpBinding_IChatService"
                      contract="BBAChatService.IChatService">
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

            <endpoint name="tcp_bind"
                  address="net.tcp://localhost:30997/ChatService"
                  binding="netTcpBinding"
                  bindingConfiguration="tcpBinding"
                  contract="BBAChatService.IChatService">
            </endpoint>

            <endpoint address="net.tcp://localhost:30997/ChatService/mex"
                              binding="mexTcpBinding"
                              contract="IMetadataExchange"/>


          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="BBAChatService.ChatServiceBehavior">
              <!-- 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>
        <bindings>
          <netTcpBinding>
            <binding name="tcpBinding"
                             maxBufferSize="67108864"
                             maxReceivedMessageSize="67108864"
                             maxBufferPoolSize="67108864"
                             transferMode="Buffered"
                             closeTimeout="00:00:10"
                             openTimeout="00:00:10"
                             receiveTimeout="00:20:00"
                             sendTimeout="00:01:00"
                  portSharingEnabled="true"
                             maxConnections="100">
              <security mode="None">
              </security>
              <readerQuotas maxArrayLength="67108864"
                                      maxBytesPerRead="67108864"
                                      maxStringContentLength="67108864"/>
              <reliableSession enabled="true" inactivityTimeout="00:20:00"/>
            </binding>
          </netTcpBinding>
          <wsDualHttpBinding>
            <binding name="WSDualHttpBinding_IChatService"
                     closeTimeout="00:01:00"
                     openTimeout="00:01:00"
                     receiveTimeout="00:10:00"
                     sendTimeout="00:01:00"
                     bypassProxyOnLocal="false"
                     transactionFlow="false"
                     hostNameComparisonMode="StrongWildcard"
                     maxBufferPoolSize="524288"
                     maxReceivedMessageSize="65536"
                     messageEncoding="Text"
                     textEncoding="utf-8"
                     useDefaultWebProxy="true">
              <readerQuotas maxDepth="32"
                            maxStringContentLength="8192"
                            maxArrayLength="16384"
                            maxBytesPerRead="4096"
                            maxNameTableCharCount="16384"/>
              <reliableSession
                ordered="true"
                inactivityTimeout="00:10:00"/>
              <security mode="Message">
                <message clientCredentialType="Windows"
                         negotiateServiceCredential="true"
                         algorithmSuite="Default"/>
              </security>
            </binding>
          </wsDualHttpBinding>
        </bindings>
      </system.serviceModel>
    </configuration>

    just tell me what is missing....what i need to change in my config file.

    here is the screen shot of my project solution explorer.

    Sunday, January 6, 2013 2:35 PM

Answers

  • User-1662538993 posted

    Did you check those net.tcp process are working or not?

    If that does not help then host it in IIS with net.tcp enabled and then check so you should be able to figure out where is the problem.

    For more info on net.tcp check this link-

    http://www.codeproject.com/Articles/16765/WCF-Windows-Communication-Foundation-Example

    http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2013 3:37 PM

All replies

  • User-1662538993 posted

    Have you hosted the service in IIS?

    If you have hosted the service then have you enabled the net.tcp in iis?

    If not then you can just for the purpose of testing host it in IIS and Enable both http and net.tcp protocol and check that does that works fine or not?

    One more thing is you have to make sure that you have enabled net.tcp related services under Services.

    Go to control panel and services and check net.tcp related services are running or not.

    Sunday, January 6, 2013 5:31 PM
  • User88744855 posted

    no i did not host any where....i was just testing service with wcf test client.

    Monday, January 7, 2013 1:54 AM
  • User-1662538993 posted

    Did you check those net.tcp process are working or not?

    If that does not help then host it in IIS with net.tcp enabled and then check so you should be able to figure out where is the problem.

    For more info on net.tcp check this link-

    http://www.codeproject.com/Articles/16765/WCF-Windows-Communication-Foundation-Example

    http://weblogs.asp.net/ralfw/archive/2007/04/14/a-truely-simple-example-to-get-started-with-wcf.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 7, 2013 3:37 PM