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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: