axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/transport/http AxisServlet.java
Date Wed, 23 Oct 2002 18:06:20 GMT
stevel      2002/10/23 11:06:20

  Modified:    java/src/org/apache/axis/transport/http AxisServlet.java
  Log:
  slightly more helpful tracing and responses when something is awry with WSDL generation.
Now callers can differentiate between no-service and bad-server-config
  
  Revision  Changes    Path
  1.148     +25 -3     xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java
  
  Index: AxisServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/AxisServlet.java,v
  retrieving revision 1.147
  retrieving revision 1.148
  diff -u -r1.147 -r1.148
  --- AxisServlet.java	27 Sep 2002 15:32:01 -0000	1.147
  +++ AxisServlet.java	23 Oct 2002 18:06:19 -0000	1.148
  @@ -431,12 +431,19 @@
                   response.setContentType("text/xml");
                   XMLUtils.DocumentToWriter(doc, writer);
               } else {
  -                reportNoWSDL(response, writer);
  +                if (log.isDebugEnabled()) {
  +                    log.debug("processWsdlRequest: failed to create WSDL");
  +                }
  +                reportNoWSDL(response, writer, "noWSDL02", null);
               }
           } catch (AxisFault axisFault) {
               //the no-service fault is mapped to a no-wsdl error
               if(axisFault.getFaultCode() .equals(Constants.QNAME_NO_SERVICE_FAULT_CODE))
{
  -                reportNoWSDL(response, writer);
  +                //which we log before reporting.
  +                if(log.isDebugEnabled()) {
  +                    log.debug(Messages.getMessage("exception00"), axisFault);
  +                }
  +                reportNoWSDL(response, writer, "noWSDL01", axisFault);
               } else {
                   throw axisFault;
               }
  @@ -553,8 +560,11 @@
        * report that we have no WSDL
        * @param res
        * @param writer
  +     * @param moreDetailCode optional name of a message to provide more detail
  +     * @param axisFault optional fault string, for extra info at debug time only
        */
  -    protected void reportNoWSDL(HttpServletResponse res, PrintWriter writer) {
  +    protected void reportNoWSDL(HttpServletResponse res, PrintWriter writer,
  +                                String moreDetailCode, AxisFault axisFault) {
           res.setStatus(HttpURLConnection.HTTP_NOT_FOUND);
           res.setContentType("text/html");
           writer.println("<h2>" +
  @@ -563,6 +573,18 @@
           writer.println("<p>" +
                          Messages.getMessage("noWSDL00") +
                          "</p>");
  +        if(moreDetailCode!=null) {
  +            writer.println("<p>"
  +                    +Messages.getMessage(moreDetailCode)
  +                    +"</p>");
  +        }
  +
  +        if(axisFault!=null && isDevelopment()) {
  +            //dev systems only give fault dumps
  +            writer.println("<pre>Exception - " + axisFault.getLocalizedMessage()+
"<br>");
  +            writer.println(axisFault.dumpToString());
  +            writer.println("</pre>");
  +        }
       }
   
       /**
  
  
  

Mime
View raw message