Introduction to PHP Web Services: PHP, JavaScript, MySQL, SOAP, RESTful, JSON, XML, WSDL
By Imran Ghani
()
About this ebook
I chose PHP to write this book because PHP is ready to develop RESTful and SOAP webservices. PHP is platform independent and widely used in developing data-driven Websites.
Related to Introduction to PHP Web Services
Related ebooks
PHP & MySQL Practice It Learn It Rating: 3 out of 5 stars3/5PHP and MongoDB Web Development Beginner’s Guide Rating: 0 out of 5 stars0 ratingsPHP Reactive Programming Rating: 0 out of 5 stars0 ratingsThe PHP Workshop: Learn to build interactive applications and kickstart your career as a web developer Rating: 0 out of 5 stars0 ratingsLearn PHP in 24 Hours Rating: 0 out of 5 stars0 ratingsLearning PHP 7 High Performance Rating: 0 out of 5 stars0 ratingsPHP 7 Programming Blueprints Rating: 0 out of 5 stars0 ratingsAJAX and PHP: Building Responsive Web Applications Rating: 4 out of 5 stars4/5JavaScript and JSON Essentials Rating: 5 out of 5 stars5/5HTML5, JavaScript, and jQuery 24-Hour Trainer Rating: 2 out of 5 stars2/5PHP for Beginners: Your Guide to Easily Learn PHP In 7 Days Rating: 4 out of 5 stars4/5PHP Examples Part 4 Rating: 0 out of 5 stars0 ratingsLearning jQuery 3 - Fifth Edition Rating: 0 out of 5 stars0 ratingsModern JavaScript Applications Rating: 0 out of 5 stars0 ratingsLearn PHP Programming in 7Days: Ultimate PHP Crash Course For Beginners Rating: 3 out of 5 stars3/5Introduction to PHP, Part 1, Second Edition Rating: 0 out of 5 stars0 ratingsJump Start PHP Environment: Master the World's Most Popular Language Rating: 0 out of 5 stars0 ratingsJavaScript: Tips and Tricks to Programming Code with Javascript: JavaScript Computer Programming, #2 Rating: 0 out of 5 stars0 ratingsExpert PHP 5 Tools Rating: 4 out of 5 stars4/5REST API Design Control and Management Rating: 4 out of 5 stars4/5Practical C++ Backend Programming: Crafting Databases, APIs, and Web Servers for High-Performance Backend Rating: 0 out of 5 stars0 ratingsPHP 8: The Modern Web Developer's Guide Rating: 0 out of 5 stars0 ratingsJavaScript: Beginner's Guide to Programming Code with JavaScript Rating: 5 out of 5 stars5/5JavaScript and AJAX For Dummies Rating: 4 out of 5 stars4/5PHP for Beginners Rating: 0 out of 5 stars0 ratingsPractical Web Development Rating: 5 out of 5 stars5/5Introducing PHP 7/MySQL Rating: 0 out of 5 stars0 ratings
Internet & Web For You
Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5The $1,000,000 Web Designer Guide: A Practical Guide for Wealth and Freedom as an Online Freelancer Rating: 4 out of 5 stars4/5How to Be Invisible: Protect Your Home, Your Children, Your Assets, and Your Life Rating: 4 out of 5 stars4/5Content Chemistry: The Illustrated Handbook for Content Marketing Rating: 5 out of 5 stars5/5Six Figure Blogging Blueprint Rating: 5 out of 5 stars5/5Coding For Dummies Rating: 5 out of 5 stars5/5Cybersecurity For Dummies Rating: 5 out of 5 stars5/5Tor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5Social Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5Beginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratingsPython: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5Cybersecurity All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsNo Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5The Gothic Novel Collection Rating: 5 out of 5 stars5/548 Really Useful Web Sites Rating: 5 out of 5 stars5/5How To Make Money Blogging: How I Replaced My Day-Job With My Blog and How You Can Start A Blog Today Rating: 4 out of 5 stars4/5The Digital Marketing Handbook: A Step-By-Step Guide to Creating Websites That Sell Rating: 5 out of 5 stars5/5HTML in 30 Pages Rating: 5 out of 5 stars5/5Deep Dive: Exploring the Real-world Value of Open Source Intelligence Rating: 0 out of 5 stars0 ratingsHow To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5COMPUTER SCIENCE FOR ROOKIES Rating: 0 out of 5 stars0 ratingsReady, Set, Brand!: The Canva for Work Quickstart Guide Rating: 5 out of 5 stars5/5More Porn - Faster!: 50 Tips & Tools for Faster and More Efficient Porn Browsing Rating: 3 out of 5 stars3/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5
Reviews for Introduction to PHP Web Services
0 ratings0 reviews
Book preview
Introduction to PHP Web Services - Imran Ghani
Registry
Preface
These days, web services technology is very important and quite convenient. I have taught web services course at the undergraduate level. While teaching web services at the undergraduate level, I realized that there is a lack of a textbook that is easy to understand for students and beginners. Indeed, there are a number of books available on this topic, but those books are more high-level books mostly written by developers for developers. They lack details and students or beginners have no choice but to spend a lot of time searching on Google to understand the basics concepts. During a single semester, it is hard for students to spend too much time on the internet. Therefore, I thought it would be useful to sit and write a book that is easy to understand for undergraduate students and beginners.
The book mainly covers RESTful, RPC, and SOAP concepts. I provide working examples with code throughout the book. The code and examples are in PHP, JavaScript, JSON, XML, MySQL, and WSDL. Each example has its associated screenshots, so that you could match your output with the correct output I provide.
The book has ten chapters that cover the latest topics including HTTP verbs, Microservices, Webhook, WSDL, and others.
I chose PHP to write this book because PHP is ready to develop RESTful and SOAP web services. PHP is platform-independent and widely used in developing data-driven websites. In addition, I worked as a PHP developer for more than five years and have good hands-on coding in this language.
I hope this book will help undergraduate students and beginners understand the state-of-the-art concepts in RESTful and SOAP web services.
Code for Instructors: If you are an instructor and want all the code used in the book, please send an email to [email protected] using your official email address. In your email, please mention name of your institute along with your official web page where your information is provided.
Chapter One
Basics of PHP and MySQL
Traditional Website Model: Human-to-Machine (H2M) Communication
A traditional website model is dependent on human interaction. It is based on client-server architecture, which usually has three-tier architecture involving client, web server, and database as shown in Figure 1.1.

