Web Service VS Web API -- ASP.NET



ASP.NET WEB API라는 것을 알게 되어 이에 대해 공부를 하던 중에 아래와 같은 질문이 생겼다.

 

WebAPI 정확히 무엇인가?

 

그래서 Web API 대해 정의를 찾아보니 아래와 같았다.

 

WebAPI 웹을 통해 API 제공하여 프로그램적인 기능을 외부에서 손쉽게 사용하도록 하여 관련 서비스를 개발할 있도록 제공하는 공개된 API이다.

 

정의를 보고 나니 다른 질문이 생겼다.

 

WebService Web API 다른 점이 무엇인가?

 

 

A Web service isa method of communication between two electronic devices over the Web (Internet).

 

Web API isa development in Web services (in a movement called Web2.0) where emphasis has been moving away from SOAP based services towards representational state transfer (REST) based communications.


참고 : http://en.wikipedia.org/wiki/Web_service

 

 

Web Services- that's standard defined by W3C, so they can be accessed semi-automatically orautomatically (WSDL / UDDI). The whole thing is based on XML, so anyone cancall it. And every aspect of the service is very well defined.


There'sparameters description standard, parameter passing standard, response standard,discovery standard, etc. etc. You could probably write 2000 pages book that'ddescribe the standard. There are even some "additional" standards fordoing "standard" things, like authentication.


Despite thefact that automatic invoking and discovery is barely working because clientsare rather poor, and you have no real quarantee that any service can be calledfrom any client.


Web API istypically done as HTTP/REST, nothing is defined, output can be eg. JSON/XML,input can be XML/JSON/or plain data. There are no standards for anything =>no automatic calling and discovery. You can provide some description in textfile or PDF, you can return the data in Windows-1250 instead of unicode, etc.


For describing the standard it'd be 2 pages brochure with some simple info andyou'll define everything else.

Web isswitching towards Web API / REST.


Web Services are really no better than WebAPI. Very complicated to develop and they eat much more resources (bandwidtchand RAM)... and because of all data conersions(REQUEST->XML->DATA->RESPONSE->XML->VALIDATION->CONVERSION->DATA)very slow.


Eg. InWebAPI you can pack the data, send it compressed and un-compress+un-pack on theclient. In SOAP you could only compress HTML request.


참고 : http://programmers.stackexchange.com/questions/38691/difference-between-web-api-and-web-service


 

위의 글을 찾아보고 내린 결론은 SOAP WebService (Soap WebService만들기 테스트) 전통적인 Web Service라고 하고, Web API Restful (WCF Restful WebService)으로 봐야한다는 것이다.

 

(물론 위의 결론은 틀릴 있으므로 빨간색으로 처리해두니 지나가시는 나그네님 중에서 정확히 아시는 분이 있다면 조언 부탁합니다. 두 개념의 비교 자체가 우스운 일이 아니길 바라면서...)

 

Restful 위의 예에서는 WCF 만들었는데, ASP.NET Web API MVC 만든다고 하니 ASP.NET Web API MVC 나중에 공부하기로 하고 이렇게 정리하려고 한다.


덧글

댓글 입력 영역