This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes jaxb external customization with WSDL (and imported WSDL) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "jaxb external customization with WSDL (and imported WSDL)" Watch "jaxb external customization with WSDL (and imported WSDL)" New topic
Author

jaxb external customization with WSDL (and imported WSDL)

Boris Malensek
Greenhorn

Joined: Aug 23, 2011
Posts: 1
Hi.

I used wsimport to create JAXB Java objects from WSDL. And information I get was
[ERROR] A class/interface with the same name "my.package.ObjectFactory" is already in use. Use a class customization to resolve this conflict.
I started to study external JAXB customization and I wasn't able to find any suitable example hot to do it.
My scenario is like that I have main wsdl file (which I pass to wsimport) and inside that wsdl file is tag <wsdl:import location="path.to.another.wsdl" namespace="secondWsdlNamespace" /> . In that anotherWsdl there is one complexType:
<xs:complexType name="objectFactory"><xs:sequence/></xs:complexType> and that objectFactory is actually problematic. wsimport creates ObjectFactory.java in which it handles all object instantations. What I want to do is to create external customization for JAXB for that "inner" wsdl.
For now I was able to produce next mapping file:



And I'm getting error:

[ERROR] XPath evaluation of "//xs:complexType[@name='objectFactory']" results in empty target node

As I said in "url.to.main.wsdl" there is import of another wsdl like:



At my JAXB mapping file do I have to point at main wsdl or inportedwsdl at wsdlLocation attribute?
Of course I have already tried this url.to.imported.wsdl and same error occurs. Any ideas? Examples?

Thanks

Regards
Zmeda
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 499
    
    3
Should you not provision the schemaLocation as well? Like this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jaxb external customization with WSDL (and imported WSDL)
 
Similar Threads
Passing Set<java.lang.Object> and List<java.lang.Object> in Axis 2.0
"Unsupported binding namespace "". Jaxb with ANT and external binding schema
How to add JAXB customization to a particular element of an xsd?
Top-Down approach: WSDL, JAX-WS and JAXB
want to send pdf file to client from server. pdf is generated at server