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
class Server {
// __dispatch_map
public $__dispatch_map = array();
public function __construct() {
$this->__dispatch_map["restart"] = array (
"in" => array(
"courseconfig" => "string",
"moduleconfig" => "string",
"uservalues" => "string",
),
"out" => array("jsonData" => "string")
);
// get back __dispatch_map in __dispatch
public function __dispatch($methodname) {
if (isset($this->__dispatch_map[$methodname])) {
return $this->__dispatch_map[$methodname];
}
return NULL;
}
/************* Fuction wich will be executed */
function restart($configStr, $monfigStr, $userStr) {
include_once('configuration/config.inc.php');
Mach was.....
Hier möchte ich eine exteren funktion wie z.b. dbconnect(); aufrufen
}
}
service = new Server();
// server
$ss = new SOAP_Server();
// add service with name
$ss->addObjectMap ($service,"urn:lmsinterfaceserver");
// service or wsdl
if (isset($_SERVER["REQUEST_METHOD"])&& $_SERVER["REQUEST_METHOD"] == "POST") {
// postdata -> service
$ss->service ($HTTP_RAW_POST_DATA);
}