axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r559293 - in /webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2: description/AxisService.java transport/http/ListingAgent.java
Date Wed, 25 Jul 2007 02:48:24 GMT
Author: dims
Date: Tue Jul 24 19:48:23 2007
New Revision: 559293

URL: http://svn.apache.org/viewvc?view=rev&rev=559293
Log:
Fix for AXIS2-3002 - Axis 1.3RC2 does not work properly on websphere

Modified:
    webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java

Modified: webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=559293&r1=559292&r2=559293
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService.java
Tue Jul 24 19:48:23 2007
@@ -1136,7 +1136,9 @@
                                  "set useOriginalwsdl as false in your services.xml</reason>";
             out.write(wsdlntfound.getBytes());
             if (e != null) {
-                e.printStackTrace(new PrintWriter(out));
+                PrintWriter pw = new PrintWriter(out);
+                e.printStackTrace(pw);
+                pw.flush();
             }
             out.write("</error>".getBytes());
             out.flush();

Modified: webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java?view=diff&rev=559293&r1=559292&r2=559293
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java
(original)
+++ webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/transport/http/ListingAgent.java
Tue Jul 24 19:48:23 2007
@@ -219,14 +219,14 @@
             if (serviceObj != null) {
                 boolean isHttp = "http".equals(req.getScheme());
                 if (wsdl2 >= 0) {
-                    OutputStream out = res.getOutputStream();
                     res.setContentType("text/xml");
                     String ip = extractHostAndPort(filePart, isHttp);
                     String wsdlName = req.getParameter("wsdl2");
-                    if (!"".equals(wsdlName)) {
+                    if (wsdlName != null && wsdlName.length()>0) {
                         InputStream in = ((AxisService) serviceObj).getClassLoader()
                                 .getResourceAsStream(DeploymentConstants.META_INF + "/" +
wsdlName);
                         if (in != null) {
+                            OutputStream out = res.getOutputStream();
                             out.write(IOUtils.getStreamAsByteArray(in));
                             out.flush();
                             out.close();
@@ -234,6 +234,7 @@
                             res.sendError(HttpServletResponse.SC_NOT_FOUND);
                         }
                     } else {
+                        OutputStream out = res.getOutputStream();
                         ((AxisService) serviceObj)
                                 .printWSDL2(out, ip);
                         out.flush();
@@ -246,7 +247,7 @@
                     String ip = extractHostAndPort(filePart, isHttp);
                     String wsdlName = req.getParameter("wsdl");
 
-                    if (!"".equals(wsdlName)) {
+                    if (wsdlName != null && wsdlName.length()>0) {
                         AxisService axisServce = (AxisService) serviceObj;
                         axisServce.printUserWSDL(out, wsdlName);
                         out.flush();
@@ -258,7 +259,6 @@
                     }
                     return;
                 } else if (xsd >= 0) {
-                    OutputStream out = res.getOutputStream();
                     res.setContentType("text/xml");
                     AxisService axisService = (AxisService) serviceObj;
                     //call the populator
@@ -274,6 +274,7 @@
                                 (XmlSchema) schemaMappingtable.get(xsds);
                         if (schema != null) {
                             //schema is there - pump it outs
+                            OutputStream out = res.getOutputStream();
                             schema.write(new OutputStreamWriter(out, "UTF8"));
                             out.flush();
                             out.close();
@@ -281,6 +282,7 @@
                             InputStream in = axisService.getClassLoader()
                                     .getResourceAsStream(DeploymentConstants.META_INF + "/"
+ xsds);
                             if (in != null) {
+                                OutputStream out = res.getOutputStream();
                                 out.write(IOUtils.getStreamAsByteArray(in));
                                 out.flush();
                                 out.close();
@@ -301,6 +303,7 @@
                         if (list.size() > 0) {
                             XmlSchema schema = axisService.getSchema(0);
                             if (schema != null) {
+                                OutputStream out = res.getOutputStream();
                                 schema.write(new OutputStreamWriter(out, "UTF8"));
                                 out.flush();
                                 out.close();
@@ -310,6 +313,7 @@
                             String xsdNotFound = "<error>" +
                                     "<description>Unable to access schema for this
service</description>" +
                                     "</error>";
+                            OutputStream out = res.getOutputStream();
                             out.write(xsdNotFound.getBytes());
                             out.flush();
                             out.close();
@@ -318,8 +322,6 @@
                     return;
                 } else if (policy >= 0) {
 
-                    OutputStream out = res.getOutputStream();
-
                     ExternalPolicySerializer serializer = new ExternalPolicySerializer();
                     serializer.setAssertionsToFilter(configContext
                             .getAxisConfiguration().getLocalPolicyAssertions());
@@ -336,6 +338,7 @@
                             XMLStreamWriter writer;
 
                             try {
+                                OutputStream out = res.getOutputStream();
                                 writer = XMLOutputFactory.newInstance()
                                         .createXMLStreamWriter(out);
 
@@ -356,6 +359,7 @@
 
                         } else {
 
+                            OutputStream out = res.getOutputStream();
                             res.setContentType("text/html");
                             String outStr = "<b>No policy found for id="
                                             + idParam + "</b>";
@@ -371,6 +375,7 @@
                             XMLStreamWriter writer;
 
                             try {
+                                OutputStream out = res.getOutputStream();
                                 writer = XMLOutputFactory.newInstance()
                                         .createXMLStreamWriter(out);
 
@@ -390,6 +395,7 @@
                             }
                         } else {
 
+                            OutputStream out = res.getOutputStream();
                             res.setContentType("text/html");
                             String outStr = "<b>No effective policy for "
                                             + serviceName + " servcie</b>";



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


Mime
View raw message