symfony で ckWebServicePlugin を使用して Web サービスを作成しています。単純な型のパラメーターと複雑な型の戻り値を使用してメソッドを作成することができましたが、うまく機能しましたが、パラメーターの複雑な型の配列を取得しようとすると、null 値が返されるようです。
/api/actions.class.php
/** Allow to update request
*
* @WSMethod(name='updateRequests', webservice='api')
*
* @param RequestShort[] $arrRequests
*
* @return RequestShort[] $result
*/
public function executeUpdateRequests(sfWebRequest $request)
{
$res = $request->getParameter('$arrRequests');
$this->result = $res;
return sfView::SUCCESS;
}
これが私の SOAP クライアントです
$test = array(array('request_id' => 1, 'statut' => 3), array('request_id' => 2, 'statut' => 3),);
$result = $proxy->updateRequests($test);
これは私の RequestShort タイプです
class RequestShort {
/**
* @var int
*/
public $request_id;
/**
* @var int
*/
public $statut;
public function __construct($request_id, $statut)
{
$this->request_id = $request_id;
$this->statut = $statut;
}
}
そして最後に、私の app.yml
soap:
# enable the `ckSoapParameterFilter`
enable_soap_parameter: on
ck_web_service_plugin:
# the location of your wsdl file
wsdl: %SF_WEB_DIR%/api.wsdl
# the class that will be registered as handler for webservice requests
handler: ApiHandler
soap_options:
classmap:
# mapping of wsdl types to PHP types
RequestShort: RequestShort
RequestShortArray: ckGenericArray
以下のコードが何も返さないのはなぜですか?
$res = $request->getParameter('$arrRequests');
$this->result = $res;