Php Soap调用需要很多时间

Php Soap调用需要很多时间,php,prestashop,soap-client,Php,Prestashop,Soap Client,我正在开发专门用于prestashop模块的Web服务,这需要很多时间。 webservice在每次呼叫时都会返回一个运费,因此如果我有4个Transporter prestashop,则会执行8个呼叫(4个用于bloc cart,4个用于获取订单页面上的运费)。 有没有办法减少这一时间?就像使用静态变量一样。 我尝试了缓存,但没有效果,因为wsdl已经在我的服务器上。您必须缓存webservices结果以提高性能: if (Cache::isStored('unique-id-

我正在开发专门用于prestashop模块的Web服务,这需要很多时间。 webservice在每次呼叫时都会返回一个运费,因此如果我有4个Transporter prestashop,则会执行8个呼叫(4个用于bloc cart,4个用于获取订单页面上的运费)。 有没有办法减少这一时间?就像使用静态变量一样。
我尝试了缓存,但没有效果,因为wsdl已经在我的服务器上。

您必须缓存webservices结果以提高性能:

        if (Cache::isStored('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params)))
        {
            $shipment_options = Cache::retrieve('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params));
        }
        else
        {
            $shipment_options = $api_or_soap->getEstimateCost($request_params);
            if ($shipment_options)
                Cache::store('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params), $shipment_options);
        }

祝您好运

您必须缓存Web服务结果以提高性能:

        if (Cache::isStored('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params)))
        {
            $shipment_options = Cache::retrieve('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params));
        }
        else
        {
            $shipment_options = $api_or_soap->getEstimateCost($request_params);
            if ($shipment_options)
                Cache::store('unique-id-for-your-module-and-request-result-' . Tools::jsonEncode($request_params), $shipment_options);
        }

祝您好运

您是否为soap客户端对象设置了cache_wsdl选项?您可以通过在文件中缓存响应来减少请求。您可以首先检查文件中的值,如果请求的值不在缓存文件中,则执行soap请求。您还可以通过soapui检查什么花费了这么多时间。请求是因为auf格式错误的xml还是另一端的服务器?当我从
目录/name.wsdl使用它时,为什么要使用cache\u wsdl?我没有尝试soapui,但是我已经为prestashopHave调试了profiler。您为soap客户机对象设置了cache\uwsdl选项吗?您可以通过在文件中缓存响应来减少请求。您可以首先检查文件中的值,如果请求的值不在缓存文件中,则执行soap请求。您还可以通过soapui检查什么花费了这么多时间。请求是因为auf格式错误的xml还是另一端的服务器?当我从
目录/name.wsdl使用它时,为什么要使用cache\u wsdl?我没有尝试soapui,但我已经为prestashop调试了profiler