1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined("XOOPS_ROOT_PATH")) exit();
12:
13: class Legacy_NuSoapLoader extends XCube_ActionFilter
14: {
15: function preFilter()
16: {
17: $this->mRoot->mDelegateManager->add('XCube_ServiceManager.CreateClient', 'Legacy_NuSoapLoader::createClient');
18: $this->mRoot->mDelegateManager->add('XCube_ServiceManager.CreateServer', 'Legacy_NuSoapLoader::createServer');
19: }
20:
21: 22: 23:
24: function createClient(&$client, $service)
25: {
26: if (is_object($client)) {
27: return;
28: }
29:
30: $root =& XCube_Root::getSingleton();
31:
32: if (is_object($service) && is_a($service, 'XCube_Service')) {
33: $client = new XCube_ServiceClient($service);
34: }
35: else {
36: require_once XOOPS_ROOT_PATH . "/modules/legacy/lib/nusoap/nusoap.php";
37: require_once XOOPS_ROOT_PATH . "/modules/legacy/lib/ShadePlus/SoapClient.class.php";
38:
39: $client = new ShadePlus_SoapClient($service);
40: }
41: }
42:
43: 44: 45:
46: function createServer(&$server, $service)
47: {
48: if (is_object($server) || !is_object($service)) {
49: return;
50: }
51:
52: require_once XOOPS_ROOT_PATH . "/modules/legacy/lib/nusoap/nusoap.php";
53: require_once XOOPS_ROOT_PATH . "/modules/legacy/lib/ShadePlus/ServiceServer.class.php";
54: require_once XOOPS_ROOT_PATH . "/modules/legacy/lib/ShadeSoap/NusoapServer.class.php";
55:
56: $server = new ShadePlus_ServiceServer($service);
57: $server->prepare();
58: }
59: }
60:
61: ?>
62: