users@jaxb.java.net

Re: xjc - compiling schema that references other namespace without schema

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 02 Oct 2006 13:01:12 -0700

Dmitri Colebatch wrote:
> Hi Kohsuke,
>
> On 10/3/06, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
>> JAXB already has code to extract WSDL from a schema (the -wsdl option),
>> so maybe this works already today. Try submitting your WSDL and all your
>> schemas to XJC, with -nv and -wsdl.
>
> Yes but that would still leave me with the situation that the schema
> foo.xsd references elements contained in bar.wsdl. As far as I'm
> aware its not possible to xjc XSDs and WSDLs in the same compile run,
> which I think is what I need to do here.

Even when foo.xsd refers elements in bar.wsdl, I don't think the schema
spec requires you that foo.xsd refers to bar.wsdl. AFAIK, it's Xerces'
made-up constraint.

And I think XJC can compile a WSDL and associated XSDs, so yes you can
compile them both at the same time.


>> We can also consider letting you specify your own EntityResolver. Like
>> maybe:
>>
>> $ xjc -cp path/to/your/entityResolver.jar -entity-resolver
>> com.acme.MyEntityResolverImpl ...
>>
>> It should be pretty easy to do so (actually implementing entity resolver
>> to transform a WSDL into a schema would be more work, probably.)
>>
>> If you'd like to see something like that, please file an issue (or patch
>> welcome :-)
>
> I'll wait for you to confirm my understanding above, but I think that
> might be the best course of action (I'll take a look at providing a
> patch).

When you do this, you might want to take a look at how we are loading
plugins.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com