You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jyotsna Bharadwaj (JIRA)" <ax...@ws.apache.org> on 2005/02/03 12:10:17 UTC

[jira] Created: (AXIS-1802) Axis does not generate the corresponding classes for xsd:choice correctly

Axis does not generate the corresponding classes for xsd:choice correctly
-------------------------------------------------------------------------

         Key: AXIS-1802
         URL: http://issues.apache.org/jira/browse/AXIS-1802
     Project: Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: beta-2    
 Environment: Windows XP 
    Reporter: Jyotsna Bharadwaj


Corresponding to this the class NetworkObjectDetails is generated which in its constructor takes both ipDetails as well as dnsAddressDetails


  <xsd:complexType name="NetworkObjectDetails">
         <xsd:sequence>
             <xsd:choice minOccurs="0" maxOccurs="1">
                 <xsd:element name="ipDetails" type="typens:ArrayOfIPDetails"/>
                 <xsd:element name="dnsAddressDetails" type="typens:DnsAddressDetails"/>
             </xsd:choice>
        </xsd:sequence>
     </xsd:complexType>



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


[jira] Commented: (AXIS-1802) Axis does not generate the corresponding classes for xsd:choice correctly

Posted by "Venkat Reddy (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1802?page=comments#action_58648 ]
     
Venkat Reddy commented on AXIS-1802:
------------------------------------

May be we can reduce the number of constructor parameters to two (id and value), but only at the cost of loosing simplicity of code in general.

Please provide some test code and more details if you are facing any issue because of this.

Venkat

> Axis does not generate the corresponding classes for xsd:choice correctly
> -------------------------------------------------------------------------
>
>          Key: AXIS-1802
>          URL: http://issues.apache.org/jira/browse/AXIS-1802
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: beta-2
>  Environment: Windows XP 
>     Reporter: Jyotsna Bharadwaj

>
> Corresponding to this the class NetworkObjectDetails is generated which in its constructor takes both ipDetails as well as dnsAddressDetails
>   <xsd:complexType name="NetworkObjectDetails">
>          <xsd:sequence>
>              <xsd:choice minOccurs="0" maxOccurs="1">
>                  <xsd:element name="ipDetails" type="typens:ArrayOfIPDetails"/>
>                  <xsd:element name="dnsAddressDetails" type="typens:DnsAddressDetails"/>
>              </xsd:choice>
>         </xsd:sequence>
>      </xsd:complexType>

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


[jira] Commented: (AXIS-1802) Axis does not generate the corresponding classes for xsd:choice correctly

Posted by "Eric Schwarzenbach (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-1802?page=comments#action_12367295 ] 

Eric Schwarzenbach commented on AXIS-1802:
------------------------------------------

I'd like to note that in the above example the sequence is entirely superfluous, but that I see this same sort of behavior (in axis 1.3) whenever I try to use choice in my schemas. Choice is about as basic as you get in XSD, and I hope you're not waiting on someone to post test code to address this.

The obvious semantic equivalent in a language like Java, to an xms schema choice, is an overloaded method (or constructor), one for each choice (e.g. a constructor with only the ipDetails argument, another constructor with only the dnsAddressDetails argument--and in this case, since the choice is optional, another constructor with no parameters would be the obvious equivalent). This mapping would not be losing simplicity--however doing less than is losing semantics and expressiveness.

> Axis does not generate the corresponding classes for xsd:choice correctly
> -------------------------------------------------------------------------
>
>          Key: AXIS-1802
>          URL: http://issues.apache.org/jira/browse/AXIS-1802
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: beta-2
>  Environment: Windows XP 
>     Reporter: Jyotsna Bharadwaj

>
> Corresponding to this the class NetworkObjectDetails is generated which in its constructor takes both ipDetails as well as dnsAddressDetails
>   <xsd:complexType name="NetworkObjectDetails">
>          <xsd:sequence>
>              <xsd:choice minOccurs="0" maxOccurs="1">
>                  <xsd:element name="ipDetails" type="typens:ArrayOfIPDetails"/>
>                  <xsd:element name="dnsAddressDetails" type="typens:DnsAddressDetails"/>
>              </xsd:choice>
>         </xsd:sequence>
>      </xsd:complexType>

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