You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/07/18 10:08:11 UTC

svn commit: r423005 - /geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java

Author: djencks
Date: Tue Jul 18 01:08:10 2006
New Revision: 423005

URL: http://svn.apache.org/viewvc?rev=423005&view=rev
Log:
GERONIMO-1557 show the axis page for a url of a web service

Modified:
    geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java

Modified: geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java?rev=423005&r1=423004&r2=423005&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java (original)
+++ geronimo/branches/1.1/modules/axis/src/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java Tue Jul 18 01:08:10 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.axis.server;
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.net.URI;
 import java.util.Iterator;
 import java.util.Map;
@@ -120,7 +121,15 @@
 
                 responseMessage = messageContext.getResponseMessage();
             } catch (AxisFault fault) {
-                responseMessage = handleFault(fault, res, messageContext);
+                
+               	if(req.getMethod() == req.GET && req.getParameters().isEmpty()){
+               		String serviceName = req.getURI().getRawPath();
+                    serviceName = serviceName.substring(serviceName.lastIndexOf("/")+1);
+               		printServiceInfo(res,serviceName);
+               		return;
+               	}else{
+               		responseMessage = handleFault(fault, res, messageContext);
+               	}
 
             } catch (Exception e) {
                 responseMessage = handleException(messageContext, res, e);
@@ -265,4 +274,49 @@
         }
         return new AxisWebServiceContainer(location, wsdlLocation, service, wsdlMap, classLoader);
     }
+
+    /**
+     * print a snippet of service info.
+     * @param response response
+     * @param serviceName Name of the service
+     */
+
+    private void printServiceInfo(Response response,String serviceName) throws IOException{
+        response.setContentType("text/html; charset=utf-8");
+        StringBuffer output = new StringBuffer("<h1>")
+                .append(serviceName).append("</h1>\n");
+
+        output.append("<p>").append(Messages.getMessage("axisService00"))
+                .append("</p>\n");
+        output.append(
+                "<i>").append(
+                Messages.getMessage("perhaps00") ).append(
+                "</i>\n");
+        response.getOutputStream().write(output.toString().getBytes());
+    }
+
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+