Either support <sequence minOccurs="0"> or print an error from WSDL2Java
------------------------------------------------------------------------

                 Key: AXIS-2607
                 URL: https://issues.apache.org/jira/browse/AXIS-2607
             Project: Apache Axis
          Issue Type: Improvement
          Components: WSDL processing
    Affects Versions: 1.4
         Environment: Windows XP Professional
Version2002
SP2
Intel Pentium 4
Java 1.5.0_06
            Reporter: Jon Carmignani
            Priority: Minor


I attempted to use a sequence that I wanted to not require its use, but if it 
was there, I wanted all elements to be present given their stated occurrence 
limits.  I used the following in my XSD (referenced from the WSDL).

        <xsd:complexType name="programDef">
                <xsd:sequence>
                        <xsd:element name="subprogram"
                                                 type="snwma_dl:subprogramDef"
                                                 maxOccurs="unbounded"
                                                 minOccurs="0"
                        />
                <xsd:sequence minOccurs="0">
                        <xsd:element name="desc" type="snwma_s:string500" />
                        <xsd:element name="statusInd" type="snwma_s:string1" />
                        <xsd:element name="abbr" type="snwma_s:string4" />
                        <xsd:element name="reviewFy" type="xsd:int" 
minOccurs="0" />
                        <xsd:element name="bAndRNumber" type="snwma_s:string20" 
minOccurs="0" />
                        <xsd:element name="displayOrder" type="xsd:long" 
minOccurs="0" />
                        <xsd:element name="auditCols" 
type="snwma_s:auditColsDef" />
                </xsd:sequence>
                </xsd:sequence>
                <xsd:attribute name="key" type="xsd:long" />
                <xsd:attributeGroup ref="snwma_s:actions"/>
        </complexType>

The namespaces are all defined, so that isn't my issue.  This passes through 
WSDL2Java with no problems, creating the classes I would expect.  The problem I 
am having is that the parser for incoming messages still requires that all of 
the elements without the minOccurs="0" attribute appear.  While I can 
understand why the minOccurs attribute isn't supporded on sequences for values 
larger than 1, I think it would be useful to support minOccurs="0" simply so I 
don't have to have an additional wrapper class around optional groups of data.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to