Kohsuke Kawaguchi wrote:
>>> Since the import statement doesn't contain schemaLocation, JAXP is
>>> failing to resolve them (unless your EntityResolver is resolving
>>> them for us.) That's why you see all sort sof "undefined
>>> declaration" error.
>>
> >
>
>> A couple questions about that. First, I already have the schema
>> adding to the schema compiler. You think I should just return an
>> InputSource with a systemId referring to that schema - i.e.
>> http://..../Service.wsdl#types?schema1? Second, what if there are
>> multiple schemas with that same namespace in that wsdl. It would seem
>> to me (because I'm lazy ;-)) that JAXB should be able to determine
>> that a schema is importing all the schemas of that namespace and work
>> accordingly.
>
>
> If those schemas are already submitted to XJC, then you don't have to
> do anything with those import statements or entity resolvers. XJC will
> find out that there are definitions available, and even if they are
> not referenced each other, it will resolve to the right definition.
OK, well I am definitely adding in all the schemas myself before calling
schemaCompiler.bind().
>
> Ah, you know what, but the JAXP RI might not do that. It might still
> complain, even though it found those definitions (!), because there's
> no corresponding <xs:import> from the referer schema. If you ask me,
> they put focus on a wrong thing, but anyway...
>
> The other thing worth trying is to tell JAXB to bypass the JAXP RI
> altogether. Try setting the
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.noCorrectnessCheck
> system property to true and see if that makes a difference. This is an
> escape hatch I left in the code for cases just like this.
>
> If this turns out to be useful we can enhance the API to expose it.
>
While this does get rid of the irrelavent warnings, it turns out that
this doesn't make a difference.
Did you see the message from Ed Mooney which shows that this problem is
also in the JAXWS RI? He got the same output with the WSDL. So I think
this is an error somewhere in JAXB and not how I'm using it. Any other
ideas?
- Dan
--
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com