Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asmx to WCF or Web API

I have an application that I'm building and for the moment, I built some web services using ASMX. In the end, the application will be deployed on azure. The web services are really simple in that all they do is call a class in the AppCode folder that handles all the work.

Is it going to be better/easier/faster/more performant to move my web services to WCF or to Web API?

Thanks for your suggestions.

PS: I want to add that the web services will need to work in HTTPS. At the moment, they're on HTTP because I'm in development mode.

like image 563
frenchie Avatar asked Apr 16 '12 10:04

frenchie


1 Answers

One-liner: if you have already got a working code and it is risky to move it to another technology stay with the working code.

Depends who is answering.

Web API embraces HTTP and gives you flexibilities not possible with ASMX and WCF. If you care about HTTP, content-negotiation, media types and you need your service to be called from any client (including AJAX) then Web API.

If you need to be able to use WS* security standards (e.g. using X509 certificates, ADFS, etc), possibly change your binding, serve to different clients using different bindings, extensibility, etc use WCF.

If you already have a working code, and all you care about is RPC and your clients are always going to use ASMX then stick with ASMX.

Performance

No benchmark but my gut feeling, in descending order: Web API, ASMX, WCF

Easier

In descending order: ASMX (since you know it), Web API, WCF

Faster development

If you know them all, Web API and ASMX then WCF


PS: it is good to pick up new technologies. The way things are going (and since you are already moving to Azure) it is important to invest on new technologies.

like image 102
Aliostad Avatar answered Oct 14 '22 04:10

Aliostad