1

I am having a WCF ServiceLibrary which runs successfully on WCF Test Client.

Now I am trying to build a Website to Host this web service. I am using nettcp binding. My web.config file looks like this

   <system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="tcp_Unsecured" portSharingEnabled="true">
          <security mode="None"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="tcpServiceBehavior" name="MarketFeedServiceLibrary.Service1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="tcp_Unsecured"
          name="data" contract="MarketFeedServiceLibrary.IService1" />
        <endpoint address="mextcp" binding="mexTcpBinding" name="metadata"
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8080/MarketFeedSite/MarketFeedService.svc" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="tcpServiceBehavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

I am try to view in browser directly from Solution Explorer

enter image description here

But I get error as shown below

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

I have tried all the solutions available on SO, youtube etc but no luck,

I tried:

  1. Under IIS I have enabled http,net.tcp protocols
  2. I have also gone through: How to: Install and Configure WCF Activation Components

N.B. I am a WPF App Developer, hence WCF and ASP.NET Website are new to me.

Thank You.

Edit: Testing Under WCF Client gives following error

Cannot obtain Metadata from net.tcp://localhost:8080/MarketFeedSite/MarketFeedService.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. WS-Metadata Exchange Error URI: net.tcp://localhost:8080/MarketFeedSite/MarketFeedService.svc Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:8080/MarketFeedSite/MarketFeedService.svc'. Could not connect to net.tcp://localhost:8080/MarketFeedSite/MarketFeedService.svc. The connection attempt lasted for a time span of 00:00:01.9968000. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8080. No connection could be made because the target machine actively refused it 127.0.0.1:8080

Marshal
  • 6,551
  • 13
  • 55
  • 91
  • What would you expect the browser to show if you could connect it to a tcp bound wcf service? – paul Feb 07 '13 at 11:47
  • It means we can't view it in browser as it isn't an http protocol. Hmm. How can I check that it is running ? – Marshal Feb 07 '13 at 11:49
  • Use the WcfTestClient http://msdn.microsoft.com/en-us/library/bb552364.aspx – paul Feb 07 '13 at 11:50
  • 1
    you forget to add /MarketFeedSite so it should be net.tcp://localhost:8080/MarketFeedSite/ – Mustafa Ekici Feb 07 '13 at 11:51
  • http://stackoverflow.com/questions/1793119/could-not-find-a-base-address-that-matches-scheme-net-tcp – C-va Feb 07 '13 at 12:03
  • @paul: I am trying to test in WCF Client, but receiving TCP Error. I have edited the question with details. – Marshal Feb 07 '13 at 12:24

0 Answers0