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
8require_once('class.soapdemo.php');
9require_once('class.complextypedemo.php');
10
11// Initialize the PhpWsdl class
12require_once('class.phpwsdl.php');
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(
76 'StringA',
77 'string'
78 ),
80 'StringB',
81 'string'
82 ),
84 'Integer',
85 'int',
86 Array(
87 'nillable' => 'false'
88 )
89 ),
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
110ini_set('soap.wsdl_cache_enabled',0); // Disable caching in PHP
111PhpWsdl::$CacheTime=0; // Disable caching in PhpWsdl
112
113// Run the SOAP server
114if($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
static $CacheTime
static CreateInstance( $nameSpace=null, $endPoint=null, $cacheFolder=null, $file=null, $name=null, $methods=null, $types=null, $outputOnRequest=false, $runServer=false)
$soap
Definição demo2.php:13