What's a big advantage of WCF over Windows APps hosting?

I have been using Webservices for so long.

But so far, as far as I know, I haven't found a solid point for using WCF over web services.

Web services hosted on Cassini = WCF webserver? It's all?

thanks

+1


a source to share


3 answers


WCF is a communications stack that allows you to provide services over HTTP (like ASMX) and TCP (like Remoting), as well as named pipes, MSMQ, and .NET 3.5 REST.

It allows this because it allows you to decouple pieces of information transfer from pieces of business logic. All you have to do is decorate your service classes, methods, and DTOs with the appropriate contract attribute ([SeriviceContract], [OperationContract] and [DataContract] respectfully.)

This had the advantage of being able to write the service once and allow many different types of clients to consume the same service (e.g. Java clients can use HTTP, .NET clients can use TCP, legacy clients can use MSMQ, etc. .) using multiple snaps and endpoints.



WCF will still allow you to use all the functionality of each transport, including security, transactions, reliable messaging, and so on, but you need to exercise some caution. Not all functions work on all transporters and you need to design them accordingly. WCF allows you to specify in your contract what features are needed. This prevents someone from trying to expose your service in a way that does not support the required set of features (i.e. if your service requires transactions, the WCF runtime does not allow access to the service through the underlying HTTP endpoint).

WCF is also widely extensible with custom behavior (which affects how the WCF runtime works) and custom channels (which control how WCF services communicate with the outside world.)

WCF has a slightly learning curve compared to ASMX, but the benefits are ABSOLUTELY due to the weight of that learning curve.

+4


a source


WCF is a much broader communications infrastructure that offers support for web services, message queues, TCP-based connections, named pipes, RESTful services, and more. This allows you to host the service in different ways (IIS, console application, windows service, winforms app, etc.) with any number of different endpoint types.



To answer your question, if your web service is an .asmx service, you are not using WCF. If you are using the classes used in the System.ServiceModel namespace, or your config file contains a section <system.serviceModel>

, then you are using WCF. I'm not sure if Cassini supports WCF.

+4


a source


A couple of pretty big benefits would be multiple endpoint bindings, more WS- * standards support, it can be self-hosted, and has transaction management to start with.

+3


a source







All Articles