|
| Array in Struct | |
Joined: 08 Jan 2005 |
Posts: 2 |
Location: Stuttgart - Germany |
|
|
Posted: Wed Jan 26, 2005 9:14 am |
|
|
|
|
|
Hy,
what I need for my project is an Array of Structures. Where the Structure contains another Array.
Is that possible?
Here is what I have so far:
-------------------------------------------------------
$server->wsdl->addComplexType(
'zeile_rc',
'complexType',
'struct',
'all',
'',
array(
'keyword' => array('name' => 'keyword', 'type' => 'xsd:string'),
'such1' => array('name' => 'such1', 'type' => 'xsd:int')
'such2' => array('name' => 'such2', 'type' => 'xsd:int')
'such3' => array('name' => 'such3', 'type' => 'xsd:int')
'such4' => array('name' => 'such4', 'type' => 'xsd:int')
'such5' => array('name' => 'such5', 'type' => 'xsd:int')
)
);
$server->wsdl->addComplexType(
'zeilen_rc',
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(
array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:zeile_rc[]')
),
'tns:zeile_rc'
);
------------------------------------------------------------------
Now I would like to replace the such1 to such5 with an array.
I don't understand how this could be achieved.
Thanks,
Markus
|
|
|
| | |
|
| | |
Joined: 06 Sep 2005 |
Posts: 7 |
|
|
|
Posted: Sun Jul 16, 2006 3:53 pm |
|
|
|
|
|
i have the same question
the links do not really provide a straight forward answer
could anyone provide an example?
EDIT: i solved this for myself so here it is for anyone else:
//This creates Boxes with multiple items in them
$namespace = "urn:Service";
$server->debug_flag=false;
$server->configureWSDL('Service', $namespace);
$server->wsdl->schemaTargetNamespace = $namespace;
$server->wsdl->addComplexType(
'Box',
'complexType',
'struct',
'all',
'',
array
(
'BoxId' => array('name' => 'BoxId', 'type' => 'xsd:int'),
'Name' => array('name' => 'Name', 'type' => 'xsd:string'),
'Items' => array('name' => 'Items', 'type' => 'tns:Items')
)
);
$server->wsdl->addComplexType(
'Item',
'complexType',
'struct',
'all',
'',
array
(
'ItemId' => array('name' => 'ItemId', 'type' => 'xsd:int'),
'ItemDescrip' => array('name' => 'ItemDescrip', 'type' => 'xsd:int'),
)
);
$server->wsdl->addComplexType(
'Boxes',
'complexType',
'array',
'all',
'SOAP-ENC:Array',
array(),
array
(
array
(
'ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Box[]'
)
),
'tns:Box'
);
$server->wsdl->addComplexType(
'Items',
'complexType',
'array',
'all',
'SOAP-ENC:Array',
array(),
array
(
array
(
'ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Item[]'
)
),
'tns:Item'
);
$server->register
(
'getObjects',
array('Id'=>'xsd:int'),
array('return'=>'tns:Boxes'),
$namespace,
'',
false,
'encoded',
'Get Boxes'
); |
|
|
|
| | |
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
|
|
|
| |