What are web services APIs, how do you create them, and why?

What is the purpose of web services?

I mean that not all web applications are a web service?

also why do people create web services APIs? does this allow the developer to use the functions of the website? sort of like facebook and youtube?

Is it possible to create an API for a web service where you can use C ++ or VB to use functions? so can someone create a desktop application based on your web application API?

How do you create a web service API and a web service?

+4
source share
5 answers

What is the purpose of web services?

Allow easy consumption of services using web technologies? I mean, you can potentially write your application in order to do what the browser does (how many stackoverflow apps have been done in the past)

Problems:

it is much more complicated than using the API

Since there is no API, changes to the website will crash the application (while the responsible API will allow you to use the old version)

I do not mean all web services web applications?

It's my pleasure. A web application is a special application intended for use by a web browser (Firefox, Chrome, etc.), while a web service is intended for use by another application.

You can use the web service in almost any programming language.

Also, why do people create web services APIs? Does this allow the developer to use the functions of the site? sort of like facebook and youtube?

Not the functionality of the website, but allows them to create their own applications that use some of the functionality of this website.

For example, YouTube allows you to upload videos using the API, otherwise you will have to "simulate" the publication of HTTP, which can be problematic.

Thus, some tools offer the ability to "upload" your video directly from the application.

Is it possible to make an API for a web service where you can use C ++ or VB to use functions?

That is the point, among other programming languages.

therefore, can someone make a desktop application based on the API of your web application?

Exactly!!!

Here is an example Object-C application that I use for Twitter ( tweetie http://www.atebits.com/tweetie-mac/ )

alt text
(source: cachefly.net )

How do you create a web service API and a web service? *

This is not much different than creating an API for the internal work / product / library.

You must determine what you intend to offer (your public interface, your services)

Create a list of input / output parameters and exchange formats (XML, json, text / plain, YAML, etc.)

And finally, provide an endpoint on the Internet (or why not an intranet)

Web services are more difficult to manage than regular APIs, you need to check security problems, workload, etc.

To see the working API, refer to the mentioned Nathan here.

+2
source

A web service is a type of program running on a web server, created specifically for use by other programs, by sending information requests to it in a specific format (usually some information wrapped in XML).

The part of the API (application programming interface) is usually a class or set of classes that have code that knows how to format information for requests from a web service - so your program only needs to make normal function calls to API classes.

This simplifies the use of the web service.

Here is an example of how to do this and use it for .NET languages: http://www.codeproject.com/KB/XML/BeginnerWebService.aspx

Any program that uses a web interface for its interface is a web application, for example, this site or Facebook.

An application service provider is a company that helps you write web applications ( http://en.wikipedia.org/wiki/Application_service_provider ) or provide other services.

+1
source

Basically, there are two different types of web services: one of which is based on SOAP, and the other is REST.

Access to any of them can be obtained using desktop applications. I have written applications, such as screensavers, that will interact with the server through both of these types of web services.

The API is useful so that people can write applications, as you mentioned, to use these services, since without using their applications these web services are pretty useless.

A SOAP-based web service is basically just a web application that sends and receives using the xml message format following the standard.

A REST-based web service is a cgi-based application that is similar to using an html form element, usually using GET, but if you are doing something that could be disruptive or changing databases, you will want to use POST.

You can write applications using these APIs in any language, which is an advantage, because then you can choose which language is best for the server side, and this does not affect what you do on the client side.

How to create a web service will depend on which of the two main types you want to create, and in which language you want to use.

+1
source

Typically, an API is created to create a program that interacts with a site, such as the Twitter API, which you can use the Twitter features in the program.

0
source

If you have ever developed applications that rely on libraries or DLLs in terms of window programming. Think of a web service as a dll hosted on a web server that has a direct url. In this way, your application or website can read the data displayed from the URL, which you can use as function calls.

Web services pass data through xml, as soon as the language you are writing the application can read xml, you can write it to make calls to the web service, which passes the parameters and function name to the service, and then, waiting for the return value, your application reads data from xml.

0
source