Is it possible to host a TCP endpoint in an IIS6 hosted service? - wcf

I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.
If i use a HTTP endpoint everything works just fine, but when i try to switch to TCP it goes bad.
Is it even possible to do this in II6?
I have a more specific question posted here, that asks for a solution, but i would be happy with (for starters if not) with just an answer (and perhaps an example) to this - less specific question.
Why can't I connect to a WCF service with net.tcp but i can with http?

IIS 5.1 and IIS 6 can only host HTTP bindings. IIS7 has WAS (Windows Activation Service) which allows hosting of endpoints bound to any transport protocol... so it would be capable of TCP.
If you must host with IIS 6, then you're stuck with the HTTP bindings. If not, consider self-hosting in a Windows Service.

Related

Sharing port 80 for NetTcpBinding and BasicHttpBinding in IIS 8 hosted WCF service possible?

I have created a .NET 4.0 WCF service to transfer large files from and to clients. Several sources in the web suggest that streaming via netTcpBinding performs significantly better than streaming via basicHttpBinding (streaming, mtom enabled).
On the other hand, establishing a connection to the server via net.tcp is reported to be prone to fail, in most cases due to firewalls, proxies or other company networking restrictions, while establishing a http connection on port 80 can be taken for granted.
What I'd like to do is to provide the streaming service with both http and net.tcp endpoints on the server side. The client tries to connect to the net.tcp endpoint, and in case of a connection error, connect to the http endpoint.
Is there a way to share port 80 between my http and net.tcp endpoints? I'm using IIS 8 as service host, the clients are tied to .NET 4.0, denying the use of .NET 4.5's newly introduced NetHttpBinding.
You can share ports between multiple basicHttp bindings, or between multiple netTcp bindings, but unfortunately you can't mix and have both netTcp and basicHttp share a port. WCF will give you an AddressAlreadyInUseException for that.

RESTful WCF hosting

I have a RESTFul WCF service and it needs to be deployed now. I am really confused whether to deploy in windows service or IIS 7. I need to implement SSL also so the protocol would be HTTPS. It is just a simple service consumed by client using HTTPS protocol.
Please let me know which one is better.
Your question seems to have been asked (and answered) previously.
The following link provides a good discussion:
IIS WCF service hosting vs Windows Service
If your RESTFul WCF Service needs to be accessed via http (or https) protocol, then deploy in IIS7.

Does IIS work with http-only WCF services?

I'm not a WCF expert, so please don't laugh at me.
I need to write a WCF service that receives data through TCP endpoint, not HTTP. Can I still deploy it to IIS or Azure and take advantage of all cool stuff that's baked in (load distribution, etc.)?
Depends on the version of IIS.
IIS v6 supports HTTP only
with IIS v7, you also get WAS (Windows Process Activation Services) which then also supports TCP and other protocol when hosted in IIS
See:
How to: Host a WCF Services in IIS
Setting up a netTcpBinding enabled service in IIS 7

how to configure fiddler to monitor wcf calls to a wcf services hosted in IISExpress

situation:
my website (which contains the WCF service) is hosted in IISExpres port number 58366 (http://localhost:58366/myapp)
I have a winforms client which connects to the wcf service using BasicHttpBinding
I want to debug my wcf calls using fiddler, but can't seem find how to redirect wcf calls through fiddler.
IISExpress idiotically binds to the hostname "localhost", not just to the port, so conventional workarounds as with adding a dot to the hostname don't work. Solution seems to be here. Note the last part of the selected answer: Use "localhost.fiddler" and Fiddler will emit "localhost" when proxying.
Rick Strahl has a good article on this here: http://www.west-wind.com/weblog/posts/2009/Jan/14/Monitoring-HTTP-Output-with-Fiddler-in-NET-HTTP-Clients-and-WCF-Proxies
Pretty sure a winforms app will usually pick up the default system proxy as set by fiddler. Are you operating on localhost? Try connecting to your machine name.

Host WCF in IIS 7 using net.tcp binding

I am hosting a WCF service in IIS 7 through net.tcp binding. I have two questions about IIS configuration.
Can I only configure net.tcp protocol in the the web site containing my service code? All the samples I found so far always append the net.tcp protocol after http protocol.
There are two features we can turn on: Windows Communication Foundation Http Activation and Windows Communication Foundation Non-Http Activation. Some sample state that we need to turn on Non-Http activation and others state that both are required to turn on. My test shows that both are required. However, I do not understand the difference between the two. If only net.tcp protocol is used by my service and client, why should Http Activation be required?
Even if your service is net.tcp the meta data exchange that is used when you add a service reference may be http.
Which tests did you do? If you need more help post your config file.