浏览代码

Bug fix: properly compute the URLs/URIs for the soap server (and its extensions)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3536 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 10 年之前
父节点
当前提交
1d899df8e0
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      webservices/itop.wsdl.php
  2. 3 3
      webservices/soapserver.php

+ 1 - 1
webservices/itop.wsdl.php

@@ -66,7 +66,7 @@ else
 	$sRawFile = WebServicesBase::GetWSDLContents();
 }
 
-$sServerURI = 'http'.(utils::IsConnectionSecure() ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/soapserver.php';
+$sServerURI = utils::GetAbsoluteUrlAppRoot().'webservices/soapserver.php';
 if (isset($_REQUEST['service_category']) && (!empty($_REQUEST['service_category'])))
 {
 	$sServerURI .= "?service_category=".$_REQUEST['service_category'];

+ 3 - 3
webservices/soapserver.php

@@ -32,10 +32,10 @@ require_once(APPROOT.'/application/application.inc.php');
 require_once(APPROOT.'/application/startup.inc.php');
 
 // this file is generated dynamically with location = here
-$sWsdlUri = 'http'.(utils::IsConnectionSecure() ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/itop.wsdl.php';
+$sWsdlUri = utils::GetAbsoluteUrlAppRoot().'webservices/itop.wsdl.php';
 if (isset($_REQUEST['service_category']) && (!empty($_REQUEST['service_category'])))
 {
-	$sWsdlUri .= "soapserver.php?service_category=".$_REQUEST['service_category'];
+	$sWsdlUri .= "?service_category=".$_REQUEST['service_category'];
 }
 
 
@@ -99,7 +99,7 @@ else
 		if (is_subclass_of($sPHPClass, 'WebServicesBase'))
 		{
 			$sServiceCategory = $sPHPClass;
-			$sSoapServerUri = 'http'.(utils::IsConnectionSecure() ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/../webservices/soapserver.php';
+			$sSoapServerUri = utils::GetAbsoluteUrlAppRoot().'webservices/soapserver.php';
 			$sSoapServerUri .= "?service_category=$sServiceCategory";
 			echo "<li><a href=\"$sSoapServerUri\">$sServiceCategory</a></li>\n";
 		}