geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1090794 - /geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Date Sun, 10 Apr 2011 12:57:09 GMT
Author: xuhaihong
Date: Sun Apr 10 12:57:09 2011
New Revision: 1090794

URL: http://svn.apache.org/viewvc?rev=1090794&view=rev
Log:
GERONIMO-5839 Workaround for WSDL path in EAR package

Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java?rev=1090794&r1=1090793&r2=1090794&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2-builder/src/main/java/org/apache/geronimo/axis2/builder/Axis2Builder.java
Sun Apr 10 12:57:09 2011
@@ -47,6 +47,7 @@ import org.apache.geronimo.jaxws.builder
 import org.apache.geronimo.jaxws.builder.WARWebServiceFinder;
 import org.apache.geronimo.jaxws.builder.wsdl.WsdlGenerator;
 import org.apache.geronimo.jaxws.builder.wsdl.WsdlGeneratorOptions;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.openejb.jee.HandlerChains;
 import org.apache.openejb.jee.JaxbJavaee;
@@ -208,15 +209,22 @@ public class Axis2Builder extends JAXWSS
     protected void initialize(GBeanData targetGBean, Class serviceClass, PortInfo portInfo,
Module module, Bundle bundle) throws DeploymentException {
         targetGBean.setReferencePattern("axis2ModuleRegistry", new AbstractNameQuery(Axis2ModuleRegistry.class.getName()));
         String serviceName = (portInfo.getServiceName() == null ? serviceClass.getName()
: portInfo.getServiceName());
-        if(portInfo.getWsdlFile() != null && !portInfo.getWsdlFile().trim().equals(""))
{
+        String wsdlFile = portInfo.getWsdlFile();
+        if(wsdlFile != null && wsdlFile.trim().length() > 0) {
             if (log.isDebugEnabled()) {
                 log.debug("Service " + serviceName + " has WSDL. " + portInfo.getWsdlFile());
             }
+            //TODO Workaround codes for web modules in the EAR package, need to add web module
name prefix
+            if (module.getType().equals(ConfigurationModuleType.WAR) && !isURL(wsdlFile))
{
+                portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
+            }
             return;
         } else if(JAXWSUtils.containsWsdlLocation(serviceClass, bundle)){
-            String wsdlFile = JAXWSUtils.getServiceWsdlLocation(serviceClass, bundle);
+            wsdlFile = JAXWSUtils.getServiceWsdlLocation(serviceClass, bundle);
             //TODO Workaround codes for web modules in the EAR package, need to add web module
name prefix
-            portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
+            if (module.getType().equals(ConfigurationModuleType.WAR) && !isURL(wsdlFile))
{
+                portInfo.setWsdlFile(module.getTargetPathURI().resolve(wsdlFile).toString());
+            }
             if(log.isDebugEnabled()) {
                 log.debug("Service "  + serviceName + " has WSDL configured in annotation
" + wsdlFile + " and is resolved as " + portInfo.getWsdlFile());
             }
@@ -261,7 +269,7 @@ public class Axis2Builder extends JAXWSS
             options.setWsdlPort(portInfo.getWsdlPort());
         }
 
-        String wsdlFile = wsdlGenerator.generateWsdl(module, serviceClass.getName(), module.getEarContext(),
options);
+        wsdlFile = wsdlGenerator.generateWsdl(module, serviceClass.getName(), module.getEarContext(),
options);
         portInfo.setWsdlFile(wsdlFile);
 
         if (log.isDebugEnabled()) {
@@ -269,4 +277,12 @@ public class Axis2Builder extends JAXWSS
         }
     }
 
+    private boolean isURL(String name) {
+        try {
+            new URL(name);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
 }



Mime
View raw message