GeekInterview.com
Series: Subject: Topic:
Question: 3 of 348

ASMX web service and WCF web service

What is the difference between ASMX web service and WCF web service? How is WCF better than ASMX?
Asked by: tfeaster | Member Since Jun-2012 | Asked on: Jun 24th, 2012

View all questions by tfeaster

Showing Answers 1 - 2 of 2 Answers
suchitra

Answered On : Jun 27th, 2012

WCF web service provides a complete solution for the WS* specification. asmx does not.

  
Login to rate this answer.
vpote

Answered On : Aug 16th, 2012

View all answers by vpote

WCF vs. ASMX

Protocols Support

WCF

HTTP
TCP
Named pipes
MSMQ
Custom
UDP
ASMX

HTTP only
Hosting

ASMX

Can be hosted only with HttpRuntime on IIS.
WCF

A WCF component can be hosted in any kind of environment in .NET 3.0, such as a console application, Windows application, or IIS.
WCF services are known as services as opposed to web services because you can host services without a web server.
Self-hosting the services gives you the flexibility to use transports other than HTTP.
WCF Backwards Compatibility

The purpose of WCF is to provide a unified programming model for distributed applications.
Backwards compatibility
WCF takes all the capabilities of the existing technology stacks while not relying upon any of them.
Applications built with these earlier technologies will continue to work unchanged on systems with WCF installed.
Existing applications are able to upgrade with WCF
New WCF transacted application will work with existing transaction application built on System.Transactions
WCF & ASMX Integration

WCF can use WS-* or HTTP bindings to communicate with ASMX pages
Limitations of ASMX:

An ASMX page doesnt tell you how to deliver it over the transports and to use a specific type of security. This is something that WCF enhances quite significantly.

ASMX has a tight coupling with the HTTP runtime and the dependence on IIS to host it. WCF can be hosted by any Windows process that is able to host the .NET Framework 3.0.

ASMX service is instantiated on a per-call basis, while WCF gives you flexibility by providing various instancing options such as Singleton, private session, per call.

ASMX provides the way for interoperability but it does not provide or guarantee end-to-end security or reliable communication.

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.