A Representational State Transfer webservice or REST service is another kind of webservice standard. REST does not necessarily use WSDL or SOAP messaging, but can be called directly by using methods like POST and GET and other HTTP operations. So we can call a REST service directly from a URL unlike SOAP. This makes testing a lot easier.
APEX developers can use REST webservices and the wizard interface offers many possibilities for creating the call.
In this recipe, we are going to use the opportunities that APEX offers us to create a page based on a public REST webservice—the popular photo application Flickr.
Before starting this tutorial, create a Flickr account at http://www.flickr.com and request an API key.
In the Input parameters, we are going to enter three parameters.
method
and click Add Parameter. api_key
and click Add Parameter. user_id
and click Next.Now we are ready to test if everything is OK.
After a little wait a Response is returned as an XML file, containing all publicly available pictures for the selected user.
There are a lot of other differences between REST and SOAP. Both of them have advantages. Some of these for REST are:
The main advantages of SOAP are:
The industry lately seems to be in favor of using REST for internet services. A lot of the larger companies (such as Twitter, Google, and Amazon) have chosen this standard for their webservices. SOAP still seems to be the standard for enterprise applications. But choosing REST or SOAP in a project is completely dependant on the specifications of that project.
3.139.97.53