locked
WCF without IIS RRS feed

  • Question

  • HI all,

    is it possible to use WCF, hosting WCF service and call it by a client without IIS but using TCP/IP ?

    Regards

     

    Thursday, December 15, 2011 4:14 PM

Answers

  • Hi

    Check this

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


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
    Thursday, December 15, 2011 4:33 PM
  • See: How to: Host WCF in a Windows Service Using TCP : http://msdn.microsoft.com/en-us/library/ff649818.aspx


    Randy Aldrich Paulo

    MCTS(BizTalk 2010/2006,WCF NET4.0), MCPD | My Blog


    BizTalk Message Archiving - SQL and File
    SSIS Centralize Connection Repository
    Thursday, December 15, 2011 8:23 PM
  • On 12/15/2011 11:14 AM, skuanet wrote:
    > HI all,
    >
    > is it possible to use WCF, hosting WCF service and call it by a client
    > without IIS but using TCP/IP ?
    >
     
    Yes, you can use HTTP, TCP/IP, Named Pipe or MSMQ as WCF service
    communication types.
     
    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:18 AM
    Thursday, December 15, 2011 6:42 PM
  • HelloHere are the steps

    compile your wcf service code suppose Service implementation class name is "mytestService" and servicecontract is "ImytestService"

    1.create new project i will chose windows console application for example

    2.add refrence to your serviccode dll

    3.add refrence to System.ServiceModel

    4.Add following code in main method

    ServiceHost mysrvHost=new ServiceHost(typeof(mytestService));

    //configure endpoints

    mysrvHost.AddServiceEndPoint(typeof(ImytestService),new NetTcpBinding(),"net.tcp://localhost:9929/MyTestService");

    //you can add other endpoints if you want just copy paste and change the binding and address

    now

    //host the service

    mysrvHost.Open();

    //Hope that helps

    Thankyou

     

     

     

    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Thursday, December 15, 2011 8:51 PM
  • For this you can use the following:

    1. Self Hosting using Managed .NET application

    2. Hosting in Windows Service.

     

    Regards,

    PuriG

    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Friday, December 16, 2011 6:06 PM
  • Yes, this is possible of hosting a WCF service without IIS for net.tcp. This is the beauty of WCF service which provides many options to host a service with various binding it supports using

    1.     IIS

    2.     Windows Service

    3.     Console Application

    4.     Win Form Application

     Infect the modern IIS (> 7.0) is only capable of hosting WCF Service with other binding like tcp.

    When you host WCF service in IIS, it enjoy the power of Concurrency, instantiation, security, Load Balancing and many more feature which comes with IIS  but if you do not host WCF with IIS than you need to configure your service manually or relaying on default settings.

     


    Lingaraj Mishra
    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Saturday, December 17, 2011 4:06 AM

All replies

  • Hi

    Check this

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


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
    Thursday, December 15, 2011 4:33 PM
  • On 12/15/2011 11:14 AM, skuanet wrote:
    > HI all,
    >
    > is it possible to use WCF, hosting WCF service and call it by a client
    > without IIS but using TCP/IP ?
    >
     
    Yes, you can use HTTP, TCP/IP, Named Pipe or MSMQ as WCF service
    communication types.
     
    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:18 AM
    Thursday, December 15, 2011 6:42 PM
  • See: How to: Host WCF in a Windows Service Using TCP : http://msdn.microsoft.com/en-us/library/ff649818.aspx


    Randy Aldrich Paulo

    MCTS(BizTalk 2010/2006,WCF NET4.0), MCPD | My Blog


    BizTalk Message Archiving - SQL and File
    SSIS Centralize Connection Repository
    Thursday, December 15, 2011 8:23 PM
  • HelloHere are the steps

    compile your wcf service code suppose Service implementation class name is "mytestService" and servicecontract is "ImytestService"

    1.create new project i will chose windows console application for example

    2.add refrence to your serviccode dll

    3.add refrence to System.ServiceModel

    4.Add following code in main method

    ServiceHost mysrvHost=new ServiceHost(typeof(mytestService));

    //configure endpoints

    mysrvHost.AddServiceEndPoint(typeof(ImytestService),new NetTcpBinding(),"net.tcp://localhost:9929/MyTestService");

    //you can add other endpoints if you want just copy paste and change the binding and address

    now

    //host the service

    mysrvHost.Open();

    //Hope that helps

    Thankyou

     

     

     

    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Thursday, December 15, 2011 8:51 PM
  • For this you can use the following:

    1. Self Hosting using Managed .NET application

    2. Hosting in Windows Service.

     

    Regards,

    PuriG

    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Friday, December 16, 2011 6:06 PM
  • Yes, this is possible of hosting a WCF service without IIS for net.tcp. This is the beauty of WCF service which provides many options to host a service with various binding it supports using

    1.     IIS

    2.     Windows Service

    3.     Console Application

    4.     Win Form Application

     Infect the modern IIS (> 7.0) is only capable of hosting WCF Service with other binding like tcp.

    When you host WCF service in IIS, it enjoy the power of Concurrency, instantiation, security, Load Balancing and many more feature which comes with IIS  but if you do not host WCF with IIS than you need to configure your service manually or relaying on default settings.

     


    Lingaraj Mishra
    • Marked as answer by Yi-Lun Luo Thursday, December 22, 2011 9:17 AM
    Saturday, December 17, 2011 4:06 AM