none
Enabling port sharing with mexTcpBinding via config ? RRS feed

  • Question

  • I am trying to enable a MEX endpoint that uses port sharing,  but I cant seem to get it working properly via a config file, I keep getting the following error

     

    "The binding at system.serviceModel/bindings/mexTcpBinding does not have a configured binding named 'mexBinding'. This is an invalid value for bindingConfiguration"

     

    My config file looks like this:

     

    <services>

    <service name="EchoService.EchoServiceImpl"

    behaviorConfiguration="MexBehavior">                 

    <host>

    <baseAddresses>

    <add baseAddress ="net.tcp://localhost:886/echo/"/>

    </baseAddresses>

    </host>

                           

    <endpoint address=""

        binding="netTcpBinding"

        contract="EchoService.IEcho"

        bindingConfiguration="DefaultBindingConfig"    />

                           

                           

    <endpoint address="mex"

        binding="mexTcpBinding"

    contract="IMetadataExchange" bindingConfiguration="mexBinding"   />

    </service>

    </services>

     

    <bindings>

    <netTcpBinding>

    <binding

            name="DefaultBindingConfig"

      maxConnections="5"

      portSharingEnabled="true" >

                </binding>

    <binding

       name="mexBinding"

                         portSharingEnabled="true">

                         <security mode="None"></security>

                </binding>

    </netTcpBinding>       

    </bindings>

     

    <behaviors>

    <serviceBehaviors>

    <behavior name="MexBehavior" >

    <serviceMetadata/>                             

    </behavior>

    </serviceBehaviors>

    </behaviors>   

    Wednesday, October 11, 2006 1:40 PM

Answers

  • You must change

    <endpoint address="mex"

        binding="mexTcpBinding"

    contract="IMetadataExchange" bindingConfiguration="mexBinding"   />

     

    to

     

    <endpoint address="mex"

        binding="netTcpBinding"

    contract="IMetadataExchange" bindingConfiguration="mexBinding"   />

    I think the "mexTcpBinding" is just a magic accelerator for a unchangeable "canned" binding with some default settings that are appropriate for mex over tcp.  Since you want to use non-default settings, just use "netTcpBinding" so you can point to your configured bindingConfiguration.

     

    I also stumbled across

    http://blogs.msdn.com/drnick/archive/2006/08/23/713297.aspx

    which is worth a look.

    Thursday, October 12, 2006 12:57 PM

All replies