1
votes

Simple problem :

How to self host a netTcpBinding service in client project right clicking Service References > Add Service Reference ...

Clicking "Discover" it references all services using WsHttpBinding including the netTcpBinding one. But when expanding the netTcpBinding one it can't navigate to the contract and it throw the following error :

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

I found the following .Net WCF sample very nice and neat, but in the example, it doesn't show how the config file is set, and how we could get the proxy via the wizzard.

C:\WF_WCF_Samples\WCF\Basic\Binding\Net\Tcp\Default\CS

Here is the service config file ... (I don't use any base adress, it should work without it I think)

   <service behaviorConfiguration="Canopus.WebServices.LogAndNotificationService"
    name="Canopus.WebServices.LogAndNotificationService">      
    <endpoint address="" binding="netTcpBinding"
     contract="Canopus.WebServices.ILogAndNotificationService" />
    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
   </service>

        <behaviors>
            <serviceBehaviors>
                <behavior name="Canopus.WebServices.LogAndNotificationService">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="true" />
                </behavior>
            </serviceBehaviors>
        </behaviors>

Thanks for your help !

1

1 Answers

0
votes

I think your service behaviour cannot have httpGetEnabled attribute when u r dealing with netTcPBinding. and also looks like ur end point address contains something like http:// it should be net.tcp://.