forked from tikiorg/tiki
/
tiki-webservices.php
76 lines (68 loc) · 1.57 KB
/
tiki-webservices.php
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
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* @package tikiwiki
*/
// (c) Copyright 2002-2015 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
require_once 'tiki-setup.php';
$access->check_feature('feature_webservices');
/**
* Example of complex type
*/
class Tiki_ComplexType
{
/**
* Param 1
* @var string
*/
public $param1;
/**
* Param 2
* @var string
*/
public $param2;
}
/**
* Write your SOAP webservices as methods of this class, it will be automagically
* added to the WSDL file.
*
* Warning : while developing your web services, you should consider to set the
* soap.wsdl_cache_enabled parameter to 0 in your php.ini.
*/
class Tiki_WebServices
{
/**
* Prints some test data.
*
* @param string $param2
* @param string $param1
* @param string $param3
* @return string
*/
function test($param2, $param1, $param3)
{
return 'test1 ' . $param1 . ' test2 ' . $param2 . ' test3 ' . $param3;
}
/**
* Displays the Tiki_ComplexType data.
*
* @param Tiki_ComplexType $complex_param
* @return string
*/
function test_complex(Tiki_ComplexType $complex_param)
{
return $complex_param->param1 . ' =====> ' . $complex_param->param2;
}
}
if (is_null($_GET['wsdl'])) {
$server = new Zend_Soap_Server($_SERVER['SCRIPT_URI'] . '?wsdl');
$server->setClass('Tiki_WebServices');
$server->handle();
} else {
$wsdl = new Zend_Soap_AutoDiscover();
$wsdl->setClass('Tiki_WebServices');
$wsdl->handle();
}