Joined: 22 Jul 2021 |
Posts: 1 |
|
|
|
Posted: Thu Jul 22, 2021 10:40 am |
|
|
|
|
|
Hi,
How I Can output this structure using nusoap server
Desired Result:
stdClass Object
(
[data] => stdClass Object
(
[array] => Array
(
[0] => stdClass Object
(
[brandId] => 1
[brandName] => NIKE
)
.............
What I Get:
Array
(
[data] => Array
(
[0] => stdClass Object
(
[brandId] => 1
[brandName] => NIKE
)
.............
My code is this
$server->wsdl->addComplexType(
'first_obj',
'complexType',
'struct',
'all',
'',
array(
'brandId' => array('name' => 'brandId', 'type' =>'xsd:int'),
'brandName' => array('name' => 'brandName', 'type' =>'xsd:string')
)
);
$server->wsdl->addComplexType(
'getAmBrands',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array(
'ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:first_obj[]'
)
)
, 'tns:first_obj'
);
$server->register('getAmBrands',
array(
'Country' => 'xsd:string',
'lang' => 'xsd:string',
'id' => 'xsd:int',
),
array(
'data' => 'tns:getAmBrands',
'status' => 'xsd:string',
'statusText' => 'xsd:string'
),
'https://www.test.com', //namespace
'https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'], //soapaction
'rpc', // style: rpc or document
'literal', // use: encoded or literal
'test soap'
);
What I’m doing Wrong ?
Can anybody help ?
|