Dmitri Colebatch wrote:
> I can, but the problem is then that my schema isn't correct. In order
> to do this (correct me if I am wrong) I would need to have my schema
> contain an import of the transformed WSDL (imported schema) along with
> a schema location. When I publish this schema, the schema location
> will not be correct.
>
> What I'd like to do is be able to define my own EntityResolver which
> could do the transformation. That way I could do something like:
>
> <xsd:import namespace="urn:dim:test-missing" />
>
> which would then give me a chance to locate it in my EntityResolver
> without breaking the schema. As far as I'm aware, this isn't possible
> - is it something that could be added?
Technically speaking, I don't think <xsd:import> is required, although
Xerces might insist (which you can always bypass with the -nv option),
so long as you make all the definitions available to JAXB.
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.
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 :-)
>> XSOM won't work if references are unresolved. Also, for XJC to find out
>> that a particular schema component is already bound, it needs to have an
>> object that represents such bound component.
>>
>> So I think it's a pretty fundamental requirement.
>
> I've had a look at xsom now, and realise that the level of detail you
> want from XSElementDecl etc isn't possible without the full schema. I
> had only been thinking in terms of my requirements which are currently
> limited to a simple javabean. All I'm after is something like "this
> QName maps to this java class".
>
>> Maybe you can run schemagen first to get a dummy schema generated?
>
> Yeah, although this would suffer the same limitation as pulling the
> schema out of the WSDL.
>
> Thanks again for your help, if you could comment on the possibility of
> using a custom EntityResolver I'd be grateful.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com