I have been trying to find an example/tutorial on how to impliment in php the use of an unbounded element in building a nusoap server
for example:
1. here's the base element
$server->wsdl->addComplexType(
'Screen',
'complexType',
'struct',
'all',
'',
array(
'ScreenNumber' => array('name' => 'ScreenNumber' , 'type'=> 'xsd:string')
)
); |
2. here is the parent element
$server->wsdl->addComplexType(
'ScreensObject',
'complexType',
'struct',
'all',
'',
array(
'Screen' => array('name' => 'Screen' , 'type'=> 'tns:Screen', 'maxOccurs'=>'unbounded')
)
); |
--------------------------------------------------------------------------------------------------------
Now, how do you actually use this? I have tried puting an array such as the following:
1. create a associative array holding the screen data that corresponds to Screen complex type shown above
$Screen = array(
'ScreenNumber' => $screenid
); |
2. save the instance (where Screen_array is just a dummy array that is filled up w/ all the Screen data
array_push($Screen_array, $Screen); |
3. use this instance
$ScreenData = array(
'Screen' => $Screen_array
) |
but I am getting an error:
Fault
Array
(
[faultcode] => Server
[faultactor] =>
[faultstring] => unable to serialize result
[detail] =>
) |
Any help would be greatly appreciated.
[/code]