On 2/8/07, danop <[EMAIL PROTECTED]> wrote:



I have been running the Axis2 WSDL2Java utility on a wsdl that uses
multiple
xsd's that contain xsd:choices.  Everything appears to be run smoothly
with
no errors.  However, after looking at the generated files, there are no
references to any of the xsd:choice elements in the files.


It fully supported. Lets take this simple Element

<xs:element name="TestChoise">
       <xs:complexType>
           <xs:choice>
               <xs:element name="choice1" type="xs:string"/>
               <xs:element name="choice2" type="xs:int"/>
           </xs:choice>
       </xs:complexType>
   </xs:element>

The generated code for this has this method

private void clearAllSettingTrackers() {

               localChoice1Tracker = false;

               localChoice2Tracker = false;

           }

and setter method like this

public void setChoice1(java.lang.String param){

                               clearAllSettingTrackers();

                                      if (param != null){
                                         //update the setting tracker
                                         localChoice1Tracker = true;
                                      } else {
                                         localChoice1Tracker = false;

                                      }

                                           this.localChoice1=param;


                              }

When ever you set one variable others tracker is set to false

then when serializing it checks whether the tracker is on

if (localChoice1Tracker){
       // some code to serialize
}

In this way it serialize only one variable. (the variable to set finally)

As you can see ADB has implemented it in a bit smoother way using trackers
with out using any choice elements.




Can anyone
confirm whether or not Axis2 fully supports xsd:choice as part of adb
binding?

TIA,
danop
--
View this message in context:
http://www.nabble.com/WSDL2Java-choice-handling-tf3189985.html#a8855376
Sent from the Axis - User mailing list archive at Nabble.com.


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




--
Amila Suriarachchi,
WSO2 Inc.

Reply via email to