15

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.

frenchie
  • 51,731
  • 109
  • 304
  • 510

1 Answers1

18

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.

EBarr
  • 11,826
  • 7
  • 63
  • 85
Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • Hi! The WSs are working in ASMX because they're in development. I want to move out of ASMX. Thanks for the security considerations you mentioned; I need to make them work in HTTPS. – frenchie Apr 16 '12 at 13:05
  • 1
    @frenchie in this case, I would go for Web API. – Aliostad Apr 16 '12 at 13:11
  • ASMX service works well via HTTPS on Azure. You will just need to add endpoint and assign it with your certificate. I am not voting for using ASMX in the production, but just to let you know that it _can_ work. – Ivan Sokalskiy Apr 18 '12 at 20:27
  • 1
    @Aliostad I'm already reading your book. but a friend asked me : well I can return json also with asmx so what is the benefit of webapi besides selfhosting and content negotiation...? – Royi Namir Oct 20 '14 at 10:14