[ 
http://issues.apache.org/jira/browse/AXIS2-998?page=comments#action_12447664 ] 
            
Barney Wrightson commented on AXIS2-998:
----------------------------------------


   [[ Old comment, sent by email on Thu, 10 Aug 2006 16:57:41 +0930 ]]

Hi Davanum,

Thanks for the quick response :)

Could you apply the same fix to sequences and groups? I just realised 
that my original problem was with a group that was a choice, while your 
fix works if I substitute my choice group manually it doesn't if I leave 
it as is.

eg.

<xsd:group name="choiceGrp">
   <xsd:choice>
     <xsd:element name="choice1"/>
     <xsd:element name="choice2"/>
   </xsd:choice>
</xsd:group>

<xsd:complexType name="multiChoice">
   <!-- doesn't work properly -->
   <xsd:sequence>
     <xsd:group ref="choiceGrp" minOccurs="0" maxOccurs="unbounded">
   </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="multiChoice1">
   <!-- doesn't work properly -->
   <xsd:sequence minOccurs="0" maxOccurs="unbounded">
     <xsd:group ref="choiceGrp">
   </xsd:sequence>
</xsd:complexType>

<xsd:complexType name="multiChoice2">
   <!-- does work with fix -->
   <xsd:sequence>
     <xsd:choice minOccurs="0" maxOccurs="unbounded">
       <xsd:element name="choice1"/>
       <xsd:element name="choice2"/>
     </xsd:choice>
   </xsd:sequence>
</xsd:complexType>

thanks again,
Barney Wrightson




> WSDL2Java creates invalid databinding code for choice elements with 
> maxOccurs="unbounded"
> -----------------------------------------------------------------------------------------
>
>                 Key: AXIS2-998
>                 URL: http://issues.apache.org/jira/browse/AXIS2-998
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl, databinding, Tools
>    Affects Versions: 1.0
>         Environment: Windows XP
>            Reporter: Barney Wrightson
>         Attachments: testChoice.wsdl
>
>
> When generating code from a wsdl file that uses a choice element with 
> maxOccurs="unbounded" the resulting code appears to have ignored the 
> maxOccurs specification. I am using the xmlbeans method, and if i try to 
> validate xml based on the wsdl schema it oly accepts it if there is only one 
> of the choice elements used.
> eg. for the attached example wsdl, if i send a call NewOperation with 
> something like the the following as input, validation fails on the 
> <intChoice>:
> <NewOperationRequest >
>   <stringChoice>string</stringChoice>
>   <intChoice>1</intChoice>
> </NewOperationRequest >
> In the generated code the NewOperationRequestDocument returns a single 
> MultipleChoice object in the getNewOperationRequest method, and MultpleChoice 
> has all possible options in it but there are no arrays anywhere in there 
> either.
> I have tried to work around this issue in the shema definition, but apart 
> from adding superfluous elements, which changes the structure of the xml, 
> nothing works. eg. Putting the choice element as maxOccurs="1" inside a 
> sequence with maxOccurs="unbounded" yeilds identical results.
> According to this email to the axis-user list, the required functionality was 
> present at version 0.94 or so and has been subsequently left out:
> http://mail-archives.apache.org/mod_mbox/ws-axis-user/200604.mbox/[EMAIL 
> PROTECTED]

-- 
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

        

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

Reply via email to