After running the WSDL2Java utility, I did a text search for any references to "clear" in the generated files but was unable to find any.
I have included a test version of the scenario that I am running into with the hopes of identifying where my files are in error. Can you identify in the below file contents where my error is? TIA TestSchema1.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://mynamespace.com/TestSchema1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:test1="http://mynamespace.com/TestSchema1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"> <xsd:element name="myRootElem"> <xsd:complexType> <xsd:sequence> <xsd:element name="Child1" type="xsd:int"> </xsd:element> <xsd:choice> <xsd:element name="SomeChoice1" type="test1:SomeChoice1_Type" nillable="true" maxOccurs="unbounded"> </xsd:element> <xsd:element name="SomeChoice2" type="test1:SomeChoice2_Type" nillable="true" maxOccurs="unbounded"> </xsd:element> </xsd:choice> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="SomeChoice1_Type"> <xsd:sequence> <xsd:element name="SomeChoice1Child1" type="test1:SomeChoice1Child1_Type"/> </xsd:sequence> <xsd:attribute name="SomeChoice1Attr1" type="xsd:string" use="required"/> <xsd:attribute name="Version" type="xsd:string" use="required"/> </xsd:complexType> <xsd:complexType name="SomeChoice2_Type"> <xsd:sequence> <xsd:element name="SomeChoice2Child1" type="xsd:string" maxOccurs="unbounded"/> <xsd:element name="SomeChoice2Child2" type="xsd:int" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="SomeChoice2Attr1" type="xsd:string" use="optional"/> </xsd:complexType> <xsd:complexType name="SomeChoice1Child1_Type"> </xsd:complexType> </xsd:schema> TestService.wsdl <?xml version="1.0" encoding="utf-8"?> <definitions xmlns:tns="http://myservice/Test" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:test1="http://mynamespace.com/TestSchema1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://myservice/Test" name="TestService"> <types> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://myservice/Test" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <import namespace="http://mynamespace.com/TestSchema1" schemaLocation="TestSchema1.xsd" id="test1"/> </schema> </types> <message name="TestService_testSchema"> <part name="rootElem" element="test1:myRootElem"/> </message> <message name="TestService_testSchemaResponse"> <part name="rootElemResponse" element="test1:myRootElem"/> </message> <portType name="TestPortType"> <operation name="TestSchema" > <input message="tns:TestService_testSchema"/> <output message="tns:TestService_testSchemaResponse"/> </operation> </portType> <binding name="TestServiceBinding" type="tns:TestPortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="TestSchema"> <soap:operation soapAction="TestSchema" style="document"/> <input> <soap:body namespace="http://myservice/Test" use="literal"/> </input> <output> <soap:body namespace="http://myservice/Test" use="literal"/> </output> </operation> </binding> <service name="TestService"> <port name="TestPort" binding="tns:TestServiceBinding"> <soap:address location="http://myservice/Test"/> </port> </service> </definitions> Wsdl2Java command org.apache.axis2.wsdl.WSDL2Java -uri TestService.wsdl -p com.mynamespace -o /workingdir/axis2test -d adb -s -wv 1.1 -ss -sd Amila Suriarachchi wrote: > > 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. > > -- View this message in context: http://www.nabble.com/WSDL2Java-choice-handling-tf3189985.html#a8868691 Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
