Actually, I think my previous suspicion about the cause of the problem may be a red herring.
I've downloaded all three files: http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd and saved them into one local directory, changed the schemaLocation elements to just refer to the filenames without any path prefixes: <xsd:import namespace="http://www.cbs.dtu.dk/ws/ws-common" schemaLocation="ws_common_1_0b.xsd" /> and invoked wsdl2java like so: wsdl2java SpindleP_2_0_ws0.wsdl and I still get: WSDLToJava Error: Thrown by JAXB : undefined simple or complex type 'spindlep:seqlookup' This service works fine in SoapUI, I've sent, received and validated messages OK, so I'm a bit stuck... Is there some magic incantation that gets wsdl2java to honour imported schemas? Any suggestions greatly appreciated! Andrew. 2009/3/23 Andrew Clegg <[email protected]>: > Hi, > > I'm trying to write a JAXB/JAXWS client for this service: > > http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd > > Just using wsdl2java on that URL with no extra parameters gives this error: > > WSDLToJava Error: Thrown by JAXB : undefined simple or complex type > 'spindlep:seqlookup' > > ... presumably because all the types in use in that WSDL are defined > in imported schemas with relative paths: > > <xsd:import > namespace="http://www.cbs.dtu.dk/ws/ws-common" > schemaLocation="../common/ws_common_1_0b.xsd" > /> > <xsd:import > namespace="http://www.cbs.dtu.dk/ws/ws-spindlep" > schemaLocation="ws_spindlep_2_0_ws0.xsd" > /> > > ... so I tried supplying a JAXB catalog (SpindleP.cat) as described here: > > https://jaxb.dev.java.net/guide/Fixing_broken_references_in_schema.html > > This contains the following lines: > > PUBLIC "http://www.cbs.dtu.dk/ws/ws-common" > "http://www.cbs.dtu.dk/ws/common/ws_common_1_0b.xsd" > PUBLIC "http://www.cbs.dtu.dk/ws/ws-spindlep" > "http://www.cbs.dtu.dk/ws/SpindleP/ws_spindlep_2_0_ws0.xsd" > > I know those XSD URLs work (you can check them yourself...). But when > I re-ran wsdl2java like this: > > wsdl2java -catalog SpindleP.cat > http://www.cbs.dtu.dk/ws/SpindleP/SpindleP_2_0_ws0.wsdl > > ... I got exactly the same error. Weirdly, even with -verbose, there's > no indication that wsdl2java is trying and failing to read the > imported schemas. It's as if it's completely ignoring the catalog > file. > > Any idea what I'm doing wrong? I also tried using SYSTEM paths rather > than PUBLIC in the catalog file, same result. Also tried both CXF 2.2 > and 2.1.4 with no difference. > > I could probably contact the maintainers of that service and get them > to provide a URL instead of a relative path, and for now I'll just > download and modify the appropriate files myself. But it's a bit of a > shame if it doesn't work as designed, especially since SoapUI just > resolves the locations for me automatically. If this is unexpected > behaviour, let me know and I'll JIRA it. > > Thanks, > > Andrew. > > -- > :: http://biotext.org.uk/ :: > -- :: http://biotext.org.uk/ ::
