Era Technology for Better Life
What is a web service?
The W3C describes a Web Service as "a software system designed to support interoperable machine-to-machine interaction over a network". This means that a connection can be established between two computers regardless of operating system or programming language. As long as both sides recognize the protocol used, they can communicate.
In short, a web service allows you to connect to it and perform queries on the data and functions that it holds just as if you were using the service on your own server. The service could be anything from a post code validation service to a blog that allows you to edit the contents from elsewhere.
Types of web service
There are a number of ways in which you can build a web service.
Remote procedure call
RPC web services provide a set of functions that interface to the application directly. Usually these services are simply a number of functions that have been set to do one task. This style of web service may be familiar to many web developers as it mimics the way models might work. The only difference is that the call is happening across the Internet.
CodeIgniter gives us a great set of libraries for using RPC, in the form of the XML-RPC Client and Server Libraries. XML-RPC is a specification and a set of implementations that allows software to communicate with a server by using the
XML as the request.
Representational State Transfer
REST is a method which, rather than defining functions that can be used in applications, defines a resource—a URI—to be used to perform actions on.
REST simply uses the assets that the HTTP protocol has. By using GET, POST, PUT, and DELETE HTTP methods, we can distinguish between the different types of requests and deal with them accordingly.
RESTful web service
The first step in building a RESTful web service is to define what it is we want to provide a service to. To keep things simple, we'll create the web service for a blog. We'll be able to add, edit, delete, and get a list of all of the blog posts.
LavivaStore
0 komentar:
Post a Comment