none
The provided URI scheme 'http' is invalid; expected 'net.tcp' RRS feed

  • Question

  • Hi,
    i have little bit experience on basicHttpBinding in WCF. Now i want to leann netTcpBinding, so i modified my config file like this :

    <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceMetadataBehavior">
              <serviceMetadata httpGetEnabled="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        
        <services>
          <service name="WcfService1.Service1" behaviorConfiguration="ServiceMetadataBehavior">
            <endpoint address="http://localhost:61500/Service1.svc" binding="netTcpBinding" 
                      contract="WcfService1.IService1">
              
            </endpoint>
            
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
          </service>
        </services>
      </system.serviceModel>

    But when runing the svc file in browser i am getting this error -

    The provided URI scheme 'http' is invalid; expected 'net.tcp'

    Can anybody clearly explain why i am getting this error message?


    • Edited by NorthValley Thursday, January 24, 2013 1:27 PM
    Thursday, January 24, 2013 1:26 PM

Answers

  • See this guide for how to match different EndPoint Uri types to different binding attribute. If you're using Uri starting with "http://", you need to set it to wsHttpBinding.

    You may also want to read other pages at the side menu in the link to learn more about Service Endpoint Basics.


    Friday, January 25, 2013 1:50 AM

All replies

  • The endpoint in the config is still an http address. It is expecting a TCP endpoint like this:

    <endpoint address="net.tcp://localhost:61500/Service1.svc" binding="netTcpBinding" 
                      contract="WcfService1.IService1">

    Thursday, January 24, 2013 1:45 PM
  • The endpoint in the config is still an http address. It is expecting a TCP endpoint like this:

    <endpoint address="net.tcp://localhost:61500/Service1.svc" binding="netTcpBinding" 
                      contract="WcfService1.IService1">


    if i change it to net.tcp://localhost:61500/Service1.svc then how will i be able to view the service metadata on browser ? Will the browser accept this address and give me wsdl data ?
    Thursday, January 24, 2013 1:52 PM
  • You can't connect to it through a browser. You will need to write a test client or use WcfTestClient to access the service.
    Thursday, January 24, 2013 2:02 PM
  • If browser can support http or ftp then why not tcp ?
    Thursday, January 24, 2013 2:05 PM
  • I have seen that when WCF with netTcpBinding is self hosted then it's metadata is exposed on http. How is that possible?
    And if that is possible then why its metadata cannot be exposed on browser that i tried.

    For self hosting i done something like this :

    Uri uri = new Uri("http://localhost:6676/Service1");
    ServiceHost host = new ServiceHost(typeof(SomeService),uri);
    host.Open();

    So, this way i am able to see the service up even on browser and you said that i cannot see on browser ? On what basis you said that ? Please Clearify me anyone.

    Thursday, January 24, 2013 2:36 PM
  • See this guide for how to match different EndPoint Uri types to different binding attribute. If you're using Uri starting with "http://", you need to set it to wsHttpBinding.

    You may also want to read other pages at the side menu in the link to learn more about Service Endpoint Basics.


    Friday, January 25, 2013 1:50 AM