Hi, I am using WSDL2Java (Axis2 version 1.5.6) to generate my java classes but I am having a problem with a WSDL/xsd that contains the same named element under different name space, creating a class with the variables named the same. Below is a small excerpt of the xsd:
--------------------------------------------------------------------------------------------------- <xs:schema xmlns:DX2="mtvnDXIntopGenReqData" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:DX1="mtvnDXIntopAcctOpenReqData" xmlns:LOS="mtvnLOSIntopAcctOpenReqData" targetNamespace="mtvnExtInteropReqData" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="MI"> <xs:complexType> <xs:choice> <xs:element ref="LOS:AccountOpen"/> <xs:element ref="DX1:AccountOpen"/> <xs:element ref="DX2:GenIntop"/> </xs:choice> </xs:complexType> </xs:element> --------------------------------------------------------------------------------------------------- Notice above how AccountOpen has been defined twice under the LOS and DX1 namespace. Below is a snippet of the java generated ( I have removed comments for clarity): --------------------------------------------------------------------------------------------------- protected mtvnLOSIntopAcctOpenReqData.AccountOpen_type0 localAccountOpen ; protected boolean localAccountOpenTracker = false ; public mtvnLOSIntopAcctOpenReqData.AccountOpen_type0 getAccountOpen(){ return localAccountOpen; } protected mtvnDXIntopAcctOpenReqData.AccountOpen_type1 localAccountOpen ; protected boolean localAccountOpenTracker = false ; public mtvnDXIntopAcctOpenReqData.AccountOpen_type1 getAccountOpen(){ return localAccountOpen; } --------------------------------------------------------------------------------------------------- As can be seen above the localAccountOpen variable has been declared twice with the same name, which will not compile. A previous version of Axis 1.3 created the class differently and actually got it right by declaring the variables as accountOpen and accountOpen2: --------------------------------------------------------------------------------------------------- private mtvnLOSIntopAcctOpenReqData.AccountOpen accountOpen; private mtvnDXIntopAcctOpenReqData.AccountOpen accountOpen2; private mtvnDXIntopGenReqData.GenIntop genIntop; public ExtIntOpInteropDataMI() { } public ExtIntOpInteropDataMI( mtvnLOSIntopAcctOpenReqData.AccountOpen accountOpen, mtvnDXIntopAcctOpenReqData.AccountOpen accountOpen2, mtvnDXIntopGenReqData.GenIntop genIntop) { this.accountOpen = accountOpen; this.accountOpen2 = accountOpen2; this.genIntop = genIntop; } --------------------------------------------------------------------------------------------------- Any help is appreciated. -- View this message in context: http://old.nabble.com/Axis2-WSDL2Java-has-probem-with-WSDL-elements-of-the-same-name...-tp32850645p32850645.html Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org