I'm using the following soap function to pull my Magento category tree:


$client = new SoapClient('http://bennettcode.com/store/index.php/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('soap_user', 'password');

$result = $client->call($session, 'catalog_category.tree');


// If you don't need the session anymore

The following output is generated enter image description here

What tools can I use to sort and manipulate this data so that it is more useful/legible? I'd eventually like to be able to sort and display SOAP function results in a neat manner. I have limited development knowledge, but I'm guessing I would use PHP to further edit the script. Any push (or shove) in the right direction would be great!

1 Answer 1


You're using PHP to get the data so let's continue with PHP.

I'm sure you saw that there data it returned is an array that holds a bunch of arrays for each category.

<?php foreach ($result as $category)
echo "/n".'-----'."/n";

All you're doing here is breaking it down to a smaller subset of arrays so you can actually see what's in there till you get to the point where you can see what data is in there, what parts you want/need and how you want to display it.

By the way, zend_debug::dump($result) will usually give you an easier to read dump of what's going on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.