示例#1
0
}
if (defined('XMDS')) {
    $service = 'soap';
}
// Check to see if we are going to consume a service (if we came from xmds.php then we will always use the SOAP service)
if (defined('XMDS') || $method != '') {
    // Create a service to handle the method
    switch ($service) {
        case 'soap':
            Kit::ClassLoader('xmdssoap');
            try {
                $soap = new SoapServer('lib/service/service.wsdl');
                $soap->setClass('XMDSSoap');
                $soap->handle();
            } catch (Exception $e) {
                $serviceResponse->ErrorServerError('Unable to create SOAP Server');
            }
            break;
        case 'oauth':
            Debug::LogEntry('audit', 'OAuth Webservice call');
            Kit::ClassLoader('ServiceOAuth');
            $oauth = new ServiceOAuth();
            if (method_exists($oauth, $method)) {
                $oauth->{$method}();
            } else {
                $serviceResponse->ErrorServerError('Unknown Request.');
            }
            break;
        case 'rest':
            $serviceResponse->StartTransaction();
            // OAuth authorization.
示例#2
0
                 } else {
                     header('HTTP/1.0 404 Not Found');
                 }
             }
             // Debug
             Debug::Audit('File request via magic packet. ' . $file['storedAs'], $file['displayId']);
             // Log bandwidth
             $bandwidth = new Bandwidth();
             $bandwidth->Log($file['displayId'], 4, $file['size']);
         }
         exit;
     }
     try {
         $wsdl = 'lib/service/service_v' . $version . '.wsdl';
         if (!file_exists($wsdl)) {
             $serviceResponse->ErrorServerError('Your client is not the correct version to communicate with this CMS.');
         }
         $soap = new SoapServer($wsdl);
         //$soap = new SoapServer($wsdl, array('cache_wsdl' => WSDL_CACHE_NONE));
         $soap->setClass('XMDSSoap' . $version);
         $soap->handle();
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage());
         $serviceResponse->ErrorServerError('Unable to create SOAP Server: ' . $e->getMessage());
     }
     break;
 case 'oauth':
     Debug::LogEntry('audit', 'OAuth Webservice call');
     Kit::ClassLoader('ServiceOAuth');
     $oauth = new ServiceOAuth();
     if (method_exists($oauth, $method)) {