Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have heard about Web Services and Web API's a lot, is there any difference between them or are the same?

share|improve this question
    
Duplicate of this [stackoverflow.com/questions/808421/api-vs-webservice]? –  Abimaran Kugathasan Jan 21 '11 at 14:24
    
See also StackOverflow: What is the difference between a web API and a web service? –  hippietrail Mar 28 at 14:07

3 Answers 3

up vote 19 down vote accepted

Web Services - that's standard defined by W3C, so they can be accessed semi-automatically or automatically (WSDL / UDDI). The whole thing is based on XML, so anyone can call it. And every aspect of the service is very well defined. There's parameters description standard, parameter passing standard, response standard, discovery standard, etc. etc. You could probably write 2000 pages book that'd describe the standard. There are even some "additional" standards for doing "standard" things, like authentication.

Despite the fact that automatic invoking and discovery is barely working because clients are rather poor, and you have no real quarantee that any service can be called from any client.

Web API is typically 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 text file 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 and you'll define everything else.

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

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

share|improve this answer
1  
thanks @Slawek, u explained it better..and thanks for the example too... –  Harish Kurup Jan 22 '11 at 5:50

A web service allows for machine to machine communications over HTTP. A web API is a subset of web services that use REST conventions (Summarizing the Wikipedia article). The concepts definitely overlap. I believe that there is still a link in most people's minds of web service -> SOAP/XML-RPC which can unnecessarily confuse matters.

In the end, you'll have to ask a few questions to clarify what people mean. Not everyone makes a distinction or uses the terms interchangeably.

share|improve this answer
    
Thank u @Berin Loritsch, yeah thats right it causes confusion between API's and WS.. –  Harish Kurup Jan 22 '11 at 5:55

Web services is a defined architecture and approach to a problem domain as stated by the W3C.

Web services provide a standard means of interoperating between different software applications, running on a variety of platforms and/or framework

Web API is a concept and abstracts the means on how the concept is implemented.

In layman's terms...web API is to motor whereas WS is to BMW N53.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.