views:

313

answers:

3

I need some direction related to this topic; maybe I am missing the obvious.

I dont see a contrast between WCF bound to HTTP and strongly typed web service. Why would this be any different?? I agree there are some development nuances especially related to XmlSerializer in ASMX vs WCF and a plethora of Microsoft jargons. Short of these; i only see parallels

DataContract=WSDL Type ServiceContract=WSDL (aka service definition) OperationContract=WebMethod

Operationally, I understand the binding can be numerous with WCF instead of getting locked down to HTTP, which can involve heavy construct and tear down. But for loose coupling it will all be web services.

Are there other operational differences??

Can someone show me the light and put me out of my misery?? :))

Thanks in advance

+6  A: 

Well, if you reduce your discussion to only HTTP, then there's still a slew of advantages that WCF has over ASMX:

  • more and better security settings (ability to use either transport or message security)
  • much more flexibility - a lot more can be configured and tweaked in WCF, either in configuration files or code
  • ASMX web services can only exist inside IIS - IIS is a must-have requirement; you can self-host your WCF services in a console app or Windows NT Service
  • the clear focus on using Service and Data Contracts in WCF makes for a much cleaner interface and a much better separation of concern (better code, in the end)
  • support for things like reliable messaging and transaction support (even over HTTP)

In short: even though the differences might be smaller when you restrain WCF to just HTTP, I still think it's superior and if you have the choice to start something new today, by all means, use WCF instead of ASMX!

Rick Strahl puts it very nicely in his blog post:

I would argue that using WCF for any new services is probably a good idea even if you stick with pure HTTP and SOAP because by creating your service with WCF you can decide later on to publish this same service using WAS and also provide the more high performance TCP/IP transport. Or you might be asked to provide some of the advanced features of WS- protocols like transactions, attachments, session management, encryption etc. By using WCF you are building your service with a view to the future so you can easily move up to other protocols-some of which may not even exist today. Certainly new technologies will come along in the future and WCF protects you somewhat through its abstraction layer and common API.*

Marc

marc_s
+1 thanks for the summary and link!
Ralph Willgoss
Marc,thanks for the summary; I apologize this fell off my radar
G33kKahuna
A: 

The other big distinction between the two technologies is that Microsoft now considers both ASMX web services and the XML Serializer to be "legacy technology", and is no longer fixing bugs in them.

John Saunders
+1  A: 

Another point for the consumers of the ASMX web service, which ever platforms will consume the web service will have to implement a SOAP stack. If you're goal is for wide reaching consumption, WCF is preferable and will allow you to expose the WS in more universal ways.

ChrisLoris