Author: deepal
Date: Fri Feb 29 00:22:31 2008
New Revision: 632259

URL: http://svn.apache.org/viewvc?rev=632259&view=rev
Log:
When the child is in different package compared   to parent then we are not 
adding the import statement  so this is to fix that

Modified:
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=632259&r1=632258&r2=632259&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
 Fri Feb 29 00:22:31 2008
@@ -170,6 +170,10 @@
                  * messages and port types will be creteated
                  */
                 JAnnotation annotation = 
jclass.getAnnotation(AnnotationConstants.WEB_SERVICE);
+                JComment comment = jclass.getComment();
+                if (comment !=null) {
+                    System.out.println(comment.getText());
+                }
                 if (annotation != null) {
                     String tns =
                             
annotation.getValue(AnnotationConstants.TARGETNAMESPACE).asString();
@@ -461,6 +465,15 @@
                 if (tgtNamespacepfx == null) {
                     tgtNamespacepfx = generatePrefix();
                     targetNamespacePrefixMap.put(tgtNamespace, 
tgtNamespacepfx);
+                }
+                //if the parent class package name is differ from the child
+                if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values().
+                        contains(tgtNamespace)) {
+                    XmlSchemaImport importElement = new XmlSchemaImport();
+                    importElement.setNamespace(tgtNamespace);
+                    xmlSchema.getItems().add(importElement);
+                    ((NamespaceMap) xmlSchema.getNamespaceContext()).
+                            put(generatePrefix(),tgtNamespace);
                 }
 
                 QName basetype = new QName(tgtNamespace, superclassname, 
tgtNamespacepfx);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to