none
Host wcf service nettcpbinding in IIS8 RRS feed

  • Question

  • Hi,

    I am using VS 2012 in Windows 8. If I host the application into the default website, it is working. But I am not sure which binding it is using. I changed the binding to nettcpbinding in app.config file of client application but not able to see any change in speed. Moreover there are no services/endpoints in the web.config file of the server project. Can you please give me links of good tutorials or guide me to understand and solve this issue?

    I am planning to develop a small client-server app working inside office.

    Thanks a lot

    Jo

    Tuesday, March 12, 2013 12:11 AM

Answers

All replies

  • Hi,

    >>Moreover there are no services/endpoints in the web.config file of the server project.

    I guess you have create a service using "WCF Service Application" template which is hosted in IIS, it use basicHttpBinding by default, you can find the binding information by view the service.svc file in browser.

    In addition, you can host the service in any managed application, host it in IIS or in a managed windows service. Check a document below for more information on hosting services.

    #Hosting Services

    http://msdn.microsoft.com/en-us/library/ms730158.aspx

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 15, 2013 3:06 AM
    Moderator
  • Hi Haixia,When I open service.svc in browser, it is showing like this.

    svcutil.exe http://localhost:49203/Service.svc?wsdl

    How I can make sure the service is running in nettcp. My main objective is to make the application more faster.

    Thanks

    Jo

    Sunday, March 17, 2013 11:30 AM
  • Hi,

    If you want to configure the WCF service with netTcpBinding, there is some steps needed to configure. Enable/activate WCF non-HTTP activation; Register ASP.NET with IIS; Check if Windows service running; Configure your machine to support netTcp; Enable net.tcp protocol for your application in the IIS and etc.

    For more details, you can refer this blog.

    #Configuring WCF Service with netTcpBinding

    http://rohitguptablog.wordpress.com/2011/06/16/configuring-wcf-service-with-nettcpbinding/

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 18, 2013 6:10 AM
    Moderator
  • Dear Haixia,

    Thank you very much for the link. I followed the steps and succeeded to run the wcf service with net.tcp.

    I couldn't find any option to change the binding directly into net.tcp. In order to do that I explicitly add following code in web.config.

    <services>
          <service name="Service">
            <endpoint address="Service" binding="netTcpBinding" contract="IService"></endpoint>
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
          </service>
        </services>

    After this stage, the WCF service is running with nettcpbing as follows.

    svcutil.exe net.tcp://mymachine/MyNewWebi/Service.svc/mex

    When I created a client and tried to add the service reference, it is giving me error as follows.


     I am using VS 2012 and the sample project is with framework 4.5 and I tried to publish in IIS8. Can you please help me to solve this issue?

    Many Thanks

    Jo

    Tuesday, March 19, 2013 12:22 AM
  • Hi,

    Please use the svcutil.exe tool from the command line with the syntax you posted above, then use add service reference option, input address(net.tcp://mymachine/MyNewWebi/Service.svc/mex). Use svcutil.exe tool like:

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 19, 2013 7:57 AM
    Moderator