4 // 0. Include GForge files for access to GForge system
5 require_once '../env.inc.php';
6 require_once $gfwww.'include/pre.php';
7 require_once $gfcommon.'include/gettext.php';
8 require_once $gfcommon.'include/FusionForge.class.php';
10 ini_set('memory_limit','32M');
12 $uri = 'http://'.forge_get_config('web_host');
13 // 1. include client and server
14 require_once $gfwww.'soap/nusoap.php';
16 // 2. instantiate server object
17 $server = new soap_server();
18 $server->setDebugLevel(0);
19 //configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http');
20 //$server->configureWSDL('GForgeAPI',$uri);
21 $server->configureWSDL('FusionForgeAPI',$uri,false,'rpc','http://schemas.xmlsoap.org/soap/http',$uri);
24 $server->wsdl->addComplexType(
31 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')),
35 $server->wsdl->addComplexType(
42 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:integer[]')),
46 $server->wsdl->addComplexType(
53 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:long[]')),
57 $server->wsdl->addComplexType(
64 array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:int[]')),
68 // session/authentication
71 array('userid'=>'xsd:string','passwd'=>'xsd:string'),
72 array('loginResponse'=>'xsd:string'),
78 array('session_ser'=>'xsd:string'),
79 array('logoutResponse'=>'xsd:string'),
86 array('versionResponse'=>'xsd:string'),
90 // Include Group Functions
92 require_once $gfwww.'soap/common/group.php';
95 // Include User Functions
97 require_once $gfwww.'soap/common/user.php';
100 // Include tracker & tracker query Functions
102 require_once $gfwww.'soap/tracker/tracker.php';
103 require_once $gfwww.'soap/tracker/query.php';
106 // Include Docman Functions
108 require_once $gfwww.'soap/docman/docman.php';
111 // Include tasks Functions
113 require_once $gfwww.'soap/pm/pm.php';
114 require_once $gfwww.'soap/reporting/timeentry.php';
117 // Include frs Functions
119 require_once $gfwww.'soap/frs/frs.php';
122 // Include SCM Functions
124 require_once $gfwww.'soap/scm/scm.php';
127 $wsdl_data = $server->wsdl->serialize();
130 if ($wsdl == "save") {
131 $fp = fopen ("/tmp/SoapAPI1.wsdl", 'w');
132 fputs ($fp, $wsdl_data);
143 * continueSession - A utility method to carry on with an already established session
145 * @param string The session key
147 function continue_session($sessionKey) {
148 session_continue($sessionKey);
151 // session/authentication
153 * login - Logs in a SOAP client
155 * @param string userid The user's unix id
156 * @param string passwd The user's passwd in clear text
158 * @return string the session key
160 function login($userid, $passwd) {
161 global $feedback, $session_ser;
163 setlocale (LC_TIME, _('en_US'));
165 $res = session_login_valid($userid, $passwd);
168 return new soap_fault('1001', 'user', "Unable to log in with userid of ".$userid, $feedback);
175 * logout - Logs out a SOAP client
177 * @param string sessionkey The session key
179 function logout($session_ser) {
180 continue_session($session_ser);
186 * version - get the running version of FusionForge
188 * @return string the version of FusionForge running on the server
191 $ff = new FusionForge();
192 return $ff->software_version;
195 // 4. call the service method to initiate the transaction and send the response
196 $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
197 $server->service($HTTP_RAW_POST_DATA);
199 if(isset($log) and $log != ''){
200 harness('nusoap_r2_base_server',$server->headers['User-Agent'],$server->methodname,$server->request,$server->response,$server->result);