Ive written a service and it has a .svc file. I can browse to this service but this seems to be a strange way of doing it. Im wondering whether is okay to produce a service using a .svc file or should we be looking at using the WCF Service Host and setting up the bindings etc....
The major difference is that the WCF Service Application has a . svc file, whereas the WCF Service Library does not have a . svc file. Suppose we want to host this service application in IIS, then you need to specify for IIS the execution runtime environment requirements.
A . svc file contains a WCF-specific processing directive (@ServiceHost) that allows the WCF hosting infrastructure to activate hosted services in response to incoming messages. The most common syntax for a . svc file is in the following statement.
5) The purpose of ASMX services is to send and receive data using SOAP over HTTP protocol. However, WCF services can send and receive data using any format over different protocols like HTTP, HTTPS, TCP, MSMQ etc.
An svc file is for when you're hosting within IIS (it can now host without these in .NET 4.0). Unless you have a reason to self host I'd strongly recommend sticking with IIS (WAS) as it provides so much of the hosting infrastructure for "free".
UPDATE (11/16): Updated broken link to point to a comparative ASP.NET forums post. Previous link was here in case it comes back to life sometime in the future.
Well, In WCF you are not restricted to hosting in just IIS. The .svc file is equivalent to an asmx file. If you are going to host in IIS, I have used the .svc file, but if I am hosting in a console app or windows service, I instantiate the service through ServiceHost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With