Please ask the great God, my company's current project needs to get the member's shopping points, but the new Integration query program built on another platform, I need to through the SOAP interface to obtain the most recent integration data.
but the speed of bulk calls to SOAP query integralswill be subject to significant restrictions.
the new requirement of the current query is to obtain the user information of an integration interval (user data information in my company, the other company's data sheet does not establish any index, each time the point query is linked to the query to get points ...) [-_-a little tragedy]. Humbly consult. Is there any good way to improve the speed of the query ...
The PHP functions that call soap are as follows:
true, 'exceptions' => true)); $request = $connect->__soapCall('getCustomerScore', array(array('custId' => $custId))); $response = json_decode($request->getCustomerScoreResult, true); if (empty($response['error'])) { $score = json_decode($response['scoreList'][0], true); return $score['scoreBalance']; } else { return false; } }
After querying the integration, I query the user's basic information through the local database, and then use the associative array, which can be a little faster now.
However, if the query volume continues to become larger, the speed will be greatly reduced.
Reply content:
Please ask the great God, my company's current project needs to get the member's shopping points, but the new Integration query program built on another platform, I need to through the SOAP interface to obtain the most recent integration data. However, the speed of bulk calls to SOAP query points will be greatly limited.
the new requirement of the current query is to obtain the user information of an integration interval (user data information in my company, the other company's data sheet does not establish any index, each time the point query is linked to the query to get points ...) [-_-a little tragedy]. Humbly consult. Is there any good way to improve the speed of the query ...
The PHP functions that call soap are as follows:
true, 'exceptions' => true)); $request = $connect->__soapCall('getCustomerScore', array(array('custId' => $custId))); $response = json_decode($request->getCustomerScoreResult, true); if (empty($response['error'])) { $score = json_decode($response['scoreList'][0], true); return $score['scoreBalance']; } else { return false; } }
After querying the integration, I query the user's basic information through the local database, and then use the associative array, which can be a little faster now.
However, if the query volume continues to become larger, the speed will be greatly reduced.
1. I do not know whether the SOAP service provides you with other methods of invocation, see you in the example is based on the user to query their corresponding points, because your needs are based on the integration segment to query the user, if there is a similar getcustomerbyscore () method may be more convenient to call, Your current method should be to traverse all users, if there is a method based on the score query user collection, the amount of data should be reduced a lot.
2. If the other party's service single request time is very long, there is no God horse method-_-[Find the eldest brother see can talk]
3. If your member points information is not so need real-time, you can use Cronjob and other timed run, the user's member information temporarily stored in your local, so that the possibility of further optimization.