axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r547820 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: deployment/DeploymentEngine.java deployment/repository/util/ArchiveReader.java handlers/AbstractHandler.java transport/http/AxisServlet.java
Date Fri, 15 Jun 2007 22:42:54 GMT
Author: deepal
Date: Fri Jun 15 15:42:50 2007
New Revision: 547820

URL: http://svn.apache.org/viewvc?view=rev&rev=547820
Log:
fixing AXIS2-1587 and code cleanup

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/handlers/AbstractHandler.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=547820&r1=547819&r2=547820
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
Fri Jun 15 15:42:50 2007
@@ -285,10 +285,16 @@
                     if (line.length() > 0) {
                         line = metainf + "/" + line;
                         try {
-                            AxisService service = reader.getAxisServiceFromWsdl(
+                            List services = reader.getAxisServiceFromWsdl(
                                     serviceClassLoader.getResourceAsStream(line),
                                     serviceClassLoader, line);
-                            servicesMap.put(service.getName(), service);
+                            if(services!=null){
+                                for (int i = 0; i < services.size(); i++) {
+                                    AxisService axisService = (AxisService) services.get(i);
+                                    servicesMap.put(axisService.getName(), axisService);
+                                }
+                            }
+
                         } catch (Exception e) {
                             throw new DeploymentException(e);
                         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=547820&r1=547819&r2=547820
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Fri Jun 15 15:42:50 2007
@@ -32,13 +32,7 @@
 import org.apache.axis2.deployment.resolver.AARFileBasedURIResolver;
 import org.apache.axis2.deployment.resolver.WarBasedWSDLLocator;
 import org.apache.axis2.deployment.resolver.WarFileBasedURIResolver;
-import org.apache.axis2.description.AxisModule;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL20ToAxisServiceBuilder;
-import org.apache.axis2.description.WSDLToAxisServiceBuilder;
-import org.apache.axis2.description.WSDL2Constants;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.namespace.Constants;
@@ -56,6 +50,7 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -202,7 +197,7 @@
      * @return Returns AxisService.
      * @throws DeploymentException
      */
-    private AxisService processWSDLFile(WSDLToAxisServiceBuilder axisServiceBuilder,
+    private List processWSDLFile(WSDLToAxisServiceBuilder axisServiceBuilder,
                                         File serviceArchiveFile,
                                         boolean isArchive, InputStream in, String baseURI)
             throws DeploymentException {
@@ -211,11 +206,11 @@
             if (serviceArchiveFile != null && isArchive) {
                 axisServiceBuilder.setCustomResolver(
                         new AARFileBasedURIResolver(serviceArchiveFile));
-                if (axisServiceBuilder instanceof WSDL11ToAxisServiceBuilder) {
+                if (axisServiceBuilder instanceof WSDL11ToAllAxisServicesBuilder) {
 
-                    ((WSDL11ToAxisServiceBuilder) axisServiceBuilder).setCustomWSLD4JResolver(
+                    ((WSDL11ToAllAxisServicesBuilder) axisServiceBuilder).setCustomWSLD4JResolver(
                             new AARBasedWSDLLocator(baseURI, serviceArchiveFile, in));
-                } else if (axisServiceBuilder instanceof WSDL20ToAxisServiceBuilder) {
+                } else if (axisServiceBuilder instanceof WSDL20ToAllAxisServicesBuilder)
{
                     // trying to use the jar scheme as the base URI. I think this can be
used to handle
                     // wsdl 1.1 as well without using a custome URI resolver. Need to look
at it later.
                     axisServiceBuilder.setBaseUri(
@@ -227,14 +222,18 @@
                             serviceArchiveFile.getParentFile().getAbsolutePath());
                 }
             }
-            return axisServiceBuilder.populateService();
+            if(axisServiceBuilder instanceof WSDL11ToAllAxisServicesBuilder ) {
+               return  ((WSDL11ToAllAxisServicesBuilder)axisServiceBuilder).populateAllServices();
+            } else  if (axisServiceBuilder instanceof WSDL20ToAllAxisServicesBuilder){
+               return ((WSDL20ToAllAxisServicesBuilder)axisServiceBuilder).populateAllServices();
+            }
         } catch (AxisFault axisFault) {
             log.info("Trouble processing wsdl file :" + axisFault.getMessage());
             if (log.isDebugEnabled()) {
                 log.debug(axisFault);
             }
-            return null;
         }
+        return null;
     }
 
     /**
@@ -326,13 +325,18 @@
                             } else {
                                 throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));
                             }
-                            AxisService service = processWSDLFile(wsdlToAxisServiceBuilder,
+                            List services = processWSDLFile(wsdlToAxisServiceBuilder,
                                                                   serviceFile, true,
                                                                   new ByteArrayInputStream(
                                                                           out.toByteArray()),
                                                                   entry.getName());
-                            if (service != null) {
-                                servicesMap.put(service.getName(), service);
+                            if (services!=null) {
+                                for (int i = 0; i < services.size(); i++) {
+                                    AxisService axisService = (AxisService) services.get(i);
+                                    if (axisService != null) {
+                                        servicesMap.put(axisService.getName(), axisService);
+                                    }
+                                }
                             }
                         }
                     }
@@ -358,7 +362,7 @@
         return servicesMap;
     }
 
-    public AxisService getAxisServiceFromWsdl(InputStream in,
+    public List getAxisServiceFromWsdl(InputStream in,
                                               ClassLoader loader, String wsdlUrl) throws
Exception {
 //         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
 
@@ -369,20 +373,20 @@
         OMElement element = (OMElement) XMLUtils.toOM(in);
         OMNamespace documentElementNS = element.getNamespace();
         if (documentElementNS != null) {
-            WSDL11ToAxisServiceBuilder wsdlToAxisServiceBuilder;
+            WSDL11ToAllAxisServicesBuilder wsdlToAxisServiceBuilder;
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             element.serialize(out);
             if (Constants.NS_URI_WSDL11.
                     equals(documentElementNS.getNamespaceURI())) {
-                wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(
-                        new ByteArrayInputStream(out.toByteArray()), null, null);
+                wsdlToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(
+                        new ByteArrayInputStream(out.toByteArray()));
                 wsdlToAxisServiceBuilder.setCustomWSLD4JResolver(new WarBasedWSDLLocator(wsdlUrl,
                                                                                         
loader,
                                                                                         
new ByteArrayInputStream(
                                                                                         
        out.toByteArray())));
                 wsdlToAxisServiceBuilder.setCustomResolver(
                         new WarFileBasedURIResolver(loader));
-                return wsdlToAxisServiceBuilder.populateService();
+              return  wsdlToAxisServiceBuilder.populateAllServices();
             } else {
                 throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));
             }
@@ -410,29 +414,34 @@
                             .equals(documentElementNS.getNamespaceURI())) {
                         // we have a WSDL 2.0 document here.
                         in2 = new FileInputStream(file1);
-                        wsdlToAxisServiceBuilder = new WSDL20ToAxisServiceBuilder(in2, null,
null);
+                        wsdlToAxisServiceBuilder = new WSDL20ToAllAxisServicesBuilder(in2);
                     } else if (Constants.NS_URI_WSDL11.
                             equals(documentElementNS.getNamespaceURI())) {
                         in2 = new FileInputStream(file1);
-                        wsdlToAxisServiceBuilder = new WSDL11ToAxisServiceBuilder(in2, null,
null);
+                        wsdlToAxisServiceBuilder = new WSDL11ToAllAxisServicesBuilder(in2);
                     } else {
                         throw new DeploymentException(Messages.getMessage("invalidWSDLFound"));
                     }
 
                     FileInputStream in3 = new FileInputStream(file1);
-                    AxisService service = processWSDLFile(wsdlToAxisServiceBuilder, file1,
false,
+                    List services = processWSDLFile(wsdlToAxisServiceBuilder, file1, false,
                                                           in2, file1.toURI().toString());
+
+                    if(services!=null){
+                        for (int j = 0; j < services.size(); j++) {
+                            AxisService axisService = (AxisService) services.get(j);
+                            if (axisService != null) {
+                                servicesMap.put(axisService.getName(), axisService);
+                            }
+                        }
+                    }
                     try {
                         in2.close();
                         in3.close();
                     } catch (IOException e) {
                         log.info(e);
                     }
-                    if (service != null) {
-                        servicesMap.put(service.getName(), service);
-                    }
                 }
-
                 try {
                     in.close();
                 } catch (IOException e) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/handlers/AbstractHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/handlers/AbstractHandler.java?view=diff&rev=547820&r1=547819&r2=547820
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/handlers/AbstractHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/handlers/AbstractHandler.java
Fri Jun 15 15:42:50 2007
@@ -17,7 +17,6 @@
 
 package org.apache.axis2.handlers;
 
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.Parameter;
@@ -51,7 +50,6 @@
     /**
      * Method init.
      *
-     * @param handlerdesc
      */
     public void init(HandlerDescription handlerdesc) {
         this.handlerDesc = handlerdesc;
@@ -90,7 +88,7 @@
     /**
      * Method getParameter.
      *
-     * @param name
+     * @param name name of the parameter
      * @return Returns Parameter.
      */
     public Parameter getParameter(String name) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java?view=diff&rev=547820&r1=547819&r2=547820
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AxisServlet.java
Fri Jun 15 15:42:50 2007
@@ -363,7 +363,6 @@
             throws AxisFault {
         msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
 
-        AxisEngine engine = new AxisEngine(configContext);
         MessageContext faultContext =
                 MessageContextBuilder.createFaultMessageContext(msgContext, e);
         msgContext.setEnvelope(faultContext.getEnvelope());



---------------------------------------------------------------------
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