NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
output this structure using nusoap server


Joined: 22 Jul 2021
Posts: 1
Reply with quote
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 ?
View user's profileFind all posts by lsantosSend private message
output this structure using nusoap server
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic