Web Service VS Web API

-- ASP.NET 2012. 8. 8. 17:20
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

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 APIMVC만든다고하니 ASP.NET Web API MVC나중에공부하기로하고이렇게정리하려고한다.

'-- ASP.NET' 카테고리의 다른 글

asp.net encoding 환경설정  (0) 2012.09.06
Web Role Remote IP Filtering  (0) 2012.09.04
ajax password strength check  (0) 2012.06.21
ASP.NET Ajax Accordion  (0) 2012.06.21
마스터페이지 (master page)  (0) 2012.06.21
posted by 어린왕자악꿍