Figure 1.1: Traditional three-tier web architecture
It means that usually a human initiates the actions. For example, if you (as a user) want to search for good food in your town, then you will have to key-in certain words in Google or in any other front-end website using Chrome/IE (client), for example. The browser will send your search request to a web server (Apache, IIS etc.) to the back-end. The web server will process the request using PHP, ASP.NET or other languages. Then, the request is sent to a database engine (MySQL, SQL Server etc.). If the database has the location of the restaurant in its records, it will return the result to the web server that will ultimately return the response to your browser. This communication takes place using HTTP/HTTPS protocol. In some applications, SMTP or FTP is also used behind the scenes. This process is shown in the following Figure 1.2.
It involves these components as follows:
Client: A human user with a browser such as Chrome, IE, or others
Web server: Such as Apache, IIS, Nginx, Xitami, or others
Database: Such as MySQL, SQL Server, NoSQL, Oracle, or others

Figure 1.2: Client-Server communication
Before going deeper into web services, I think it is appropriate to discuss and create a simple website using HTML, PHP, and MySQL. This would help those who have never created a website using PHP and MySQL.
Your First PHP and MySQL Website
Let’s create your first PHP and MySQL website. Before we create your first PHP website, we need to install XAMPP or WAMP. To do so, follow these steps to start:
If you have Windows on your laptop or PC, then download XAMPP and install it in your C: drive: In this book, I will show you examples using Windows. I have installed XAMPP v3.2.2 on my Windows PC.
a. Download XAMPP from