Essentially, a print_r of my array looks like the
following now:
(
[0] => Array
(
[extension] => 5364742
[call_log] => Array
(
[0] => Array
(
[date] => 2008-05-12 18:56:36
[caller] => 323
)
[1] => Array
(
[date] => 2008-05-13 11:25:51
[caller] => 718
)
[2] => Array
(
[date] => 2008-05-19 14:39:28
[caller] => 718
)
[3] => Array
(
[date] => 2008-05-19 19:13:05
[caller] => 718
)
)
)
[1] => Array
(
[extension] => 6182612
[call_log] => Array
(
[0] => Array
(
[date] => 2008-05-12 18:09:03
[caller] => 718
)
[1] => Array
(
[date] => 2008-05-13 11:27:24
[caller] => 718
)
)
)
)
I then tried to define the complexTypes accordingly with NuSOAP:
$server->wsdl->addComplexT
ype(
'CallLog',
'complexType',
'struct',
'all',
'',
array(
'date' => array('name'=>'date','type
'=>'xsd:st
ring'),
'caller' => array('name'=>'caller','ty
pe'=>'xsd:
string')
)
);
$server->wsdl->addComplexT
ype(
'CallLogArray',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref'=>'SOAP-ENC:arr
ayType','w
sdl:arrayT
ype'=>'tns
:CallLog[]
')
),
'tns:CallLog'
);
$server->wsdl->addComplexT
ype(
'Extension',
'complexType',
'struct',
'all',
'',
array(
'extension' => array('name'=>'extension',
'type'=>'x
sd:string'
),
'call_log' => array('name'=>'call_log','
type'=>'tn
s:CallLogA
rray')
)
);
$server->register('getCall
DetailReco
rds',
array('session_id' => 'xsd:int'),
array('return' => 'tns:Extension'),
'urn:lock',
'urn:lock#getCallDetailRec
ords',
'rpc',
'encoded',
'Returns the Call Detail Records for a particular Session ID.'
);
Thinking I'm on a path to victory, I then invoke a simple client to
try and retrieve the data structure I pasted above via SOAP:
s-computer:htdocs sf$ php soap.php
object(stdClass)#2 (2) {
["extension"]=>
NULL
["call_log"]=>
NULL
}
Not sure where I went wrong at this point....
Start Free Trial