You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by az...@apache.org on 2007/05/15 13:01:29 UTC

svn commit: r538135 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http: AxisServlet.java server/AxisHttpService.java

Author: azeez
Date: Tue May 15 04:01:27 2007
New Revision: 538135

URL: http://svn.apache.org/viewvc?view=rev&rev=538135
Log:
Getting the HTTP Basic Auth properties from the MessageContext


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=538135&r1=538134&r2=538135
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java Tue May 15 04:01:27 2007
@@ -320,8 +320,7 @@
             } else {
 
                 String status =
-                        (String) msgContext.getOperationContext().
-                                getProperty(Constants.HTTP_RESPONSE_STATE);
+                        (String) msgContext.getProperty(Constants.HTTP_RESPONSE_STATE);
                 if (status == null) {
                     res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
                 } else {
@@ -495,7 +494,7 @@
         String contextPath = req.getContextPath();
         //handling ROOT scenario, for servlets in the default (root) context, this method returns ""
         if (contextPath != null && contextPath.length() == 0) {
-           contextPath = "/";
+            contextPath = "/";
         }
         this.contextRoot = contextPath;
 
@@ -711,12 +710,11 @@
     }
 
     private void setResponseState(MessageContext messageContext, HttpServletResponse response) {
-        OperationContext opCtx = messageContext.getOperationContext();
-        String state = (String) opCtx.getProperty(Constants.HTTP_RESPONSE_STATE);
+        String state = (String) messageContext.getProperty(Constants.HTTP_RESPONSE_STATE);
         if (state != null) {
             int stateInt = Integer.parseInt(state);
             if (stateInt == HttpServletResponse.SC_UNAUTHORIZED) { // Unauthorized
-                String realm = (String) opCtx.getProperty(Constants.HTTP_BASIC_AUTH_REALM);
+                String realm = (String) messageContext.getProperty(Constants.HTTP_BASIC_AUTH_REALM);
                 response.addHeader("WWW-Authenticate",
                                    "basic realm=\"" + realm + "\"");
             }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java?view=diff&rev=538135&r1=538134&r2=538135
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java Tue May 15 04:01:27 2007
@@ -283,13 +283,13 @@
             if (AddressingHelper.isFaultRedirected(msgContext)) {
                 response.setStatus(HttpStatus.SC_ACCEPTED);
             } else {
-                OperationContext opCtx = msgContext.getOperationContext();
-                String state = (String) opCtx.getProperty(Constants.HTTP_RESPONSE_STATE);
+                String state = (String) msgContext.getProperty(Constants.HTTP_RESPONSE_STATE);
                 if (state != null) {
                     int stateInt = Integer.parseInt(state);
                     response.setStatus(stateInt);
                     if (stateInt == HttpServletResponse.SC_UNAUTHORIZED) { // Unauthorized
-                        String realm = (String) opCtx.getProperty(Constants.HTTP_BASIC_AUTH_REALM);
+                        String realm =
+                                (String) msgContext.getProperty(Constants.HTTP_BASIC_AUTH_REALM);
                         response.addHeader("WWW-Authenticate",
                                            "basic realm=\"" + realm + "\"");
                     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org