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 de...@apache.org on 2005/06/30 09:50:48 UTC

svn commit: r202501 - in /webservices/axis/trunk/java/modules/core: src/org/apache/axis/Constants.java src/org/apache/axis/transport/http/ListingAgent.java webapp/HappyAxis.jsp webapp/listService.jsp webapp/listServices.jsp webapp/listSingleService.jsp

Author: deepal
Date: Thu Jun 30 00:50:47 2005
New Revision: 202501

URL: http://svn.apache.org/viewcvs?rev=202501&view=rev
Log:
?wsdl is done, so now it can see the wsdl by /serverName?wsdl

and a fix a bug in happyaxis

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java
    webservices/axis/trunk/java/modules/core/webapp/HappyAxis.jsp
    webservices/axis/trunk/java/modules/core/webapp/listService.jsp
    webservices/axis/trunk/java/modules/core/webapp/listServices.jsp
    webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/Constants.java Thu Jun 30 00:50:47 2005
@@ -155,6 +155,7 @@
      * Field SINGLE_SERVICE
      */
     public static final String SINGLE_SERVICE = "singleservice";
+    public static final String WSDL_CONTENT = "wsdl";
 
     /**
      * Field METHOD_NAME_ESCAPE_CHARACTOR

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/ListingAgent.java Thu Jun 30 00:50:47 2005
@@ -18,6 +18,8 @@
 package org.apache.axis.transport.http;
 
 import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -371,15 +373,27 @@
             throws IOException {
         String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1, filePart.length());
         HashMap services = configContext.getAxisConfiguration().getServices();
+        String wsdl = req.getParameter("wsdl");
         if ((services != null) && !services.isEmpty()) {
             Object serviceObj = services.get(new QName(serviceName));
             if (serviceObj != null) {
-                req.getSession().setAttribute(Constants.SINGLE_SERVICE, serviceObj);
+                if(wsdl != null){
+                    StringWriter writer = new StringWriter();
+                    ((ServiceDescription)serviceObj).printWSDL(writer);
+                    String wsdl_value = writer.toString() ;
+                    if(wsdl_value == null || wsdl_value.trim().equals("")){
+                        wsdl_value = "WSDL is not available!!!";
+                    }
+                    res.setContentType("text/xml");
+                    req.getSession().setAttribute(Constants.WSDL_CONTENT, wsdl_value);
+                }   else {
+                    req.getSession().setAttribute(Constants.SINGLE_SERVICE, serviceObj);
+                }
             }
         }
         String URI = req.getRequestURI();
         URI = URI.substring(0, URI.indexOf("services"));
         res.sendRedirect(URI + LIST_SINGLE_SERVICE_JSP_NAME);
     }
-    
+
 }

Modified: webservices/axis/trunk/java/modules/core/webapp/HappyAxis.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/HappyAxis.jsp?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/HappyAxis.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/HappyAxis.jsp Thu Jun 30 00:50:47 2005
@@ -10,7 +10,6 @@
                  org.apache.axis.addressing.EndpointReference,
                  org.apache.axis.clientapi.Call,
                  org.apache.axis.om.*,
-                 org.apache.axis.om.impl.llom.OMOutput,
                  org.apache.axis.soap.SOAPBody,
                  org.apache.axis.soap.SOAPEnvelope,
                  org.apache.axis.soap.SOAPFactory,

Modified: webservices/axis/trunk/java/modules/core/webapp/listService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/listService.jsp?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/listService.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/listService.jsp Thu Jun 30 00:50:47 2005
@@ -56,7 +56,7 @@
                  operations = axisService.getOperations();
                  operationsList = operations.values();
                  serviceName = axisService.getName().getLocalPart();
-     %><hr><h2><font color="blue"><a href="listSingleService.jsp?wsdl=<%=serviceName%>"><%=serviceName%></a></font></h2>
+     %><hr><h2><font color="blue"><a href="<%=prifix + axisService.getName().getLocalPart()%>?wsdl=<%=serviceName%>"><%=serviceName%></a></font></h2>
      <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
            <%
                  Collection engagdeModules = axisService.getEngagedModules();

Modified: webservices/axis/trunk/java/modules/core/webapp/listServices.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/listServices.jsp?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/listServices.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/listServices.jsp Thu Jun 30 00:50:47 2005
@@ -47,7 +47,7 @@
             operations = axisService.getOperations();
             operationsList = operations.values();
             serviceName = axisService.getName().getLocalPart();
-            %><hr><h2><font color="blue"><%=serviceName%></font></h2>
+            %><hr><h2><font color="blue"><a href="<%=prifix + axisService.getName().getLocalPart()%>?wsdl=<%=serviceName%>"></a><%=serviceName%></font></h2>
             <h4>Service Description : <font color="black"><%=axisService.getServiceDescription()%></h4>
            <%
             if (operationsList.size() > 0) {

Modified: webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp?rev=202501&r1=202500&r2=202501&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp (original)
+++ webservices/axis/trunk/java/modules/core/webapp/listSingleService.jsp Thu Jun 30 00:50:47 2005
@@ -16,49 +16,46 @@
   To change this template use File | Settings | File Templates.
 --%>
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<html>
-        <head>
-        <title>Single Service List</title>
-        <link href="css/axis-style.css" rel="stylesheet" type="text/css">
-        </head>
-  <body>
 <%--        <jsp:include page="include/header.inc"></jsp:include>--%>
 
         <%
             ServiceDescription service = (ServiceDescription)request.getSession().getAttribute(Constants.SINGLE_SERVICE);
+            String wsdl_value = (String)request.getSession().getAttribute(Constants.WSDL_CONTENT);
             //System.out.println("service = " + service);
             String isFault = (String)request.getSession().getAttribute(Constants.IS_FAULTY);
             String wsdl = request.getParameter("wsdl");
             boolean isWsdl = false;
-            if(wsdl!=null){
-                HashMap map = (HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
-                ServiceDescription wsdlservice = (ServiceDescription)map.get(new QName(wsdl));
-                StringWriter writter = new StringWriter();
-                String value =  writter.toString();
-                wsdlservice.printWSDL(writter);
-                response.sendRedirect(value);
-                //TODO fix me 
-                isWsdl = true;
-            }
-//            if(wsdl !=null){
-//                HashMap services =(HashMap)request.getSession().getAttribute(Constants.SERVICE_MAP);
-//                ServiceDescription service_wsdl =(ServiceDescription)services.get(new QName(wsdl));
-//                service_wsdl.printWSDL(response.getWriter());
-//                return;
-//            }
-            if(Constants.IS_FAULTY.equals(isFault)){
+            if(wsdl_value!=null){
+                %>
+                <%=wsdl_value%>
+                <%
+            } else if(Constants.IS_FAULTY.equals(isFault)){
                 Hashtable errornessservices =(Hashtable)request.getSession().getAttribute(Constants.ERROR_SERVICE_MAP);
                 String servicName = (String)request.getParameter("serviceName");
-                %> <h3>This Web service has deployment faults</h3><%
-                %><font color="red" ><%=(String)errornessservices.get(servicName) %></font><%
+                %> <html>
+                        <head>
+                        <title>Single Service List</title>
+                        <link href="css/axis-style.css" rel="stylesheet" type="text/css">
+                    </head>
+                    <body>
+                    <h3>This Web service has deployment faults</h3><%
+                     %><font color="red" ><%=(String)errornessservices.get(servicName) %></font>
+                 </body>
+            </html>
+                <%
 
-            }else{
-        %> Oh! this place seems to be empty!!! <%
-}
-       %>
+                    }else{
+                %><html>
+                    <head>
+                        <title>Single Service List</title>
+                        <link href="css/axis-style.css" rel="stylesheet" type="text/css">
+                    </head>
+                <body>
+             Oh! this place seems to be empty!!!</body>
+</html> <%
+            }
+        %>
 
 
 <%--        <jsp:include page="include/link-footer.inc"></jsp:include>--%>
 <%--        <jsp:include page="include/footer.inc"></jsp:include>--%>
-</body>
-</html>
\ No newline at end of file