cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepti Dohare <deepti.doh...@citrix.com>
Subject [PATCH] CS-14345 Logout API is not returning XML header Description: The logout API is not returning the standard XML header and the CloudStack version.
Date Mon, 04 Jun 2012 11:00:42 GMT

Signed-off-by: Deepti Dohare <deepti.dohare@citrix.com>
---
 server/src/com/cloud/api/ApiServlet.java |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/server/src/com/cloud/api/ApiServlet.java b/server/src/com/cloud/api/ApiServlet.java
index b7b7fff..ba4856e 100755
--- a/server/src/com/cloud/api/ApiServlet.java
+++ b/server/src/com/cloud/api/ApiServlet.java
@@ -29,6 +29,7 @@ import org.apache.log4j.Logger;
 import com.cloud.cluster.StackMaid;
 import com.cloud.exception.CloudAuthenticationException;
 import com.cloud.server.ManagementServer;
+import com.cloud.server.ManagementService;
 import com.cloud.user.Account;
 import com.cloud.user.AccountService;
 import com.cloud.user.UserContext;
@@ -39,6 +40,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
 public class ApiServlet extends HttpServlet {
     public static final Logger s_logger = Logger.getLogger(ApiServlet.class.getName());
     private static final Logger s_accessLogger = Logger.getLogger("apiserver." + ApiServer.class.getName());
+    public static ManagementService _mgr = (ManagementService) ComponentLocator.getComponent(ManagementService.Name);
 
     private ApiServer _apiServer = null;
     private AccountService _accountMgr = null;
@@ -430,7 +432,10 @@ public class ApiServlet extends HttpServlet {
         if (BaseCmd.RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
             sb.append("{ \"logoutresponse\" : { \"description\" : \"success\" } }");
         } else {
-            sb.append("<logoutresponse><description>success</description></logoutresponse>");
+                sb.append("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
+                sb.append("<logoutresponse cloud-stack-version=\"" + _mgr.getVersion()
+ "\">");
+                sb.append("<description>success</description>");
+                sb.append("</logoutresponse>");
         }
         return sb.toString();
     }
-- 
1.7.4.1


Mime
View raw message