Hi Everyone,
I am programming a SOAP API using WSDL. I have managed to create some of the basic functionality and things have been working well up to this point!
Here's my Server object
<?php
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("wsdl.wsdl");
$server->setClass("api");
$server->handle();
exit();
?>
My basic functions are working fine when i return single variables or an array. However, i am now trying to return a multidemnsional array that has been turned into an object and the API returns nothing.
$result = self::arr2obj(
array("Result" =>
array(
array("Fruits" => array("Banana" => "yellow", "Apple" => "Green")),
array("Vegs" => array("Carrots" => "Orange", "Peas" => "Yellow"))
)
)
);
return $result;
Returns nothing. Although i know my arr2obj function is definately compiling an object out of the array as i have tried logging it to file.
if i change my function to just return something like this:
return array("apple" => "green", "banana" => "yellow")
it returns the array as expected.
The documentation on php soap is very limited and I have tried so many variations i don't knowwhere else to look.
Thanks for any help!