Hosting env : Windows 2003 server
IIS : 6.0
Dev env : Windows XP
IIS : 5.1
Scenario:
Client will be pushing some message into MSMQ and WCF service will be the one keeping an eye on MSMQ. Once the message is pulled from MSMQ WCF service will process and then put the data/message on to some other MSMQ.
We are thinking of creating a WCF service with NetMSMQ binding.
I have heard that if we are using IIS 6.0 we wont be able to host the WCF service with MSMQ binding, am I right? So for that reason are we supposed to host it as console app or windows service?
thanks
That is correct - hosting in IIS 5/6 only works for HTTP protocols / bindings. If you want to use MSMQ, you'll have to host it yourself - in a console app or a Windows NT Service.
IIS7 on Vista/Server 2008/Win7/Server 2008R2 supports MSMQ through the Windows Process Activation Service (WAS).
Marc
Related
I am fairly new to hosting web applications and web services. Though I was successful in hosting a web application, I am running into road block after road block when trying to host a WCF service with net.tcp binding.
My scenario is as follows, I have a hosted web application that needs to communicate with a hosted WCF service with net.tcp binding through IIS 7.5. As stated the web application is hosted fine and I can browse the web site. However, the web application makes services calls to the WCF service and I am getting the 'TCP error code 10061' message which I believe is due to my hosted WCF service not running. I think this is not running because I attempt to 'telnet localhost 808' to see if the WCF service is running and it is not. I've run through numerous online guides and I still have had no luck. I believe I may be doing something fundamentally wrong with me being a noob and all. I am able to host the service through VS2010 and run the web application and it works fine so I believe my bindings are correct. I've also enabled tcp protocols on both websites in IIS Manager.
So I guess my real question is what are the IIS Manager steps needed to host a WCF service with net.tcp binding? It appears to me that it is not possible to host a net.tcp service through IIS Manager by simply creating a website because IIS Manager wants to bind to an http port.
Here are some things to check:
Ensure the Net.Tcp Listener Adapter windows service is running
Ensure netTcp is listed as an enabled protocol for your website (In IIS Manager, go to Advanced settings for your site)
Ensure netTcp is listed as an enabled protocol for application (directory) that is hosting your services (In IIS Manager, go to the directory hosting your services and select Advanced Settings)
Ensure your IIS site has a binding for net.tcp, with the correct port number listed.
EDIT:
See the following MSDN page for enabling/using non-HTTP bindings in .Net 4 + IIS 7/7.5:
Configuring the Windows Process Activation Service for Use with Windows Communication Foundation
And I discovered that for me it didn't work to use localhost... You should use 127.0.0.1 or the name of your computer.
Is it possible to host WCF Services with Appfabric Service Bus endpoints in IIS6 on Windows Server 2003 64 bit?
If not, are there any alternatives apart from upgrading the OS or using a Windows Service?
Any help would be great
Steve
I am unaware of any way to accomplish this with "pure" IIS6 as it lacks WAS and the auto-start feature that is needed to hook the IIS application up to the ServiceBus address before that application has actually been "spun up" by some outside client.
That said if you had some kind of start-up task on the server that would make a request to the application so that it could register with the Service Bus inside of the traditional Application OnStart lifecycle event, that could be a possible solution.
I've finished writing a WCF service that uses TCP. It is meant to run on a Windows 2003 Server, which doesn't have WAS available, so I've written a Windows service to host my WCF service. It works great on my development machine.
Now, how do I get these two services onto the Windows 2003 Server? Do I just copy the WCF service there and that's it? I would think it would probably be best if I put it into some specific location, but where would that be? And then the hosting Windows service, how do I deploy that to the Windows 2003 Server?
You should have a service deployment project that you've used in the Dev area.
It will be the same technique.
Example of creating a service in c# from codeproject
put it in program files\Your Service
How to host WCF services locally instead of http binding.. I mean the services should be hosted within the .NET environment and not by using http or netTCP.. Could you please help me with the configuration for the same?
What are you trying to achieve here that can't be performed by using http or tcp settings for the local machine for both ends of the WCF contract? WCF isn't just between machines, you can also set it to communicate between different processes on the same machine.
I think you are confusing between hosting a WCF service and a WCF binding. A WCF service can be hosted in many different applications such as standalone executables, windows services, a web server such as IIS, ...
Once you've found an appropriate host for the service you have to decide what binding to use. A binding is used to specify the transport, encoding, and protocol details required for clients and services to communicate with each other.
Note that choosing a host could further limit the choice of bindings available. For example if you decide to host your service in IIS you could only use HTTP/S as transport and NetTcp is not available (in IIS7 it is available through WAS).
How to confgiure NetNamedPipeBinding.
How to: Host a WCF Service in a Managed Windows Service.
Is it true that a WCF either runs as a console application that you have to manually start OR under a more traditional IIS application (like a website or webservice)
you can start a WCF host process in a:
Windows Forms App
Console App
Windows Service
IIS 6 (Only HTTP hosting)
IIS 7 - WAS (All bindings supported)
Each of them has advantage or disadvantages. This page gives great information about hosting options: http://msdn.microsoft.com/en-us/library/bb332338.aspx.
EDIT: No, that is not quite true.
Those are two hosting options for WCF. There are others.
orig answer:
you can actually execute a wcf service everywhere, where you can execute managed code.
i've seen wcf services running inside sql server, wpf apps, windows services and even one running on a linux box on mono.
There is a class ServiceHost defined in WCF that allows you to host a service in any application like so:
using (ServiceHost host = new ServiceHost(typeof(MyService))
{
host.Open();
WaitForClose();
host.Close();
}
IIS running in Windows XP SP2+, Vista, 2003 or 2008 can host WCF services.
Yes, that's correct... you can also host them as a Windows Service
Part of the objective of WCF is to free you up from limitations on where the service is running. You can also use Windows Activation Service (WAS) for Vista and Windows Server 2008.
I have a WCF service that needs to run as a service in IIS 7.
The problem is that in order for it to start I need to manually invoke it through the browser e.g. http://site/myservice.svc.
Is there a way to have IIS call out and start the service host / wcf service when the application pool is restarted?
My preference would be to avoid a windows service and go with IIS / WAS