MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
demo2.php
Ir para a documentação deste ficheiro.
1
<?php
2
3
// This is a demonstration how to work with PhpWsdl without WSDL definitions in comments.
4
// More code, less comments. For whoever needs it... You may also mix definitions in
5
// comments AND in this way together.
6
7
// Include the demonstration classes
8
require_once(
'class.soapdemo.php'
);
9
require_once(
'class.complextypedemo.php'
);
10
11
// Initialize the PhpWsdl class
12
require_once(
'class.phpwsdl.php'
);
13
$soap
=
PhpWsdl::CreateInstance
(
14
null
,
// PhpWsdl will determine a good namespace
15
null
,
// Change this to your SOAP endpoint URI (or keep it NULL and PhpWsdl will determine it)
16
'./cache'
,
// Change this to a folder with write access
17
null
,
// PhpWsdl should not parse PHP comments for this demonstration
18
'SoapDemo'
,
// The name of the class that serves the webservice
19
Array(
// Add methods
20
new
PhpWsdlMethod
(
// SoapDemo->GetComplexType method
21
'GetComplexType'
,
22
null
,
23
new
PhpWsdlParam
(
24
'GetComplexTypeResult'
,
25
'ComplexTypeDemo'
26
)
27
),
28
new
PhpWsdlMethod
(
// SoapDemo->PrintComplexType method
29
'PrintComplexType'
,
30
Array(
31
new
PhpWsdlParam
(
32
'obj'
,
33
'ComplexTypeDemo'
34
)
35
),
36
new
PhpWsdlParam
(
37
'PrintComplexTypeResult'
,
38
'string'
39
)
40
),
41
new
PhpWsdlMethod
(
// SoapDemo->ComplexTypeArrayDemo method
42
'ComplexTypeArrayDemo'
,
43
Array(
44
new
PhpWsdlParam
(
45
'arr'
,
46
'ComplexTypeDemoArray'
47
)
48
),
49
new
PhpWsdlParam
(
50
'return'
,
51
'stringArray'
52
)
53
),
54
new
PhpWsdlMethod
(
// SoapDemo->SayHello method
55
'SayHello'
,
56
Array(
57
new
PhpWsdlParam
(
58
'name'
,
59
'string'
60
)
61
),
62
new
PhpWsdlParam
(
63
'return'
,
64
'string'
65
)
66
),
67
new
PhpWsdlMethod
(
// SoapDemo->DemoMethod method
68
'DemoMethod'
69
)
70
),
71
Array(
// Add complex types
72
new
PhpWsdlComplex
(
// ComplexTypeDemo class
73
'ComplexTypeDemo'
,
74
Array(
75
new
PhpWsdlElement
(
76
'StringA'
,
77
'string'
78
),
79
new
PhpWsdlElement
(
80
'StringB'
,
81
'string'
82
),
83
new
PhpWsdlElement
(
84
'Integer'
,
85
'int'
,
86
Array(
87
'nillable'
=>
'false'
88
)
89
),
90
new
PhpWsdlElement
(
91
'Boolean'
,
92
'boolean'
,
93
Array(
94
'nillable'
=>
'false'
95
)
96
)
97
)
98
),
99
new
PhpWsdlComplex
(
// string array
100
'stringArray'
101
),
102
new
PhpWsdlComplex
(
// ComplexTypeDemo array
103
'ComplexTypeDemoArray'
104
)
105
),
106
false
,
// Don't send WSDL right now
107
false
);
// Don't start the SOAP server right now
108
109
// Disable caching for demonstration
110
ini_set(
'soap.wsdl_cache_enabled'
,0);
// Disable caching in PHP
111
PhpWsdl::$CacheTime
=0;
// Disable caching in PhpWsdl
112
113
// Run the SOAP server
114
if
(
$soap
->IsWsdlRequested())
115
$soap
->Optimize=
false
;
// Don't optimize WSDL to send it human readable to the browser
116
$soap
->RunServer();
// Finally, run the server
PhpWsdlComplex
Definição
class.phpwsdlcomplex.php:31
PhpWsdlElement
Definição
class.phpwsdlelement.php:30
PhpWsdlMethod
Definição
class.phpwsdlmethod.php:33
PhpWsdlParam
Definição
class.phpwsdlparam.php:31
PhpWsdl\$CacheTime
static $CacheTime
Definição
class.phpwsdl.php:256
PhpWsdl\CreateInstance
static CreateInstance( $nameSpace=null, $endPoint=null, $cacheFolder=null, $file=null, $name=null, $methods=null, $types=null, $outputOnRequest=false, $runServer=false)
Definição
class.phpwsdl.php:532
$soap
$soap
Definição
demo2.php:13
classes
contrib
phpWsdl
demo2.php
Gerado por
1.10.0