php webservice is a very heavy-duty specification. Its application protocol is SOAP. The underlying communication method it relies on is not only HTTP, but also SOAP over SMTP and SOAP over TCP. The HTTP protocol has a wide mass base and is easy to develop and debug. convenient.
Recommendation: "PHP Video Tutorial"
mentioned PHP webservice. It was relatively new to me before, because I had little contact with it, and I had never used it in almost any company. The only time I had used it seemed to be to access a third-party SMS channel, using SOAP|WSDL.
A very extreme statement that "webservice" is outdated is true:
1 WebService has many protocols, why is HTTP more popular?
WebService is a very heavy specification. Its application protocol is SOAP (Simple Object Access Protocol). The underlying communication method it relies on is not only HTTP, but also SOAP over SMTP, SOAP over TCP. Because the HTTP protocol has a broad mass base and is easy to develop and debug, it has become the most popular method in WebService.
Even many companies use HTTP for intranet communications. For example, applications call search engines. Solr is an example.
But HTTP is also a protocol with poor performance over TCP, because HTTP is based on TCP and has 3 handshakes. In addition, HTTP is a text transfer protocol (although binary attachments can also be transmitted, the business logic is still Text is used a lot), and there are many complex HEADERs. Therefore, people have invented some more efficient communication protocols for remote calls, such as ACE, ICE, Corba, and Taobao's HSF, but this is a topic for another time and I will not go into details. All you need to know is that the reason why HTTP is popular is that it is easy to use and has a broad mass base.
2 Why WebService is not as popular as RESTful API
WebService has been around for more than ten years. At first, IBM and Microsoft were more enthusiastic about promoting it, but it has always been tepid. On the contrary, XML-RPC, RESTful and remote calling methods that are simpler than RESTful have caught up from behind. Does it feel a bit like folk Spring killing official EJB?
The reason is that WebService is too bulky. The SOAP envelope is like a mother-in-law's foot wrap, smelly and long. Most developers can't bear it, so they have a simplified version called XML-RPC later became popular with Web2.0, and RESTful took the lead. I built a product 10 years ago, pure PHP JS, standard WebService. Even the WSDL I had to write a PHP program to generate. Fortunately, I was the only one to develop it. If it were a team collaboration, I would have been scolded a long time ago. Humanoid.
Later, even RESTful was despised, and everyone simply didn’t even bother to use PUT and DELETE, and used GET and POST directly.
At the same time, I have to say that this is only in the Internet field. The business logic of most companies is relatively simple, and the construction period is abnormally short (just like most Internet startups use rough and fast PHP instead of Relatively rigorous Java). In some areas where the business is complex and the stability and accuracy requirements are high (such as ERP, e-commerce, payment), WebService still has its place.
3 Why JSON is more popular than XML
It is also about ease of use. JSON is several Chang'an Streets more readable than XML, and the parsing rules are much simpler. There are too many rules when parsing XML, including illegal characters and exceptions. This is a fatal flaw for companies that pursue high development speed and low development thresholds.
The disadvantage of JSON is that it has less data type support and is imprecise. For example:
price:12580
In json, you cannot know whether the price is int, float or double.
So, as mentioned in the second article above, XML is more suitable in some areas with higher business requirements.
Finally, let’s talk about performance. The performance of JSON is higher than that of XML. In addition, there is no performance difference between WebService based on XML and HTTP, and RESTful API based on JSON.
XML performance is so bad, there is a special CPU called XML Accelerator, which provides hardware acceleration for XML parsing.
The above is the detailed content of What does php webservice mean?. For more information, please follow other related articles on the PHP Chinese website!

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software