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 Reactive Programming Rating: 0 out of 5 stars0 ratingsHTML5, JavaScript, and jQuery 24-Hour Trainer Rating: 2 out of 5 stars2/5Learn PHP in 24 Hours Rating: 0 out of 5 stars0 ratingsPHP & MySQL Practice It Learn It Rating: 3 out of 5 stars3/5JavaScript and JSON Essentials Rating: 5 out of 5 stars5/5Learning PHP 7 High Performance Rating: 0 out of 5 stars0 ratingsPHP for Beginners: Your Guide to Easily Learn PHP In 7 Days Rating: 4 out of 5 stars4/5Expert PHP 5 Tools Rating: 4 out of 5 stars4/5PHP 7 Programming Blueprints Rating: 0 out of 5 stars0 ratingsPHP and MongoDB Web Development Beginner’s Guide Rating: 0 out of 5 stars0 ratingsLearn PHP Programming in 7Days: Ultimate PHP Crash Course For Beginners Rating: 3 out of 5 stars3/5AJAX and PHP: Building Responsive Web Applications Rating: 4 out of 5 stars4/5The PHP Workshop: Learn to build interactive applications and kickstart your career as a web developer Rating: 0 out of 5 stars0 ratingsRuby on Rails Web Mashup Projects Rating: 0 out of 5 stars0 ratingsLearning jQuery 3 - Fifth Edition Rating: 0 out of 5 stars0 ratingsPHP 8: The Modern Web Developer's Guide Rating: 0 out of 5 stars0 ratingsREST API Design Control and Management Rating: 4 out of 5 stars4/5RESTful Web API Design with Node.js - Second Edition Rating: 1 out of 5 stars1/5Modern JavaScript Applications Rating: 0 out of 5 stars0 ratingsIntroducing PHP 7/MySQL Rating: 0 out of 5 stars0 ratingsJavaScript and AJAX For Dummies Rating: 4 out of 5 stars4/5JavaScript: Beginner's Guide to Programming Code with JavaScript Rating: 5 out of 5 stars5/5PHP MySQL Development of Login Modul: 3 hours Easy Guide Rating: 5 out of 5 stars5/5Javascript For Beginners: Your Guide For Learning Javascript Programming in 24 Hours Rating: 3 out of 5 stars3/5Jump Start PHP Environment: Master the World's Most Popular Language Rating: 0 out of 5 stars0 ratingsBuilding RESTful Python Web Services Rating: 4 out of 5 stars4/5
Internet & Web For You
Coding For Dummies Rating: 5 out of 5 stars5/5The Beginner's Affiliate Marketing Blueprint Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python: Learn Python in 24 Hours 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/5Social Engineering: The Science of Human Hacking Rating: 3 out of 5 stars3/5The $1,000,000 Web Designer Guide: A Practical Guide for Wealth and Freedom as an Online Freelancer Rating: 4 out of 5 stars4/5Notion for Beginners: Notion for Work, Play, and Productivity 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/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5More Porn - Faster!: 50 Tips & Tools for Faster and More Efficient Porn Browsing Rating: 3 out of 5 stars3/5JavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5No Place to Hide: Edward Snowden, the NSA, and the U.S. Surveillance State Rating: 4 out of 5 stars4/5How To Start A Profitable Authority Blog In Under One Hour Rating: 5 out of 5 stars5/5Cybersecurity For Dummies Rating: 5 out of 5 stars5/5How to Disappear and Live Off the Grid: A CIA Insider's Guide Rating: 0 out of 5 stars0 ratingsContent Chemistry: The Illustrated Handbook for Content Marketing Rating: 5 out of 5 stars5/5Tor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5How to Build and Design a Website using WordPress : A Step-by-Step Guide with Screenshots Rating: 0 out of 5 stars0 ratingsThe 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/5TikTok Dropshipping 101: A Beginner's Guide to Launching a Profitable Online Business Rating: 0 out of 5 stars0 ratingsUltimate guide for being anonymous: Avoiding prison time for fun and profit Rating: 5 out of 5 stars5/5SEO For Dummies Rating: 4 out of 5 stars4/5Instagram For Dummies Rating: 0 out of 5 stars0 ratingsBeginner's Guide To Starting An Etsy Print-On-Demand Shop Rating: 0 out of 5 stars0 ratings
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