NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
NuSoap Webservice that receive Multidimensional array


Joined: 07 Apr 2011
Posts: 1
Reply with quote
Wich is the best way to create a WebService(using php nusoap) that can receive a multidimensional array so the data can be process and return certain information, let me show you what i got so far and couldnt make it work yet hope you can show me the way

[PHP]

$server->wsdl->addComplexType('newgroup', 'complexType', 'struct', 'all', '',
array(
'id' => array('name' => 'id', 'type' => 'xsd:string'),
'code' => array('name' => 'code', 'type' => 'xsd:string'),
'msg' => array('name' => 'msg', 'type' => 'xsd:string'))
);


$server->wsdl->addComplexType('kids', 'complexType', 'struct', 'all', '',
array('name' => array('name' => 'name', 'type' => 'xsd:string'),
'lname' => array('name' => 'lname', 'type' => 'xsd:string'),
'ename' => array('name' => 'ename', 'type' => 'xsd:string')
'age' => array('name' => 'r_tua', 'type' => 'xsd:int'),
'type' => array('name' => 'type', 'type' => 'xsd:string'))
);

$server->wsdl->addComplexType('listkids',
'complexType',
'array',
'',
'',
array (array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:kids[]'))
);




$server->register('MakeGroup',
array('listkids' => 'tns:listkids' ),
array('return' => 'tns:newgroup'),
$miURL
);

[/PHP]

on the client side i try to consume the webservice this way

[PHP]
$listkids = array(1 => array('name' => 'juan',
'lname' => 'robles',
'ename' => 'rivera',
'age' => 18,
'type' => 'H'),
2 => array('name' => 'juan',
'lname' => 'robles',
'ename' => 'rivera',
'age' => 18,
'type' => 'H'));

$result = $nusoapcliente->call(
$metodoALlamar,
array('listkids' => $listkids),
"uri:$serverURL/$serverScript",
"uri:$serverURL/$serverScript/$metodoALlamar" );
[/PHP]


hope you can help me!!!
View user's profileFind all posts by ppLuiGuiSend private messageMSN MessengerICQ Number
NuSoap Webservice that receive Multidimensional array
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