You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2013/08/29 16:50:52 UTC

[jira] [Resolved] (CXF-5238) WSDL2Java generates naming conflicts on a valid schema

     [ https://issues.apache.org/jira/browse/CXF-5238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-5238.
------------------------------

       Resolution: Not A Problem
    Fix Version/s: Invalid
         Assignee: Daniel Kulp


This is not a problem in CXF.  This is a JAXB "issue/limitation".  If something results in a conflict, JAXB spits out an error and then requires the user to configure a binding file to get around it.   In this particular case, a binding file of:

{code:xml}
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    version="1.0">
    <jaxb:bindings schemaLocation="foo.wsdl#types1">
        <jaxb:bindings node="//xs:element[@name='IsCardPersonalizedRequest']">
            <jaxb:factoryMethod name="IsCardPersonalizedRequestElement"/>
        </jaxb:bindings>
        <jaxb:bindings node="//xs:element[@name='GetCardholderProfileRequest']">
            <jaxb:factoryMethod name="GetCardholderProfileRequestElement"/>
        </jaxb:bindings>
        <jaxb:bindings node="//xs:element[@name='ReverseTransactionRequest']">
            <jaxb:factoryMethod name="ReverseTransactionRequestElement"/>
        </jaxb:bindings>
        <jaxb:bindings node="//xs:element[@name='EnrollNewMemberInstantIssueRequest']">
            <jaxb:factoryMethod name="EnrollNewMemberInstantIssueRequestElement"/>
        </jaxb:bindings>
        <jaxb:bindings node="//xs:element[@name='EnrollNewMemberRequest']">
            <jaxb:factoryMethod name="EnrollNewMemberRequestElement"/>
        </jaxb:bindings>
    </jaxb:bindings>
</jaxb:bindings>
{code}

would fix it by renaming a few of the generated methods to not end up with a conflict.   Again, this is a JAXB thing.

                
> WSDL2Java generates naming conflicts on a valid schema
> ------------------------------------------------------
>
>                 Key: CXF-5238
>                 URL: https://issues.apache.org/jira/browse/CXF-5238
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.7.5
>         Environment: Windows 7, Apache ant
>            Reporter: David Roytenberg
>            Assignee: Daniel Kulp
>              Labels: newbie
>             Fix For: Invalid
>
>
> When running wsdl2java on a valid WSDL, the tool reports naming conflicts under the following circumstances:
> There is an element of this form
> <xs:element name="FooTransaction">
>   <xs:complexType>
>     <xs:sequence>
> 	<xs:element minOccurs="0"     name="request" nillable="true"							type="tns:FooTransactionRequest" />
>     </xs:sequence>
>   </xs:complexType>
> </xs:element>
> and later another of the form 
> <xs:element name="FooTransactionRequest" nillable="true"
> 				type="tns:FooTransactionRequest" />
> Wsdl2Java reports a naming conflict 
> referencing the line numbers of the xs:element name="request and of the xs:element name="FooTransactionRequest"
> The validator in Eclipse says this is a valid WSDL.
> The service provider that owns the WSDL changed the inner element names inside the complex types which created this problem.  The inner name used to be of the form "fooTransactionRequest" which does not cause a problem.  In fact changing the name request to some other string also fixes the name conflict.
> It looks like the inner element of the inner element is being appended to the name of the outer element in the first block above, which generates a name identical to the element below.

--
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