I want to send an array to the Web Service provided by Yii, but for some reason it is always seen as a string.
Client:
$client = new SoapClient('host/service/quote');
$returned = $client->setOptions(array(
'var1' => 1
'var2' => 2
));
print_r($returned); //prints array('options' => 'Array')
Server:
class ServiceController extends CController {
public function actions(){
return array(
'quote'=>array(
'class'=>'CWebServiceAction'
),
);
}
/**
* @param array
* @return array
* @soap
*/
public function setOptions($array){
return array('options' => $array);
}
}
Sending strings and numbers all works, but when I want to send an Array() or Object, at the server end I only get the word 'Array' or 'Object'…
What am I doing wrong?