geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hogst...@apache.org
Subject svn commit: r448154 - in /geronimo/server/trunk/modules: geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
Date Wed, 20 Sep 2006 10:51:18 GMT
Author: hogstrom
Date: Wed Sep 20 03:51:18 2006
New Revision: 448154

URL: http://svn.apache.org/viewvc?view=rev&rev=448154
Log:
GERONIMO-1557 Show WebService Name rather than throw a SOAPFault to more closely mimic Tomcat
behaviour

Modified:
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
    geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?view=diff&rev=448154&r1=448153&r2=448154
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
Wed Sep 20 03:51:18 2006
@@ -94,8 +94,9 @@
         Map schemaTypeKeyToSchemaTypeMap = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();
 
         JavaServiceDesc serviceDesc = new JavaServiceDesc();
-
+        String serviceName =  portInfo.getPortQName().toString();
         String location = getAddressLocation(port);
+        serviceDesc.setName(serviceName);
         serviceDesc.setEndpointURL(location);
         serviceDesc.setWSDLFile(portInfo.getWsdlLocation());
         Binding binding = port.getBinding();

Modified: geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java?view=diff&rev=448154&r1=448153&r2=448154
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis/src/main/java/org/apache/geronimo/axis/server/AxisWebServiceContainer.java
Wed Sep 20 03:51:18 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());
+    }
+
 }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+



Mime
View raw message