The Difference between REST and SOAP Web Services
There are many differences between REST and SOAP Services. First off, SOAP uses envelopes combined with the HTTP POST request. REST communicates directly with the URL using a HTTP GET request. This should make the whole communication process go a little quicker. It is also common for SOAP vendors to route all their HTTP POST requests through one URL. This is now creating a place for a bottleneck, depending on how much traffic there is at any given time. One feature that REST uses is the ability to use specific URL’s to get detailed information on different searches, whereas SOAP doesn’t use links at all. This ability is what sites like Amazon.com uses to give detailed information about their products to their customers or potential customers. SOAP users are forced to find the information elsewhere, which would be a headache to most online shoppers.
REST, like SOAP can also be used with Proxy Servers. The difference between the two is how this is implemented. Using REST, the request is made, but the proxy server recognizes that it is not allowed, thus not fulfilling the request. SOAP on the other hand doesn’t use specific URL’s so the Proxy Server is unsure what to do with the request. Therefore, companies that want to restrict certain areas of the Internet would use the REST/Proxy Server combination to keep their employees in check.
REST also speeds up requests by caching information more quickly. As the request is being processed, it is determined if it is cacheable. If it is, servers will make a local copy, thus speeding up the whole process for the user. SOAP servers do not know what is being requested buy the user, so there is no caching possible using SOAP.
All in all, with REST using URL’s to keep track of information and to help use the user delve deeper into their search of interest, it seems to be a better option to use in most cases.
Exploring RESTful API
I wanted to find a website that I was familiar with when searching for this RESTful API question. I figured that way I might be able to understand what I was reading about better. I chose the website www.facebook.com. Facebook is networking website that started off only allowing people with designated .edu email addresses. It has since opened its doors to let anyone in, acting along the same lines as Myspace. Within this vast website there are many different commands or methods that must be followed.
Starting off, the user has to enter their username and password which will create a token which will be checked certain records. There could also be a number of error messages that could be displayed if there is an error. Facebook will then take the user to a designated URL, which is a feature of REST. After the token is created, a getsession command is started which will return the session key that was created after the user signed in.
Facebook also has the ability to show people who your friends are. It does this using an array which compares to profiles and determines if each of them has each other as a friend. A list of friend_info is then returned if the situation is true. A big feature of Facebook is the ability to create a photo album for your friends to view. This is done by calling the Facebook API photos.createAlbum, photos.upload, and photos.addTag. The pictures are then able to be tagged, using the photos.addTag, which creates boxes over individual faces. These boxes are then linked to that persons specific URL of their Facebook profile. if they have one.
The API of Facebook makes it very easy to call these functions. You simply click and type your way to whatever meets you desire. Luckily for us, each command that is requested of Facebook is translated into meaningful information for the computers. We simply fill in text boxes and forms.
One nice feature that Facebook offers is the ability to use their API Test Console. If you have an account, you can call all of their methods, and it will give you the output code from each method. It doesn’t just give you generic code either. It will allow you to see the code that it would actually use when calling information from your account. That way you can see specifically how it works.
While this website doesn’t serve a purpose to everyone who has access to the web, it serves a great purpose to many college students. This program allows people to get in touch with old friends, stay in touch with current friends, and view other people’s profiles who are in the same network. This is just one of the many online communities that have become popular in the past years. REST is important to Facebook because as you are searching for your lost friend, it must have the ability direct you to specific URL’s as necessary, something SOAP is incapable of doing.
Reference:
http://developers.facebook.com/documentation.php