Magento SOAP v1 vs. v2 performance
Asked Answered
B

1

7

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.

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.

Boundary answered 11/1, 2013 at 18:44 Comment(0)
G
22

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.

Go to

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

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

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.

Gelhar answered 11/1, 2013 at 19:39 Comment(4)
you were right on. It has dropped the time to about the same as v1. I actually ran across that setting in searches, but never tried it :( Oh well now I know. Thanks again.Boundary
I like how lightweight v1 seems to be. I switched to v2 because of an issue I'm having with VB.NET. I think I might ask another question if you want to keep an eye out for it ;)Boundary
I'm curious if this cache is cleared when you use the clear cache feature of admin. I imagine you'd need to do this when you're creating your own API with v2. Any insight into this Mr. Storm?Telephonic
@JonathanSpooner As far as I know this cache is not cleared when you use the clear cache feature of the admin. The WSDL caching is something internal to PHP, whereas the clear cache features of the Magento admin control the Magento application cache.Gelhar

© 2022 - 2024 — McMap. All rights reserved.