Magento SOAP v1 与 v2 的性能 [英] Magento SOAP v1 vs. v2 performance

查看:37
本文介绍了Magento SOAP v1 与 v2 的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 VB.NET 来处理 Magento API.我成功地使用了 SOAP v1,直到遇到一个需要关联数组的调用.经过一天左右的运气不佳,我决定尝试 v2,其中包含我需要的所有对象.v2 可以工作,但是非常非常慢.要更新一个库存项目库存,登录和更新大约需要一分半钟的时间,而 v1.2 可能不到 10 秒.这让我想起了我最初选择 v1 的原因.

I am in the process of using VB.NET to work with the Magento API. I was using SOAP v1 successfully until I ran into a call that needs an associative array. After a day or so of no luck I decided to try v2 which has all the objects I need. v2 works but is very, very slow. To update one stock item inventory it took roughly a minute and a half to login and do the update as opposed to maybe less than 10 seconds with v1. That reminded me why I chose v1 in the first place.

我的问题是是否有办法提高 v2.2 的性能.我无法想象我需要它的程度,但我想我会问.我已经启用了缓存.如果可能,让 v1 接受关联数组的替代方法似乎是一个挑战.

My question is if there is anyway to improve the performance on v2. I can't imagine there is to the extent I need it but I thought I'd ask. I already have caching enabled. The alternative of getting v1 to accept an associative array seems to be a challenge, if possible.

推荐答案

WSDL 请求可能需要很长时间的原因有很多,但我首先要检查的是 WSDL 的设置强>缓存.当您对 Magento 进行 API 调用时,Magento 使用 PHP 的 SoapServer 对象.SoapServer 对象需要获取自己的 WSDL 文件才能运行,而这个文件的生成和获取可能是一件耗时的事情.

There's lots of reasons a WSDL request might be taking a long time, but the first thing I'd check is the settings for the WSDL cache. When you make an API call into Magento, Magento uses PHP's SoapServer object. The SoapServer object needs to fetch its own WSDL file to operate, and the generation and fetching of this file can be a time consuming thing.

前往

System -> Configuration -> Magento Core API -> General Settings

并查找启用 WSDL 缓存".将此设置为 yes,您将看到一些 API 性能改进.

and look for "Enable WSDL Cache". Set this to yes and you'll see some API performance improvement.

您的 Magento 版本中可能不存在此设置 — 如果是这种情况,您可能对 Mercury API 扩展(由我创建和销售),其中包含针对旧版 Magento 的此功能的 API 改进.如果您没有扩展的预算,Mage_Api_Model_Server_Adapter_Soap 是旧版本的 Magento 禁用此缓存的类.

This setting may not exist in your version of Magento — if that's the case you might be interested in the Mercury API extension, (created and sold by me) with API improvements that include this functionality for older versions of Magento. If you don't have budget for an extension, Mage_Api_Model_Server_Adapter_Soap is the class where older versions of Magento disable this cache.

这篇关于Magento SOAP v1 与 v2 的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