How Apache, PHP, and soap work together

Source: Internet
Author: User
How Apache, PHP, and soap work together
I have just released PHP, I recently use PHP's own soap to implement the server RPC function.
Looking at a lot of server.php examples, these examples work, but I still have questions.
The code for general server.php is this:
1. Create a class with several member functions.
2. Call function SoapServer () to create a service.
3. Register the functions in the class.
4. Call the handle () function to process the client's RPC call request.
5. After the handle () function returns, this service is considered to be the end.

The Apache server is easy to handle if only one PC initiates client requests. But if there are thousands of client requests,
According to the above process, it is not to create N-times service routines, destroy N routines, the inefficiency imaginable.
Maybe PHP doesn't work this way, so how does Apache and PHP handle SOAP requests when they receive N (a lot of) service requests?
Just a little bit about the process.

------Solution--------------------
is to create n-times service routines and destroy N routines
But Low efficiency imaginableThis is a very arbitrary conclusion.
The Web service uses a stateless HTTP protocol that, since it is stateless, does not require persistent objects on the server side
Besides, SoapServer () creating a service in a service is just a name, not a service in the real sense.
------Solution--------------------
Reference:
is to create n-times service routines, destroying N-Times routines
But, inefficient, this conclusion is too arbitrary.
The Web service uses a stateless HTTP protocol that, since it is stateless, does not require persistent objects on the server side
Besides, SoapServer () creating a service in a service is just a name, not a service in the real sense.


Not quite agree with part of the point.
Whether to put a persistent object on the service side is not related to the HTTP protocol stateless, after all, the server resources are limited, the repeated "connect-disconnect", "query-release" will cause unnecessary overhead, there is a persistent object to maintain the data, It's wonderful not to ask for external resources again and again.

By the way moderator help feedback: Improve the text editing experience of the forum, the present is neither "WYSIWYG" is not "mainstream general" such as Markdown,wiki, really difficult to get started, accidentally changed the wrong after the submission and did not correct the opportunity.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.