php - Multidimensional associative array as response in NuSOAP -
i have problems response in soap. in general can not undertand how response multidimensional associative array soap-client. used nusoap v 1.123 library.
so have code in soap-server:
$server->wsdl->addcomplextype( 'returndatainside', 'complextype', 'struct', 'all', '', array( 'message' => array('name' => 'message', 'type' => 'xsd:string', 'nillable' => 'true'), 'value' => array('name' => 'value', 'type' => 'xsd:string', 'nillable' => 'true'), ) ); $server->wsdl->addcomplextype( 'returndataoutside', 'complextype', 'array', 'all', '', array(), array(), 'tns:returndatainside' ); $server->register('test', array('param_1' => 'xsd:int', 'param_2' => 'xsd:string'), array('return' => 'tns:returndataoutside') ); function test($param_1, $param_2) { $data = array( 'test' => array( 'message' => 'string', 'value' => 'string', ), ); return $data; }
my response looks that:
array ( [0] => array ( [message] => string [value] => string ) )
so change 'test' key in response m.array ?
first of body of function incorrect.
$data[] = array( 'message' => 'string', 'value' => 'string', );
and answer on quastion is: soap not send keys multidimensional arrays.
Comments
Post a Comment