geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r527272 - /geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Date Tue, 10 Apr 2007 20:13:43 GMT
Author: dims
Date: Tue Apr 10 13:13:42 2007
New Revision: 527272

URL: http://svn.apache.org/viewvc?view=rev&rev=527272
Log:
Fix for GERONIMO-3085 - Axis2: Response Wrapper class isn't set correctly which caused a NPE
in Axis2

Modified:
    geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?view=diff&rev=527272&r1=527271&r2=527272
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Tue Apr 10 13:13:42 2007
@@ -287,6 +287,7 @@
 
                     ResponseWrapperAnnot responseWrap = ResponseWrapperAnnot.createResponseWrapperAnnotImpl();
                     responseWrap.setClassName(getWrapperClassName(outAxisMessage.getElementQName()));
+                    responseWrap.setTargetNamespace(outAxisMessage.getElementQName().getNamespaceURI());
                     mdc.setResponseWrapperAnnot(responseWrap);
                 } 
             }
@@ -304,6 +305,7 @@
     }
     
     //TODO: Has to verify how JAXB default class wrapper class generation logic
+    //Note that this only works when the package name is based on the domain name of the
namespace.
     private String getWrapperClassName(QName element) throws Exception {
         String localPart = element.getLocalPart();
         String nameSpace = element.getNamespaceURI();
@@ -312,21 +314,15 @@
         
         String host = nameSpaceURI.getHost();
         String path = nameSpaceURI.getPath();
+        String[] hostParts = host.split("\\.");
         String[] pathParts = path.split("/");
-        int index = 0;
-        
-        while(index < host.length()){
-            if(host.charAt(index) == '.'){
-                break;
-            }
-            index ++;
-        }
-        
         String packageName = "";
-        if(pathParts.length == 1){ 
-        	packageName = host.substring(index+1, host.length())+"."+host.substring(0, index);
-        }else {
-        	packageName = host;
+        
+        for (int i = hostParts.length - 1; i > -1; i--) {
+            if (i == 0)
+                packageName += hostParts[i];
+            else 
+                packageName += hostParts[i] + ".";
         }
         
         for(String pathPart : pathParts){



Mime
View raw message