It sounds like the schemaLocation attribute on the jaxb:bindings nodes aren't pointing to the correct schema if you are dealing with an imported schema. I would double check those.
It definitely should work if you get all the schemaLocations and xpaths working properly. Dan On Thursday 02 December 2010 3:37:11 pm Bruno Dusausoy wrote: > Hi, > > Sorry if this is the wrong place to ask this, but I have a question > about JAXB class name customization. > My problem is quite simple, in one of the schema imported by the WSDL > I've been given two local element definitions have the same name, like > this : > > <xs:complexType name="ResponseStruct"> > <xs:sequence> > <xs:element name="Activities"> > <!-- Content here --> > </xs:element> > </xs:sequence> > </xs:complexType> > <xs:complexType name="RequestStruct"> > <xs:sequence> > <xs:element name="Activities"> > <!-- Different content here --> > </xs:element> > </xs:sequence> > </xs:complexType> > > Since I've specified "toplevel" as localScoping value in my binding > file, JAXB tries to create two classes with the same name and naturally > fails at it. > That's not really a big deal since I can specify a <jaxb:class/> for > each one of them. > So I've written my XPath expression and tested it. It works well in my > IDE, but when running JAXB with it, I get this message : > > XPath evaluation of > "//xs:complexty...@name='ResponseStruct']//xs:eleme...@name='Activities']" > results in empty target node at line 18 column 109 of schema > file:/home/bdusauso/prog/java/jaxb-problem/src/main/resources/jaxb-binding. > xml > > So it seems it cannot evaluate the expression. > I guess it tries to evaluate it against the WSDL I've given to > cxf-codegen-plugin but not against the external schemas imported from it. > > For information, here's my cxf-codegen-plugin configuration : > > <configuration> > <sourceRoot>src/main/generated</sourceRoot> > <defaultOptions> > <bindingFiles> > <bindingFile>src/main/resources/jaxws-binding.xml</bindingFile> > </bindingFiles> > </defaultOptions> > <wsdlOptions> > <wsdlOption> > <wsdl>src/main/resources/xml/mywsdl.wsdl</wsdl> > </wsdlOption> > </wsdlOptions> > </configuration> > > Any idea on how to solve this problem ? > > Regards. -- Daniel Kulp [email protected] http://dankulp.com/blog
