Witam,
mam nastepujący problem. Przygotowałem web service w którym wykorzystuje mapowanie do definicj elementów złożonych:
class AAA extends CActiveRecord {
/**
* @var string {nillable = 1, minOccurs=0}
* @soap
*/
public $bbb;
}
class WsController extends GxController {
public function actions() {
return array(
'quote' => array(
'class' => 'CWebServiceAction',
'classMap'=>array(
'AAA',
),
'serviceOptions' => array(
'generatorConfig' => array(
'class' => 'CWsdlGenerator',
'operationBodyStyle' => array('use' => 'literal'),
'bindingStyle' => 'document',
'serviceName' => 'XXX',
'namespace' => 'http://www.aaa.pl'
),
),
),
);
}
/**
* @param AAA ccc
* @return string info
* @soap
*/
public function SendAAA($ccc) {
RETURN 'OK';
}
}
Następnie próbuje to testowo wywołać:
public function actionAAATest() {
ini_set("soap.wsdl_cache_enabled", 0);
$client = new SoapClient('http://...ws/quote');
//ani tak
$AAA = new StdClass();
$AAA->ccc= new StdClass();
$AAA->ccc->bbb= 'www';
//ani tak :/
$AAA= new stdClass();
$AAA->ccc= 'abc';
print $client->SendAAA($AAA);
exit();
}
Zawsze dostaje błąd: Object of class stdClass could not be converted to string
Wyczerpały mi sie pomysły jak to przeskoczyć. Jak poprawnie przekazać parametr do tego web service?