Minahito
minah****@users*****
2006年 9月 1日 (金) 12:13:11 JST
Index: xoops2jp/html/modules/base/preload/Primary/NuSoapLoader.class.php diff -u xoops2jp/html/modules/base/preload/Primary/NuSoapLoader.class.php:1.1.2.6 xoops2jp/html/modules/base/preload/Primary/NuSoapLoader.class.php:1.1.2.7 --- xoops2jp/html/modules/base/preload/Primary/NuSoapLoader.class.php:1.1.2.6 Fri Aug 25 19:16:37 2006 +++ xoops2jp/html/modules/base/preload/Primary/NuSoapLoader.class.php Fri Sep 1 12:13:11 2006 @@ -2,47 +2,53 @@ if (!defined("XOOPS_ROOT_PATH")) exit(); -require_once XOOPS_ROOT_PATH . "/class/XCube_Service.class.php"; - class Legacy_NuSoapLoader extends XCube_ActionFilter { function preFilter() { - require_once XOOPS_ROOT_PATH . "/modules/base/lib/nusoap/nusoap.php"; $this->mController->mRoot->mDelegateManager->add('XCube_ServiceManager.CreateClient', 'Legacy_NuSoapLoader::createClient'); + $this->mController->mRoot->mDelegateManager->add('XCube_ServiceManager.CreateServer', 'Legacy_NuSoapLoader::createServer'); } + /** + * @static + */ function createClient(&$client, $service) { - if (is_object($client) || !is_object($service)) { + if (is_object($client)) { return; } - if ($service->isOuterService()) { - $client = new Legacy_SoapClient($service); + $root =& XCube_Root::getSingleton(); + + if (is_object($service) && is_a($service, 'XCube_Service')) { + $client = new XCube_ServiceClient($service); + $client->setUser($root->mController->mUser); } else { - $client = new XCube_ServiceClient($service); + require_once XOOPS_ROOT_PATH . "/modules/base/lib/nusoap/nusoap.php"; + require_once XOOPS_ROOT_PATH . "/modules/base/lib/ShadePlus/SoapClient.class.php"; + + $client = new Shade_SoapClient($service); + $client->setUser($root->mController->mUser); } } -} -class Legacy_SoapClient extends XCube_AbstractServiceClient -{ - var $mClient = null; - - function Legacy_SoapClient(&$service) + /** + * @static + */ + function createServer(&$server, $service) { - parent::XCube_AbstractServiceClient($service); - $this->mClient =& new soap_client($service->getWSDLUrl(), true); - } - - function call() - { - $args = func_get_args(); - $op = array_shift($args); + if (is_object($server) || !is_object($service)) { + return; + } + + require_once XOOPS_ROOT_PATH . "/modules/base/lib/nusoap/nusoap.php"; + require_once XOOPS_ROOT_PATH . "/modules/base/lib/ShadePlus/ServiceServer.class.php"; + require_once XOOPS_ROOT_PATH . "/modules/base/lib/ShadeSoap/NusoapServer.class.php"; - return $this->mClient->call($op, $args); + $server = new ShadePlus_ServiceServer($service); + $server->prepare(); } }