Joined: 07 Apr 2011 |
Posts: 1 |
|
|
 |
Posted: Thu Apr 07, 2011 2:07 pm |
|
 |
 |
 |
 |
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!!!
|