Joined: 21 Apr 2008 |
Posts: 10 |
|
|
|
Posted: Mon Apr 21, 2008 2:51 am |
|
|
|
|
|
Hi,
Is there any easy definition for "struct" and "array"? In following code block what should I use (ideally).
$server->wsdl->addComplexType
(
'MainType',
'complexType',
'struct',
'sequence',
'',
array
(
'Total' => array('name' => 'Total', 'type' => 'xsd:positiveInteger'),
'XYDetails' => array('name' => 'XYDetails', 'type' => 'XYDetailsType')
)
);
|
I want to know that when to use "struct" and when to "array"?
Regards,
Dave
|
|
Joined: 28 Apr 2008 |
Posts: 4 |
|
|
|
Posted: Sun Apr 27, 2008 4:03 am |
|
|
|
|
|
You can use struct to organize your data as key-value pair, for instance
$server->wsdl->addComplexType(
'Walk',
'complexType',
'struct',
'all',
'',
array(
'WalkId' => array('name' => 'WalkId',
'type' => 'xsd:int'),
'WalkTitle' => array('name' => 'WalkTitle',
'type' => 'xsd:string'),
'WalkDate' => array('name' => 'WalkDate',
'type' => 'xsd:date')
'WalkDescription' => array('name' => 'WalkDescription',
'type' => 'xsd:string')
)
); |
And you can contain the structure within the array like this
$server->wsdl->addComplexType(
'Walks',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:Walk[]')
),
'tns:Walk'
); |
Reference:
|
|