How does Apache, PHP, and SOAP work together? I just removed PHP. Recently, I used PHP's built-in SOAP to implement the RPC function on the server. I have read many examples of server. php, and these examples can also work, but I still have doubts. Generally, the server. php code is as follows: 1. & nbsp; create a class with several member functions. 2. & nbsp; call the SoapServer () function to create a service. 3. & nbsp; how does Apache, PHP, and SOAP work together?
I just removed PHP. recently I used PHP's built-in SOAP to implement the RPC function on the server.
I have read many examples of server. php, and these examples can also work, but I still have doubts.
The general server. php code is as follows:
1. create a class with several member functions.
2. call the SoapServer () function to create a service.
3. Register the functions in the class.
4. call the handle () function to process client RPC call requests.
5. after the handle () function returns, this service is complete.
If only one PC initiates a client request, the apache server can easily handle it. However, if there are thousands of client requests,
According to the above process, it is not necessary to create n service routines, destroy n routines, low efficiency can be imagined.
Maybe php does not work like this. how does apache and PHP process SOAP requests when receiving n (a large number of) service requests.
You just need to talk about the processing process.
------ Solution --------------------
Is to create n service routines, destroy n routines
However,
Low efficiencyThis conclusion is too arbitrary.
The web service uses the stateless http protocol. since it is stateless, it does not need a persistent object on the server.
Besides, the service created by SoapServer () is just a name, not a real service.
------ Solution --------------------
Reference:
Is to create n service routines, destroy n routines
However,
Low efficiencyThis conclusion is too arbitrary.
The web service uses the stateless http protocol. since it is stateless, it does not need a persistent object on the server.
Besides, the service created by SoapServer () is just a name, not a real service.
I do not agree with some of them.
Whether to put a persistent object on the server is unrelated to the stateless http protocol. after all, the server resources are limited, repeated "connection-disconnection" and "query-release" may cause unnecessary overhead. at this time, there is a persistent object to keep the data, it would be nice not to repeatedly request external resources.
By the way, I 'd like to ask the moderator for feedback: to improve the text editing experience of the forum, this is neither "What you see is what you get" nor "mainstream general", such as markdown or wiki, it's really hard to get started. I accidentally corrected the mistake and submitted it without any chance to correct it.