Chapter 17 web
Chapter 17 web
Web Services
Chapter 17
3 JSON
4 Overview of
Web Services
5 Consuming
Web Services
in PHP
6 Creating Web
Services
7
Asynchronous
Web Services
XML OVERVIEW
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
XML Overview
XSLT is an XML-based
programming language
that is used for
transforming XML into
other document
formats
XML PROCESSING
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
XML Processing
Two types
Less “automatic”
More Verbose
JSON
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
JSON
From trendsmap.com
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
An Example Web Service
More details
From trendsmap.com
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
An Example Web Service
The Response
$request = constructFlickrSearchRequest('Athens');
$response = file_get_contents($request);
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
A Flickr Example
Use file get contents
Once our program has retrieved the latitude and longitude, the
program then will use the GeoNames web service’s. This request
will take the following form:
http://api.geonames.org/findNearbyPOIsOSMJSON?
lat=43.6520004&lng=-79.4082336&username=your-username-
here
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Consuming JSON Services
A complicated example with 2 services
Output headers
3 JSON
4 Overview of
Web Services
5 Consuming
Web Services
in PHP
6 Creating Web
Services
7
Asynchronous
Web Services