views:

179

answers:

2

My WCFservice is giving me "The protocol 'net.tcp' is not supported"...

<system.serviceModel>
        <bindings>
      <netTcpBinding>
        <binding name="tcpBinding" transferMode="Streamed" portSharingEnabled="false">
            <reliableSession enabled="true" />
          <security mode="None">
            <transport clientCredentialType="None" protectionLevel="None" />
            <message clientCredentialType="None" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
        <services>
            <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" behaviorConfiguration="Service1Behavior">
                <endpoint address="" binding="wsHttpBinding" contract="JMSysSplash.CommunicationClient.IJMSysSplashServer">
                    <identity>
                        <dns value="localhost"/>
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding"  contract="IMetadataExchange"/>
        <endpoint address="net.tcp://localhost:8888/JMSysSplashServer" binding="netTcpBinding" bindingConfiguration="tcpBinding" contract="JMSysSplash.CommunicationClient.IJMSysSplashServer"/>
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8731/JMSysSplashServer.svc/"/&gt;
           <add baseAddress="net.tcp://localhost:8888/JMSysSplashServer"/> 
          </baseAddresses>
                </host>
            </service>
        </services>    
        <behaviors>
            <serviceBehaviors>
                <behavior name="Service1Behavior">
                    <serviceMetadata httpGetEnabled="true"/>
                    <serviceDebug includeExceptionDetailInFaults="true"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
A: 

You are missing your bindings node from the config you listed, which would cause that error. Was that just an error in the copy/paste, or are you missing a section that looks like this:

<bindings>
    <netTcpBinding>
        <binding name="tcpBinding" ..enter your binding settings here...>
        </binding>
    </netTcpBinding>
</bindings>
slugster
A: 

You are missing a base address for nettcp - or then you need to define a full netTCP address in your endpoint. Your current netTcp endpoint looks like this:

       <endpoint address="" binding="netTcpBinding" 

You don't specify a full address --> WCF is looking for a base address for net.tcp to use - but there is none!

Solution 1: add a baseAddress for netTcp:

<services>
    <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" behaviorConfiguration="Service1Behavior">
        .....
        <host>
            <baseAddresses>
                <add baseAddress="http://localhost:8731/JMSysSplashServer.svc/"/&gt;
                <add baseAddress="net.tcp://localhost:8888/JMSysSplashServer"/>
            </baseAddresses>
        </host>
    </service>
</services>

Now your net.tcp endpoint can be reached at net.tcp://localhost:8888/JMSysSplashServer

Solution 2: define a full address in your net.Tcp endpoint:

<services>
    <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" 
             behaviorConfiguration="Service1Behavior">
        <endpoint address="" binding="wsHttpBinding" 
                  contract="JMSysSplash.CommunicationClient.IJMSysSplashServer">
            <identity>
                <dns value="localhost"/>
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding"  
                  contract="IMetadataExchange"/>
        <endpoint 
             address="net.tcp://localhost:8888/JMSysSplashServer" 
             binding="netTcpBinding" bindingConfiguration="tcpBinding"  
             contract="JMSysSplash.CommunicationClient.IJMSysSplashServer"/>
        .......
    </service>
</services>

When you define an endpoint, you

  • either define a full address (with net.tcp and port number and all)

OR:

  • you define a relative address (e.g. address="") but in this case, you must have a base address for that scheme (here: net.tcp) - not just a http base address
marc_s