DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22100>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22100

[Patch] add a "nillable" attribute to ElementDecl.java

           Summary: [Patch] add a "nillable" attribute to ElementDecl.java
           Product: Axis
           Version: current (nightly)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: WSDL processing
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I use wsdl2 to generate some code (not java) from wsdl.

The problem I had was that during generation, I did not know if an element was
nillable or not 
(the nillable attribute in <xsd:element name="mapUrl" nillable="true"
type="xsd:string" />) 
whereas I knew if minOccurs was 0 or not (because it is present in ElementDecl
and set in SchemaUtils.processChildElementNode)


The proposed patch add a nillable property to ElementDecl and set this property
in SchemaUtils.processChildElementNode.
This patch does not correct a bug but is somewhat related to bug 20109

Could you include it in Axis source code please ?


Here is the patch :



Index: ElementDecl.java
===================================================================
RCS file:
/home/cvspublic/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/ElementDecl.java,v
retrieving revision 1.4
diff -u -r1.4 ElementDecl.java
--- ElementDecl.java 22 Apr 2003 19:36:14 -0000 1.4
+++ ElementDecl.java 31 Jul 2003 14:15:54 -0000
@@ -74,6 +74,8 @@
     // causes nil=true to be passed over the wire.
     private boolean minOccursIs0=false;   
 
+    private boolean nillable=false;
+
     // Indicate if the ElementDecl represents
     // an xsd:any element
     private boolean anyElement = false;
@@ -108,6 +110,14 @@
 
     public void setMinOccursIs0(boolean minOccursIs0) {
         this.minOccursIs0 = minOccursIs0;
+    }
+
+    public void setNillable(boolean nillable) {
+        this.nillable = nillable;
+    }
+
+    public boolean getNillable() {
+        return nillable;
     }
 
     public boolean getAnyElement() {
Index: SchemaUtils.java
===================================================================
RCS file:
/home/cvspublic/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
retrieving revision 1.25
diff -u -r1.25 SchemaUtils.java
--- SchemaUtils.java 31 Jul 2003 06:25:18 -0000 1.25
+++ SchemaUtils.java 31 Jul 2003 14:15:56 -0000
@@ -55,6 +55,7 @@
 package org.apache.axis.wsdl.symbolTable;
 
 import org.apache.axis.Constants;
+import org.apache.axis.utils.JavaUtils;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -369,6 +370,9 @@
             if (minOccurs != null && minOccurs.equals("0")) {
                 elem.setMinOccursIs0(true);
             }
+            
+           
elem.setNillable(JavaUtils.isTrueExplicitly(Utils.getAttribute(elementNode,"nillable")));
+            
             return elem;
         }

Reply via email to