Temen2 bisa liat contoh yang kutulis. Aplikasi sederhana untuk menampilkan data mahasiswa dari suatu jurusan. perhatikan tipe data ini :
— CONTOH IMPLEMENTASI MULTIPLE (MULTI-DIMENSIONAL) ARRAY —
// registers the types Register the data structures used by the service
// Input Complex Datatype
(
‘TypeDataInput’, // name
‘complexType’, // typeClass (complexTypesimpleTypeattribute)
’struct’, // phpType: currently supported are array and struct (php assoc array)
‘all’, // compositor (allsequencechoice)
”, // restrictionBase namespace:name (http://schemas.xmlsoap.org/soap/encoding/:Array)
array( // elements = array ( name = array(name=>’’,type=>’’) )
‘jurusan’ => array(’name’ => ‘jurusan’, ‘type’ => ‘xsd:string’)
)
);
// Output Complex Datatype
$server->wsdl->addComplexType(
‘TypeDataOutput’,
‘complexType’,
’struct’,
‘all’,
”,
array(
‘nim’ => array(’name’ => ‘nim’, ‘type’ => ‘xsd:int’),
‘nama’ => array(’name’ => ‘nama’, ‘type’ => ‘xsd:string’),
‘alamat’ => array(’name’ => ‘alamat’, ‘type’ => ‘xsd:string’)
)
);
// Output Array Complex Datatype
$server->wsdl->addComplexType(’TypeDataOutputArray’,
‘complexType’
‘array’,
”,
‘SOAP-ENC:Array’,
array(),
array(array(’ref’=>’SOAP-
ENC:arrayType’,'wsdl:arrayType’=>’tns:TypeDataOutput[]‘)),
‘tns:TypeDataOutput’
);
— END —