-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsoap_world_types.php
More file actions
64 lines (59 loc) · 1.75 KB
/
soap_world_types.php
File metadata and controls
64 lines (59 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
defComplexType('country', array(
'code' => 'xsd:string',
'name' => 'xsd:string',
'continent' => 'xsd:string',
'region' => 'xsd:string',
'population' => 'xsd:integer'
), 'all'
);
defArrayType('ArrayOfCountry', 'tns:country', '0', 'unbounded');
function defComplexType($name, $input, $compositor = 'all', $minoccur = null, $maxoccur = null) {
global $server;
foreach ($input as $key => $in) {
if (is_Array($in)) {
$in['name'] = $key;
$dati[$key] = $in;
} else
if (($minoccur == null) || ($maxoccur == null))
$dati[$key] = array('name' => $key, 'type' => $in);
else
$dati[$key] = array('name' => $key, 'type' => $in, 'minOccurs' => $minoccur, 'maxOccurs' => $maxoccur);
}
$server->wsdl->addComplexType(
$name, 'complexType', 'struct', $compositor, '', $dati
);
}
function defScalarType($name, $fromType, $valori) {
global $server;
$server->wsdl->addSimpleType(
$name, $fromType, 'simpleType', 'scalar', $valori
);
}
function defArrayType($name, $type, $min, $max) {
global $server;
$server->wsdl->addComplexType(
str_replace("tns:", "", $name),
'complexType',
'array',
'',
'SOAP-ENC:Array',
array(),
array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => $type . '[]', 'minOccurs' => $min, 'maxOccurs' => $max)),
$type
);
}
function defSequenceType($name, $type, $min, $max) {
global $server;
$server->wsdl->addComplexType(
str_replace("tns:", "", $name),
'complexType',
'array',
'sequence',
'',
array(str_replace("tns:", "", $type) . '' => array('name' => str_replace("tns:", "", $type) . '', 'type' => $type, 'minOccurs' => $min, 'maxOccurs' => $max)),
array(),
$type
);
}
?>