axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r191415 - in /webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment: DeploymentEngine.java DeploymentParser.java repository/utill/ArchiveFileData.java repository/utill/ArchiveReader.java
Date Mon, 20 Jun 2005 07:46:29 GMT
Author: deepal
Date: Mon Jun 20 00:46:28 2005
New Revision: 191415

URL: http://svn.apache.org/viewcvs?rev=191415&view=rev
Log:
creating service form WSDL file , the WSDL file has to be inside the MEAT-INF and name should
be service.wsdl. and if it is not found then the service will be build only using service.xml

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveFileData.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=191415&r1=191414&r2=191415&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
Mon Jun 20 00:46:28 2005
@@ -539,6 +539,7 @@
                     currentArchiveFile.setClassLoader();
                 } catch (AxisFault axisFault) {
                     log.info("Setting Class Loader  " +axisFault);
+                    continue;
                 }
                 ArchiveReader archiveReader = new ArchiveReader();
                 String serviceStatus = "";

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java?rev=191415&r1=191414&r2=191415&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
Mon Jun 20 00:46:28 2005
@@ -23,6 +23,8 @@
 import org.apache.axis.engine.MessageReceiver;
 import org.apache.axis.transport.TransportListener;
 import org.apache.axis.transport.TransportSender;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
@@ -42,6 +44,8 @@
  * parse a given document
  */
 public class DeploymentParser implements DeploymentConstants {
+
+    private Log log = LogFactory.getLog(getClass());
     //module.xml strating tag
     private static final String MODULEXMLST = "module";
     // service.xml strating tag
@@ -406,7 +410,7 @@
                         throw new UnsupportedOperationException("Bean mapping dose not implemented
yet ");
                         // processBeanMapping();
                     } else if (OPRATIONST.equals(ST)) {
-                        OperationDescription operation = processOperation();
+                        OperationDescription operation = processOperation(axisService);
                         DeploymentData.getInstance().setOperationPhases(operation);
                         if (operation.getMessageReciever() == null) {
                             try {
@@ -689,16 +693,24 @@
         }
     }
 
-    private OperationDescription processOperation() throws DeploymentException {
+    private OperationDescription processOperation(ServiceDescription axisService) throws
DeploymentException {
         //  String name = pullparser.getLocalName();
-        OperationDescription operation = new OperationDescription();
+        OperationDescription operation = null; //= new OperationDescription();
         int attribCount = pullparser.getAttributeCount();
         if (attribCount > 0) { // there should be two attributes
             for (int i = 0; i < attribCount; i++) {
                 String attname = pullparser.getAttributeLocalName(i);
                 String attvalue = pullparser.getAttributeValue(i);
                 if (ATTNAME.equals(attname)) {
-                    operation.setName(new QName(attvalue));
+                    if(axisService !=null){
+                        operation = axisService.getOperation(attvalue);
+                    }
+                    if(operation == null){
+                        operation = new OperationDescription();
+                        operation.setName(new QName(attvalue));
+                        log.info(attvalue + "  Operation Name not found in WSDL");
+                    }
+
                 } else if(MEP.equals(attname)){
                     operation.setMessageExchangePattern(attvalue);
                 }else
@@ -878,7 +890,7 @@
                         Flow outFlow = processOutFlow();
                         module.setOutFlow(outFlow);
                     } else if (OPRATIONST.equals(ST)) {
-                        OperationDescription operation = processOperation();
+                        OperationDescription operation = processOperation(null);
                         DeploymentData.getInstance().setOperationPhases(operation);
                         if (operation.getMessageReciever() == null) {
                             try {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveFileData.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveFileData.java?rev=191415&r1=191414&r2=191415&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveFileData.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveFileData.java
Mon Jun 20 00:46:28 2005
@@ -17,13 +17,20 @@
 package org.apache.axis.deployment.repository.utill;
 
 import org.apache.axis.engine.AxisFault;
+import org.apache.axis.deployment.DeploymentParser;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipInputStream;
+import java.util.zip.ZipEntry;
 
 /**
  * ArchiveFileData = Hot Deployment File Item , to store infromation of the module or servise
@@ -108,7 +115,28 @@
                 }
                 urlsToLoadFrom = new URL[]{file.toURL()};
                 classLoader = new URLClassLoader(urlsToLoadFrom, parent);
-
+                try {
+                    ZipInputStream in = new ZipInputStream(new FileInputStream(file));
+                    ZipEntry entry;
+                    String entryName = "";
+                    while ((entry = in.getNextEntry()) != null) {
+                        entryName = entry.getName();
+                        if(entryName != null && entryName.startsWith("lib/") &&
entryName.endsWith(".jar")){
+                            ClassLoader prevCl = Thread.currentThread().getContextClassLoader();
+                            URL uuuu = classLoader.getResource(entryName);
+                            parent =
+                                    URLClassLoader.newInstance(new URL[]{uuuu}, prevCl);
+                            try {
+                                //Thread.currentThread().setContextClassLoader(urlCl);
+                            }catch(Exception e){
+                                e.printStackTrace();
+                            }
+                        }
+                    }
+                    in.close();
+                } catch (IOException e) {
+                    e.printStackTrace();  //To change body of catch statement use File |
Settings | File Templates.
+                }
             } catch (MalformedURLException e) {
                 throw new AxisFault(e.getMessage(), e);
             } catch (Exception e) {
@@ -116,7 +144,7 @@
             }
         } 
     }
-    
+
     public void addModule(QName moduleName){
         modules.add(moduleName);
     }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java?rev=191415&r1=191414&r2=191415&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/ArchiveReader.java
Mon Jun 20 00:46:28 2005
@@ -24,6 +24,8 @@
 import org.apache.axis.description.ModuleDescription;
 import org.apache.axis.description.ServiceDescription;
 import org.apache.axis.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import java.io.*;
 import java.util.zip.ZipEntry;
@@ -33,6 +35,8 @@
 
 public class ArchiveReader implements DeploymentConstants {
 
+    private Log log = LogFactory.getLog(getClass());
+
     public ServiceDescription createService(String filename) throws DeploymentException {
         WSDL1ToWOMBuilder builder = new WSDL1ToWOMBuilder();
         String strArchive = filename;
@@ -52,9 +56,10 @@
             zin.close();
             if (!foundwsdl) {
                 service = new ServiceDescription();
+                log.info("WSDL file not found for the service :  " + filename);
             }
         } catch (Exception e) {
-            throw new DeploymentException(e.getMessage());
+            throw new DeploymentException(e);
         }
         return service;
     }



Mime
View raw message