Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
Windows 7
Description
Using WSDL2Java for a wsdl using references and specifying a target namespace with "-p" option creates
beans that declare variables as "java.lang.String_Element". Using SOAPUi to generate code with options:
command: [java, -cp, <classpath>, org.apache.axis.wsdl.WSDL2Java, -v, -T, 1.2, -p, test.package, -o, C:\outputfolder, C:\wsdlroute\wsdlfile.wsdl]
Name.java contains:
private java.lang.String_Element firstElement;
private java.lang.String_Element secondElement;
private java.lang.String thirdElement;
and it does not compile.
I found two workarounds to avoid this:
1) Modify WSDL by replacing references:
<xs:element name="Names">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:FirstElement"/>
<xs:element ref="ns0:SecondElement"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FirstElement" type="xs:string"/>
<xs:element name="SecondElement" type="xs:string"/>
with
<xs:element name="Names">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstElement" type="xs:string"/>
<xs:element name="SecondElement" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
2) Modifying JavaGeneratorFactory.java
} else if (name.equals(entry.getName()))
for:
} else if (name.equals(entry.getName())) {
resolve = true; // Need to do resolution
if(entry instanceof DefinedElement) {
if(((DefinedElement) entry).isBaseType())
}
}
which is too ad-hoc but works for me
I have another issue with SOAP generated for request in this kind of WSDL with
<xs:element ref="ns0:Names" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Names">
...
generating
<item xmlns="">
instead of <Names> (as i think it should) but will open a different issue for it