0
votes

Background: I have built a tool that imports sales orders from Magento to a custom application. The function salesOrderList() worked fine on a customer's Magento Go store. Then it failed on another customer's store. The reason was the former store was version 1.6.x and the latter was 1.5.x. The function call returned two different data structures on the two versions (despite being the same API version, namely SOAP API V2), causing the problem. So I customized the tool to expect the 1.6.x data structure first and then fall back to 1.5.x if the former failed. Now, we have a new customer who seems to have Magento version 1.7. The data structure seems to have changed again in 1.7 for the same function (salesOrderList()).

Programmed Using: .NET (C#); Magento SOAP API V2

Question: Is there a function call to determine the Magento (1.5, 1.6, etc.) version of the store we are connecting to? I understand from another post that there is a MAGE::getVersion() call that they use in PHP, directly on the store (without SOAP API). Is there a .NET equivalent for this when using the SOAP API?

PS: I had posted the same question (a little less wordy though) as user1236916 because I had temporarily lost the login information for this account. My apologies for the repetition.

Thanks!

1
by "store version", do you mean Magento version (ie: 1.4.0.0, 1.6.2.0, etc...)? Magento edition (ie: community, enterprise, go)? something else?OSdave
Create your own API and implement simple function to get magento version via Mage::getVersion() static function.Oğuz Çelikdemir
@OSDave, yes, I do mean Magento version numbers like 1.4.0.0, 1.6.2.0, etc.user1236916
Try this method catalog_category/currentStore in your SOAP call.xyz
The Magento version isn't available through the API. That said, I believe the WS-I compliance mode setting under System > Configuration > Services > Magento Core API > WSI compliance might be responsible for the difference in the returned data structure (for the 1.6 and 1.7 instances).Vinai

1 Answers

1
votes

The Magento core API is known to be very limited in the calls it provides by default. There is no call that returns the Magento version out of the box.

More infomation on the Magento core API can be found on the official Magento site.

That being said the Magento API is designed to be extended and to do so is not overly difficult. You will need to create a Magento module that extends one of the core API resources (you will need to do this in PHP and have access to the Magento installation itself).

See this post for more information on how to extend the V2 Magento API.

In your extended API class simple create a function like so:

public function getVersion()
{
    // static method to return the Magento version within the app
    return Mage::getVersion();
}