What is Web Service?

Web Services is a generic umbrella that describes how disparate systems can integrate with each other over the web.
Most major sites offer some form of web services:
– Amazon
– FedEx
– eBay
– PayPl
– del.icio.us

Why use Web Services?

  • Someone else has data you need
  • Easier than scraping pages also more reliable
  • Automate processes
  • Provide additional information to your clients

REST

  • Representational State Transfer
  • Requests look like filled out forms, can use either GET or POST
  • Response is an XML document
  • Request and Response is defined by the service provider
  • Very simple and popular

REST Request
http://library.example.com/api.php?devkey=123&action=search&type=book&keyword=style

After the request, we will get the answer or response as an XML file. we can simple parse them using PHP’s SimpleXMLElement (SAX API) or DOM API to retrieve data

Leave a Reply