Andreas Veithen created AXIS-2876:
-------------------------------------
Summary: Order of type mappings in generated WSDD depends on Java
version
Key: AXIS-2876
URL: https://issues.apache.org/jira/browse/AXIS-2876
Project: Axis
Issue Type: Bug
Components: WSDL processing
Affects Versions: 1.4
Reporter: Andreas Veithen
Priority: Minor
Fix For: 1.4.1
The order of the type mappings in the WSDD generated by wsdl2java depends on
the Java version and is not the same with Java 1.5 and 1.6. In principle this
should not be a problem, but in some cases, a change in the order of type
mappings triggers other issues. The consequence is that builds are not
reproducible across different Java versions.
The issue can be demonstrated with the
ComplexEchoServiceTestCase#test2ComplexEchoServiceEcho21 test case. The WSDD
file for that test case has two type mappings for the
test.wsdl.echo.NamedValue[] Java type:
<arrayMapping
xmlns:ns="http://types.echo.services"
qname="ns:>MyElement2Response"
type="java:test.wsdl.echo.NamedValue[]"
innerType="cmp-ns:NamedValue" xmlns:cmp-ns="http://types.echo.services"
encodingStyle=""
/>
<arrayMapping
xmlns:ns="http://types.echo.services"
qname="ns:ArrayOfNamedValue"
type="java:test.wsdl.echo.NamedValue[]"
innerType="cmp-ns:NamedValue" xmlns:cmp-ns="http://types.echo.services"
encodingStyle=""
/>
The test case attempts to serialize an instance of test.wsdl.echo.NamedValue[]
as the value of an element with type xsd:anyType. In that case, Axis needs to
identify the XML type in order to generate the xsi:type attribute. The code in
TypeMappingImpl determines that XML type by looking at the last registered type
mapping with the given Java type, and therefore the order of type mappings is
relevant. With Java 1.5, the mapping with ns:ArrayOfNamedValue is registered
last and the test case succeeds. With Java 1.6, the mapping with
ns:>MyElement2Response is registered last. The test case fails because an
anonymous type can't be used with xsi:type.
Obviously the real problem in this example is that Axis attempts to use an
anonymous type where this is not possible. Nevertheless, this kind of issue
should not be triggered by a change of the Java version.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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]