none
WCF netTcp on IIS not working at all

    Question

  • HI I am little bit frustrated. I am trying to host the WCF Service on IIS on Server 2008. The WCF works perfect on a http binding but when i am exposing it on net.Tcp it simply doesn't work. I have tried everything available on all the sites on the web including this forum and MSDN.

     

    he communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

     

    I do not receive any error when the binding is http. All the services are started. NetTcp services are started too.

     

    Thanks for any help in advance.

     


    Wednesday, January 12, 2011 6:13 PM

Answers

  • Interesting. So we know that your service code is correct since it all works fine when using an HTTP-based binding. That means there is some configuration problem occuring.  I created a simple IIS-hosted service/client that uses netTcpBinding, can you try it out on your server and see if it works? You can download it here: http://cid-7c932c9763173a7c.office.live.com/self.aspx/Samples/XmidTest.zip This sample works on my machine, so if it works on your server, then we'll know the problem is in the problematic app's configuration.

    Thanks,

    Michael Green
    WCF Documentation Team

     

    • Marked as answer by Bin-ze Zhao Tuesday, January 18, 2011 8:57 AM
    Thursday, January 13, 2011 9:11 PM

All replies

  • Hello,

    first of all - did you install WAS? It is in windows features under .NET called WCF Non-Http activation. When you install it you also have to allow net.tcp binding on web application. You can do it by appcmd.exe or in IIS MMC.

    Best regards,
    Ladislav

    Wednesday, January 12, 2011 9:58 PM
  • In addition to what Ladislav suggested, you may want to enable tracing, that should shed some light on what is going wrong on the service side. You can find more information about enabling tracing here: http://msdn.microsoft.com/en-us/library/ms733025.aspx

    Thanks,

    Michael Green
    WCF Documentation Team

    Thursday, January 13, 2011 12:00 AM
  • Thanx Ladislav for the response. Yes I have installed the WAS! I did all the steps from the link that you have provided. I have checked the services for net.tcp and they are started too. And every step that was on all the docs I did it and still no result, still the same error.

    Any other clue, will be nice.

    Regards,

    Dimce

    Thursday, January 13, 2011 12:03 AM
  • I did the tracing and in the trace log there is no data. And something interesting on net.tcp I can not get the Meta exchane from the service.

    Confrig:

    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
     
    <endpoint address="net.tcp://www.test.dev:808/Dev.WCF.Services.svc" binding="netTcpBinding".....

    <behavior name="mex">
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata />
            </behavior>
    On the web site web.conf:

    <endpoint address="net.tcp://www.test.dev:808/Dev.WCF.Services.svc" binding="netTcpBinding"...

    Regards,

    Thursday, January 13, 2011 11:34 AM
  • Interesting. So we know that your service code is correct since it all works fine when using an HTTP-based binding. That means there is some configuration problem occuring.  I created a simple IIS-hosted service/client that uses netTcpBinding, can you try it out on your server and see if it works? You can download it here: http://cid-7c932c9763173a7c.office.live.com/self.aspx/Samples/XmidTest.zip This sample works on my machine, so if it works on your server, then we'll know the problem is in the problematic app's configuration.

    Thanks,

    Michael Green
    WCF Documentation Team

     

    • Marked as answer by Bin-ze Zhao Tuesday, January 18, 2011 8:57 AM
    Thursday, January 13, 2011 9:11 PM
  • I just posted a new question on this as i missed the Reply feature, so my appologies for the repeat...

    I get the following error when i try and run a windows forms application that trys to communicate with a wcf service hosted in iis:

    "The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/WcfServiceAppChat/ServiceChat.svc' is unavailable for the protocol of the address."

    The app and service are in the same solution in vs 2010 using .net 4.0.

    I can hit the service no prob over http

    I have net.tcp set up on both the default web site and for the web app folder for the service itself

    The net.tcp listener and port sharing services are running

    I have Http and Non-Http activation enabled

    I followed the thread located at : http://social.msdn.microsoft.com/Forums/en/wcf/thread/e69a7f9d-0267-436f-a349-1ee6d3b37114 and downloaded the XmidTest project and when i set it up i got the exact same error, so i am pretty sure i am missing something with config somewhere, but am at a loss.

    Any help is appreciated.


    Wednesday, August 10, 2011 2:48 PM
  • I got it going doing the following:

    reapaired the service model installation on the server with:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319>ServiceModelReg.exe -r

    More info on ServiceModel Registration Tool @ http://msdn.microsoft.com/en-us/library/ms732012.aspx

    I found this at this post: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/ec167e53-293c-4e7d-88a3-e5992db1ffd4/

     

    • Proposed as answer by Jrw_99 Thursday, August 11, 2011 1:40 PM
    Thursday, August 11, 2011 1:40 PM