Home >Backend Development >PHP Tutorial >PHP implements Web Service_PHP tutorial
1. OAuth
The OAUTH protocol provides a secure, open and simple standard for user resource authorization. The difference from previous authorization methods is that OAUTH authorization will not allow third parties to access the user's account information (such as username and password)
2. SCA
The Service Component Framework (SCA) provides a programming model for building service-oriented application systems. Its core concept is services and their associated implementations. Services are defined by interfaces, which contain a set of operations. Service implementations can reference other services, called references. Services can have one or more properties, which are data values that can be configured externally.
3.SOAP
Simple Object Access Protocol (SOAP) is a lightweight, simple, XML-based protocol designed to exchange structured and solidified information on the WEB. One of the three elements of WebService (SOAP, WSDL (Web Services Description Language), UDDI (Universal Description Discovery and Integration)), soap is used to transmit the format of information, WSDL is used to describe how to access specific interfaces, and uddi is used to manage and distribute , To query the specific implementation of webService, you can search for simple examples of Web Services
Opening method:
Windows system
Just add a line to the PHP configuration file php.ini: extension=php_soap.dll.
Unix and Linux systems
You must bring the switch parameter when configuring and compiling PHP: --enable-soap
Use the methods provided by the SOAP-extended SoapServer class and SoapClient class to write Web services and their client programs
4. XML-RPC
XML Remote Procedure Call, XML remote method call. It is a set of specifications and a series of implementations that allow programs running in different operating systems and different environments to implement Internet-based procedure calls. This remote procedure call uses http as the transport protocol and XML as the encoding format for transmitting information. The definition of XML-RPC is kept as simple as possible, but at the same time it can transmit, process, and return complex data structures.
SOAP example:
Person.php
soap_server.php
soap_client.php
This article is an original article by a specially invited author of PHPChina. It may not be reproduced without permission. If you need to reprint, please contact shixiang#phpchina.com (# is replaced by @)