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 di...@apache.org on 2005/04/18 19:08:02 UTC

cvs commit: ws-axis/java/src/org/apache/axis/transport/http AxisServlet.java

dims        2005/04/18 10:08:02

  Modified:    java/src/org/apache/axis/transport/http AxisServlet.java
  Log:
  Partial fix for AXIS-1932 - global configuration properties axis.disableServiceList and axis.servicesPath don't work
  
  Notes:
  - just prevent the NPE for now to take this off the blocker list.
  
  Revision  Changes    Path
  1.188     +51 -49    ws-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- AxisServlet.java	18 Jan 2005 07:51:53 -0000	1.187
  +++ AxisServlet.java	18 Apr 2005 17:08:02 -0000	1.188
  @@ -251,58 +251,60 @@
               }
   
               boolean hasNoPath = (pathInfo == null || pathInfo.equals(""));
  -            if (!disableServicesList && hasNoPath) {
  -                // If the user requested the servlet (i.e. /axis/servlet/AxisServlet)
  -                // with no service name, present the user with a list of deployed
  -                // services to be helpful
  -                // Don't do this if has been turned off
  -                reportAvailableServices(response, writer, request);
  -            } else if (realpath != null) {
  -                // We have a pathname, so now we perform WSDL or list operations
  -
  -                // get message context w/ various properties set
  -                MessageContext msgContext = createMessageContext(engine,
  -                        request, response);
  -
  -                // NOTE:  HttpUtils.getRequestURL has been deprecated.
  -                // This line SHOULD be:
  -                //    String url = req.getRequestURL().toString()
  -                // HOWEVER!!!!  DON'T REPLACE IT!  There's a bug in
  -                // req.getRequestURL that is not in HttpUtils.getRequestURL
  -                // req.getRequestURL returns "localhost" in the remote
  -                // scenario rather than the actual host name.
  -                //
  -                // But more importantly, getRequestURL() is a servlet 2.3
  -                // API and to support servlet 2.2 (aka WebSphere 4)
  -                // we need to leave this in for a while longer. tomj 10/14/2004
  -                //
  -                String url = HttpUtils.getRequestURL(request).toString();
  -
  -                msgContext.setProperty(MessageContext.TRANS_URL, url);
  -
  -                // See if we can locate the desired service.  If we
  -                // can't, return a 404 Not Found.  Otherwise, just
  -                // print the placeholder message.
  -
  -                String serviceName;
  -                if (pathInfo.startsWith("/")) {
  -                    serviceName = pathInfo.substring(1);
  -                } else {
  -                    serviceName = pathInfo;
  -                }
  -
  -                SOAPService s = engine.getService(serviceName);
  -                if (s == null) {
  -                    //no service: report it
  -                    if (isJWSPage) {
  -                        reportCantGetJWSService(request, response, writer);
  +            if (!disableServicesList) {
  +                if(hasNoPath) {
  +                    // If the user requested the servlet (i.e. /axis/servlet/AxisServlet)
  +                    // with no service name, present the user with a list of deployed
  +                    // services to be helpful
  +                    // Don't do this if has been turned off
  +                    reportAvailableServices(response, writer, request);
  +                } else if (realpath != null) {
  +                    // We have a pathname, so now we perform WSDL or list operations
  +
  +                    // get message context w/ various properties set
  +                    MessageContext msgContext = createMessageContext(engine,
  +                            request, response);
  +
  +                    // NOTE:  HttpUtils.getRequestURL has been deprecated.
  +                    // This line SHOULD be:
  +                    //    String url = req.getRequestURL().toString()
  +                    // HOWEVER!!!!  DON'T REPLACE IT!  There's a bug in
  +                    // req.getRequestURL that is not in HttpUtils.getRequestURL
  +                    // req.getRequestURL returns "localhost" in the remote
  +                    // scenario rather than the actual host name.
  +                    //
  +                    // But more importantly, getRequestURL() is a servlet 2.3
  +                    // API and to support servlet 2.2 (aka WebSphere 4)
  +                    // we need to leave this in for a while longer. tomj 10/14/2004
  +                    //
  +                    String url = HttpUtils.getRequestURL(request).toString();
  +
  +                    msgContext.setProperty(MessageContext.TRANS_URL, url);
  +
  +                    // See if we can locate the desired service.  If we
  +                    // can't, return a 404 Not Found.  Otherwise, just
  +                    // print the placeholder message.
  +
  +                    String serviceName;
  +                    if (pathInfo.startsWith("/")) {
  +                        serviceName = pathInfo.substring(1);
                       } else {
  -                        reportCantGetAxisService(request, response, writer);
  +                        serviceName = pathInfo;
                       }
   
  -                } else {
  -                    //print a snippet of service info.
  -                    reportServiceInfo(response, writer, s, serviceName);
  +                    SOAPService s = engine.getService(serviceName);
  +                    if (s == null) {
  +                        //no service: report it
  +                        if (isJWSPage) {
  +                            reportCantGetJWSService(request, response, writer);
  +                        } else {
  +                            reportCantGetAxisService(request, response, writer);
  +                        }
  +
  +                    } else {
  +                        //print a snippet of service info.
  +                        reportServiceInfo(response, writer, s, serviceName);
  +                    }
                   }
               } else {
                   // We didn't have a real path in the request, so just