You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/10/17 18:11:59 UTC

svn commit: r585550 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description: WSDL11ToAxisServiceBuilder.java WSDL20ToAxisServiceBuilder.java WSDLToAxisServiceBuilder.java

Author: scheu
Date: Wed Oct 17 09:11:54 2007
New Revision: 585550

URL: http://svn.apache.org/viewvc?rev=585550&view=rev
Log:
Quick Change to add debug logging for support purpose.
The debug logging logs what wsdl is loaded and when (stack) it is loaded.
Contributor:Rich Scheuerle

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDLToAxisServiceBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=585550&r1=585549&r2=585550&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Wed Oct 17 09:11:54 2007
@@ -2149,6 +2149,13 @@
                 throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error",
                                         e);
             }
+            
+            // Log when and from where the WSDL is loaded.
+            if (log.isDebugEnabled()) {
+                log.debug("Reading 1.1 WSDL with base uri = " + getBaseUri());
+                log.debug("  the document base uri = " + getDocumentBaseUri());
+                log.debug("  the stack at this point is: " + stackToString());
+            }
             def = reader.readWSDL(getBaseUri(), doc);
             def.setDocumentBaseURI(getDocumentBaseUri());
             return def;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?rev=585550&r1=585549&r2=585550&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Wed Oct 17 09:11:54 2007
@@ -28,6 +28,8 @@
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.SOAPModuleMessage;
 import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.woden.WSDLException;
 import org.apache.woden.WSDLFactory;
 import org.apache.woden.WSDLReader;
@@ -96,6 +98,7 @@
 
 public class WSDL20ToAxisServiceBuilder extends WSDLToAxisServiceBuilder {
 
+    protected static final Log log = LogFactory.getLog(WSDL20ToAxisServiceBuilder.class);
     protected Description description;
 
     private String wsdlURI;
@@ -1074,6 +1077,12 @@
         WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
         // This turns on WSDL validation which is set off by default.
 //        reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
+        
+//      Log when and from where the WSDL is loaded.
+        if (log.isDebugEnabled()) {
+            log.debug("Reading 2.0 WSDL with wsdl uri = " + wsdlURI);
+            log.debug("  the stack at this point is: " + stackToString());
+        }
         return reader.readWSDL(wsdlURI);
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDLToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDLToAxisServiceBuilder.java?rev=585550&r1=585549&r2=585550&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDLToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDLToAxisServiceBuilder.java Wed Oct 17 09:11:54 2007
@@ -231,4 +231,68 @@
     public void setServiceName(QName serviceName) {
         this.serviceName = serviceName;
     }
+    
+    /**
+     * Get a string containing the stack of the current location
+     *
+     * @return String
+     */
+    protected static String stackToString() {
+        return stackToString(new RuntimeException());
+    }
+
+    /**
+     * Get a string containing the stack of the specified exception
+     *
+     * @param e
+     * @return
+     */
+    protected static String stackToString(Throwable e) {
+        java.io.StringWriter sw = new java.io.StringWriter();
+        java.io.BufferedWriter bw = new java.io.BufferedWriter(sw);
+        java.io.PrintWriter pw = new java.io.PrintWriter(bw);
+        e.printStackTrace(pw);
+        pw.close();
+        String text = sw.getBuffer().toString();
+        // Jump past the throwable
+        text = text.substring(text.indexOf("at"));
+        text = replace(text, "at ", "DEBUG_FRAME = ");
+        return text;
+    }
+    
+    /**
+     * replace: Like String.replace except that the old new items are strings.
+     *
+     * @param name string
+     * @param oldT old text to replace
+     * @param newT new text to use
+     * @return replacement string
+     */
+    protected static final String replace(String name,
+                                       String oldT, String newT) {
+
+        if (name == null) return "";
+
+        // Create a string buffer that is twice initial length.
+        // This is a good starting point.
+        StringBuffer sb = new StringBuffer(name.length() * 2);
+
+        int len = oldT.length();
+        try {
+            int start = 0;
+            int i = name.indexOf(oldT, start);
+
+            while (i >= 0) {
+                sb.append(name.substring(start, i));
+                sb.append(newT);
+                start = i + len;
+                i = name.indexOf(oldT, start);
+            }
+            if (start < name.length())
+                sb.append(name.substring(start));
+        } catch (NullPointerException e) {
+        }
+
+        return new String(sb);
+    }
 }



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