I think you hit on a problem with the optional arguments which your call can take. catalogProductInfo()
can take five arguments, of which the first one is the sessionId
; all the other arguments are passed to the method Mage_Catalog_Model_Product_Api_V2::info()
, which takes them as follows:
public function info($productId, $store = null, $attributes = null, $identifierType = null)
As you can see, just the $productId
is obligatory, the other arguments are optional. But, if you want to pass the $identifierType
argument to the method, you have to pass as well all the other arguments. So, in your case, you omit one of the $store
or $attributes
arguments, and the method takes your sku
as the $attributes
argument. That produces your error.
So you either should pass the missing argument, or you can just omit the $identifierType
argument. Magento can guess from the input at $productId
which identifier type you pass (product ID or sku). The info()
method calls the _getProduct()
method, which in turn calls Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), $identifierType)
. In this method Magento takes a guess about your $productId
argument:
if ($identifierType === null) {
if (is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId)) {
$expectedIdType = 'sku';
}
}