How to host WCF through TCP ports?
In WCF, you can host any service by yourself by creating an instance of the ServiceHost class, configure it with the correct endpoints and the service implementation you wish to expose, and call Open
on it. This is called self-hosting because you host the service (and its port listeners) from within your own application.
Alternatively, you can host your service in IIS, but you should be aware that while you can host WCF in IIS 6, it only allows you to host HTTP and HTTPS endpoints. If you want to host TCP endpoints in IIS (which is a good idea), you will need IIS 7.
Read more here.
kurozakura
Updated on August 01, 2020Comments
-
kurozakura almost 4 years
How do I host WCF services through TCP Ports, and how do I listen to it and consume services through these TCP ports?
That is, apart from the net.tcp binding, is there some way to host and consume using TCP ports?
-
kurozakura almost 15 yearsso basically,in windows xp hosting n consuming can be done in 3 ways 1.self-hosting 2.IIS 3.as a Windows Service so opening a TCP port and consuming it,comes under self-hosting or is it another way of hosting n consuming wcf services or is there any other way i.e under TCP?
-
-
kurozakura almost 15 yearsso basically,in windows xp hosting n consuming can be done in 3 ways 1.self-hosting 2.IIS 3.as a Windows Service so opening a TCP port and consuming it,comes under self-hosting or is it another way of hosting n consuming wcf services or is there any other way?
-
kurozakura almost 15 yearsso basically,in windows xp hosting n consuming can be done in 3 ways 1.self-hosting 2.IIS 3.as a Windows Service so opening a TCP port and consuming it,comes under self-hosting or is it another way of hosting n consuming wcf services or is there any other way i.e under TCP?
-
kurozakura almost 15 yearsso basically,in windows xp hosting n consuming can be done in 3 ways 1.self-hosting 2.IIS 3.as a Windows Service so opening a TCP port and consuming it,comes under self-hosting or is it another way of hosting n consuming wcf services or is there any other way i.e under TCP?
-
Mark Seemann almost 15 yearsWindows XP doesn't run IIS 7, so you can't host a TCP endpoint on IIS under XP. You can make a Windows Service host a WCF service, but that's just another example of Self Hosting.
-
Tad Donaghe almost 15 yearsI think you can host TCP with WAS in IIS 7.
-
Asela Liyanage almost 15 yearsHTTP is an application protocol, not transport.
-
Darren Oster over 14 yearsMore info on using netsh to open a port here: msdn.microsoft.com/en-us/library/ms733768.aspx