Hi,

I have a problem when using cxf-codegen-plugin because of multiple
definitions in the WSDL I try to generate sources from.
There is a name conflict for the class named "Activity", because of the
"toplevel" localsScoping.
The two definitions are located in a XSD file imported by the WSDL.

Here is the XML snippet of the two definitions :

        <xs:complexType name="Request74LSignalStruct">
                <xs:sequence>
            <!-- ... -->
                        <xs:element name="Activities">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element name="Activity" 
maxOccurs="unbounded">
                                                        <xs:complexType>
                                                                <xs:sequence>
                                                                        
<xs:element name="PensionBeginDate" type="xs:dateTime"/>
                                                                        
<xs:element name="ActivityKind">
                                                                        
</xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute 
name="IsForSpouse" type="xs:boolean" use="optional"
default="false">
                                                                </xs:attribute>
                                                        </xs:complexType>
                                                </xs:element>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
            <!-- ... -->
                </xs:sequence>
        </xs:complexType>

And

        <xs:complexType name="Response74LSignalStruct">
                <xs:sequence>
            <!-- ... -->
                        <xs:element name="Activities">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element name="Activity" 
maxOccurs="unbounded">
                                                        <xs:complexType>
                                                                <xs:sequence>
                                                                        
<xs:element name="PensionBeginDate" type="xs:dateTime">
                                                                        
</xs:element>
                                                                        
<xs:element name="EndDate" type="xs:dateTime" minOccurs="0">
                                                                        
</xs:element>
                                                                        
<xs:element name="ActivityKind">
                                                                        
</xs:element>
                                                                        
<xs:element name="EndAgreementReason" type="xs:string"
minOccurs="0">
                                                                        
</xs:element>
                                                                </xs:sequence>
                                                                <xs:attribute 
name="IsForSpouse" type="xs:boolean" use="optional"
default="false">
                                                                </xs:attribute>
                                                        </xs:complexType>
                                                </xs:element>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
                </xs:sequence>
        </xs:complexType>


As you can see, both definitions are quite similar, they both share some
elements.
What I've tried so far, without success, is to bind the latter definition
to another class, with this binding :

    <jaxb:bindings
node="//xs:complexty...@name='Response74LSignalStruct']//xs:eleme...@name='Activity']">
        <jaxb:class name="Activities74L"/>
    </jaxb:bindings>

But wsdl2java complaints about not finding the node, although I've tested
my XPath expression and it works perfectly in my editor :

WSDLToJava Error: Thrown by JAXB : XPath evaluation of
"//xs:complexty...@name='Response74LSignalStruct']//xs:eleme...@name='Activity']"
results in empty target node at line 12 column 107 of schema
file:/C:/javadev/java/quarterly-upload-spring/src/main/resources/jaxb-binding.xml

This message is a bit confusing. Does the error says that the file
jaxb-binding.xml is a schema file, or does it say that there is a problem
searching in the schema and it simply points to the XPath located in
jaxb-binding that is causing the error ?

For information, here's how I use the plugin :

                        <configuration>
                            <sourceRoot>src/main/java</sourceRoot>
                            <defaultOptions>
                                <bindingFiles>
                                 
<bindingFile>src/main/resources/jaxws-binding.xml</bindingFile>
                                 
<bindingFile>src/main/resources/jaxb-binding.xml</bindingFile>
                                </bindingFiles>
                                <extraargs>
                                    <extraarg>-xjc-Xsetters</extraarg>
                                </extraargs>
                            </defaultOptions>
                            <wsdlOptions>
                                <wsdlOption>
                                   
<wsdl>src/main/resources/schemas/WS/Loopbaan/NisseLoopbaan_V1.wsdl</wsdl>
                                </wsdlOption>
                                <wsdlOption>
                                   
<wsdl>src/main/resources/schemas/WS/Loopbaan/SifLoopbaan_V1.wsdl</wsdl>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>

So, in fact, I have two questions :
- What am I doing wrong here ?
- Is there a way to say that these two definitions should actually be
mapped to only one class ?

Regards.
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Reply via email to