Exemplo n.º 1
0
 private function instantiateSOAPServer($uri, $service_class)
 {
     require_once 'common/soap/SOAP_RequestValidator.class.php';
     require_once 'Statistics_DiskUsageManager.class.php';
     $user_manager = UserManager::instance();
     $project_manager = ProjectManager::instance();
     $soap_request_validator = new SOAP_RequestValidator($project_manager, $user_manager);
     $disk_usage_manager = new Statistics_DiskUsageManager();
     $project_quota_manager = new ProjectQuotaManager();
     $server = new TuleapSOAPServer($uri . '/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE));
     $server->setClass($service_class, $soap_request_validator, $disk_usage_manager, $project_quota_manager);
     $server->handle();
 }
Exemplo n.º 2
0
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once 'pre.php';
require_once 'common/svn/SVN_SOAPServer.class.php';
// Check if we the server is in secure mode or not.
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' || $GLOBALS['sys_force_ssl'] == 1) {
    $protocol = "https";
} else {
    $protocol = "http";
}
$uri = $protocol . '://' . $GLOBALS['sys_default_domain'] . '/soap/svn';
$serviceClass = 'SVN_SOAPServer';
if ($request->exist('wsdl')) {
    require_once 'common/soap/SOAP_NusoapWSDL.class.php';
    $wsdlGen = new SOAP_NusoapWSDL($serviceClass, 'TuleapSubversionAPI', $uri);
    $wsdlGen->dumpWSDL();
} else {
    $soap_request_validator = new SOAP_RequestValidator(ProjectManager::instance(), UserManager::instance());
    $svn_repository_listing = new SVN_RepositoryListing(new SVN_PermissionsManager(), new SVN_Svnlook(), UserManager::instance());
    $server = new TuleapSOAPServer($uri . '/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE));
    $server->setClass($serviceClass, $soap_request_validator, $svn_repository_listing);
    $server->handle();
}
Exemplo n.º 3
0
    $protocol = "http";
}
$server_uri = $protocol . '://' . ForgeConfig::get('sys_default_domain');
$uri = $server_uri . TRACKER_BASE_URL . '/soap';
if ($request->exist('wsdl')) {
    // Use a static wsdl file
    //$wsdl = file_get_contents(TRACKER_BASE_DIR .'/tracker.wsdl');
    //header('Content-type: text/xml');
    //echo str_replace('https://tuleap.example.com', $server_uri, $wsdl);
    //die();
    // Use nusoap to generate the wsdl
    require_once 'nusoap.php';
    require_once 'utils_soap.php';
    $server = new soap_server();
    $server->configureWSDL('TuleapTrackerV5API', $uri, false, 'rpc', 'http://schemas.xmlsoap.org/soap/http', $uri);
    require_once TRACKER_BASE_DIR . '/wsdl.php';
    // Call the service method to initiate the transaction and send the response
    $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
    $server->service($HTTP_RAW_POST_DATA);
} else {
    require_once TRACKER_BASE_DIR . '/Tracker/SOAPServer.class.php';
    $soap_options = array();
    if (ForgeConfig::get('DEBUG_MODE')) {
        $soap_options['cache_wsdl'] = WSDL_CACHE_NONE;
    }
    $formelement_factory = Tracker_FormElementFactory::instance();
    $artifact_factory = Tracker_ArtifactFactory::instance();
    $server = new TuleapSOAPServer($uri . '/?wsdl', $soap_options);
    $server->setClass('Tracker_SOAPServer', new SOAP_RequestValidator(ProjectManager::instance(), UserManager::instance()), TrackerFactory::instance(), PermissionsManager::instance(), new Tracker_ReportDao(), $formelement_factory, Tracker_ArtifactFactory::instance(), Tracker_ReportFactory::instance(), new Tracker_FileInfoFactory(new Tracker_FileInfoDao(), $formelement_factory, $artifact_factory), new TrackerManager());
    $server->handle();
}
Exemplo n.º 4
0
    $protocol = "https";
} else {
    $protocol = "http";
}
$uri = $protocol . '://' . $GLOBALS['sys_default_domain'] . '/soap/project';
$serviceClass = 'Project_SOAPServer';
if ($request->exist('wsdl')) {
    require_once 'common/soap/SOAP_NusoapWSDL.class.php';
    $wsdlGen = new SOAP_NusoapWSDL($serviceClass, 'TuleapProjectAPI', $uri);
    $wsdlGen->dumpWSDL();
} else {
    $userManager = UserManager::instance();
    $projectManager = ProjectManager::instance();
    $soapLimitFactory = new SOAP_RequestLimitatorFactory();
    $projectCreator = new ProjectCreator($projectManager, ReferenceManager::instance());
    $generic_user_dao = new GenericUserDao();
    $generic_user_factory = new GenericUserFactory($userManager, $projectManager, $generic_user_dao);
    $limitator = $soapLimitFactory->getLimitator();
    $custom_project_description_dao = new Project_CustomDescription_CustomDescriptionDao();
    $custom_project_description_value_dao = new Project_CustomDescription_CustomDescriptionValueDao();
    $custom_project_description_factory = new Project_CustomDescription_CustomDescriptionFactory($custom_project_description_dao);
    $custom_project_description_manager = new Project_CustomDescription_CustomDescriptionValueManager($custom_project_description_value_dao);
    $custom_project_description_value_factory = new Project_CustomDescription_CustomDescriptionValueFactory($custom_project_description_value_dao);
    $service_usage_dao = new Project_Service_ServiceUsageDao();
    $service_usage_factory = new Project_Service_ServiceUsageFactory($service_usage_dao);
    $service_usage_manager = new Project_Service_ServiceUsageManager($service_usage_dao);
    $forge_ugroup_permissions_manager = new User_ForgeUserGroupPermissionsManager(new User_ForgeUserGroupPermissionsDao());
    $server = new TuleapSOAPServer($uri . '/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE));
    $server->setClass($serviceClass, $projectManager, $projectCreator, $userManager, $generic_user_factory, $limitator, $custom_project_description_factory, $custom_project_description_manager, $custom_project_description_value_factory, $service_usage_factory, $service_usage_manager, $forge_ugroup_permissions_manager);
    $server->handle();
}
Exemplo n.º 5
0
define('CODENDI_WS_API_VERSION', file_get_contents(dirname(__FILE__) . '/VERSION'));
define('LOG_SOAP_REQUESTS', false);
// Check if we the server is in secure mode or not.
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' || $GLOBALS['sys_force_ssl'] == 1) {
    $protocol = "https";
} else {
    $protocol = "http";
}
$uri = $protocol . '://' . $sys_default_domain;
if ($request->exist('wsdl')) {
    header("Location: " . $uri . "/soap/codendi.wsdl.php?wsdl");
    exit;
}
$event_manager = EventManager::instance();
try {
    $server = new TuleapSOAPServer($uri . '/soap/codendi.wsdl.php?wsdl', array('trace' => 1, 'soap_version' => SOAP_1_1));
    require_once 'utils_soap.php';
    require_once 'common/session.php';
    require_once 'common/group.php';
    require_once 'common/users.php';
    require_once 'tracker/tracker.php';
    require_once 'frs/frs.php';
    // include the <Plugin> API (only if plugin is available)
    $event_manager->processEvent('soap', array());
} catch (Exception $e) {
    echo $e;
}
// if POST was used to send this request, we handle it
// else, we display a list of available methods
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (LOG_SOAP_REQUESTS) {