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

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

问题描述

我在使用VB.NET与Magento的API来工作的过程。我用的是SOAP V1顺利,直到我遇到了,需要一个关联数组的呼叫。经过一天左右,没有运气的,我决定尝试V2有我需要的所有对象。 v2的作品,但非常,非常缓慢。要更新一个股票项目库存它大致花了一分钟半的时间来登录并做更新,而不是可能不到10秒V1。这让我想起我为什么首先选择了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的性能。我无法想象还有就是我需要的程度,但我认为我会问。我已经启用缓存。让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 缓存。当你进行API调用到Magento的,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版本存在 - 如果是这样的话,你可能会感兴趣的水星API 扩展(由我创建并销售)与API改进,包括此功能,旧版本的Magento。如果你没有预算延期, 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天全站免登陆