You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2009/12/04 17:51:51 UTC
Re: WSDL2JAVA, store WSDLs and XSDs locally
On Thu November 19 2009 12:53:33 am Craig Tataryn wrote:
> Problem we've faced with the catalog solution is the case where the
> XSDs your WSDL is referencing also references other XSDs in a relative
> way. It seems (to me) that you can't make a catalog entry which
> overrides "../" to point to a specific place on the classpath.
>
> For instance:
> WSDL has <xsd:import schemaLocation="schemas/3rdPartySchema.xsd"/>
> We map schemas to classpath:/schemas in a catalog and that works well.
>
> then, in 3rdPartySchema.xsd there is a: <xsd:import schemaLocation="../
> coreschemas/base.xsd"/>. There seems no way to catalog "../" to point
> to classpath:/coreschemas...
Hmm... You should HAVE to do anything with the catalogs in this case. The
systemId for 3rdPartySchema.xsd should end up being the full URL for whatever
"classpath:/schemas/3rdPartySchema.xsd" resolves to. (like
jar:file://..../myproject.jar!/schemas/3rdPartySchema.xsd)
Thus, the relative path, which would resolve from the systemId, should work
fine for that. If it isn't, that would be a bug and should be logged (with
a testcase :-) ).
Dan
>
> What happens is anytime 3rdPartySchema.xsd makes reference to an
> element from base.xsd, it complains it's an unresolved element (but
> doesn't seem to complain that it can't find base.xsd mind you).
>
> Craig.
>
> On 16-Nov-09, at 7:25 AM, Daniel Kulp wrote:
> > This is exactly what the XML catalogs are designed for (and the -
> > catalog flag
> > on wsdl2java). Basically, they allow URL patterns and such used
> > for
> > imports to be mapped into new URL's where the stuff really lives.
> > Thus, you
> > can have "http://..." type URL's in the wsdl's/xsd's, but have
> > those remapped
> > into file things or such.
> >
> > Dan
> >
> > On Sat November 14 2009 9:31:43 am Dominik Raymann wrote:
> >> Hi there,
> >>
> >> I use WSDL2JAVAto generate client code from a WSDL. I'd like to
> >> store the
> >> WSDL (and all referenced dependencies) locally so that the stubs
> >> can be
> >> generated offline. However, the WSDL references (imports) other
> >> WSDLs as
> >> well as schema files. These references are absolute URLs.
> >>
> >> Is it possible to map these URLs to local files somehow or do I
> >> have to
> >> edit the WSDL manually and change to URLs so that they point to the
> >> local
> >> files?
> >>
> >> Or is there a tool (wsdl2java itself?) that downloads everything
> >> needed for
> >> codegeneration and changes the references so that they point to the
> >> local
> >> copies of the files?
> >>
> >> Thanks for your answer,
> >>
> >> Dominik
>
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: WSDL2JAVA, store WSDLs and XSDs locally
Posted by Craig Tataryn <cr...@tataryn.net>.
Dan, I've logged the problem and did some investigation. Logged it as:
https://issues.apache.org/jira/browse/CXF-2599
Thanks,
Craig.
On Fri, Dec 4, 2009 at 10:51 AM, Daniel Kulp <dk...@apache.org> wrote:
> On Thu November 19 2009 12:53:33 am Craig Tataryn wrote:
> > Problem we've faced with the catalog solution is the case where the
> > XSDs your WSDL is referencing also references other XSDs in a relative
> > way. It seems (to me) that you can't make a catalog entry which
> > overrides "../" to point to a specific place on the classpath.
> >
> > For instance:
> > WSDL has <xsd:import schemaLocation="schemas/3rdPartySchema.xsd"/>
> > We map schemas to classpath:/schemas in a catalog and that works well.
> >
> > then, in 3rdPartySchema.xsd there is a: <xsd:import schemaLocation="../
> > coreschemas/base.xsd"/>. There seems no way to catalog "../" to point
> > to classpath:/coreschemas...
>
>
> Hmm... You should HAVE to do anything with the catalogs in this case.
> The
> systemId for 3rdPartySchema.xsd should end up being the full URL for
> whatever
> "classpath:/schemas/3rdPartySchema.xsd" resolves to. (like
> jar:file://..../myproject.jar!/schemas/3rdPartySchema.xsd)
>
> Thus, the relative path, which would resolve from the systemId, should work
> fine for that. If it isn't, that would be a bug and should be logged
> (with
> a testcase :-) ).
>
> Dan
>
>
> >
> > What happens is anytime 3rdPartySchema.xsd makes reference to an
> > element from base.xsd, it complains it's an unresolved element (but
> > doesn't seem to complain that it can't find base.xsd mind you).
> >
> > Craig.
> >
> > On 16-Nov-09, at 7:25 AM, Daniel Kulp wrote:
> > > This is exactly what the XML catalogs are designed for (and the -
> > > catalog flag
> > > on wsdl2java). Basically, they allow URL patterns and such used
> > > for
> > > imports to be mapped into new URL's where the stuff really lives.
> > > Thus, you
> > > can have "http://..." type URL's in the wsdl's/xsd's, but have
> > > those remapped
> > > into file things or such.
> > >
> > > Dan
> > >
> > > On Sat November 14 2009 9:31:43 am Dominik Raymann wrote:
> > >> Hi there,
> > >>
> > >> I use WSDL2JAVAto generate client code from a WSDL. I'd like to
> > >> store the
> > >> WSDL (and all referenced dependencies) locally so that the stubs
> > >> can be
> > >> generated offline. However, the WSDL references (imports) other
> > >> WSDLs as
> > >> well as schema files. These references are absolute URLs.
> > >>
> > >> Is it possible to map these URLs to local files somehow or do I
> > >> have to
> > >> edit the WSDL manually and change to URLs so that they point to the
> > >> local
> > >> files?
> > >>
> > >> Or is there a tool (wsdl2java itself?) that downloads everything
> > >> needed for
> > >> codegeneration and changes the references so that they point to the
> > >> local
> > >> copies of the files?
> > >>
> > >> Thanks for your answer,
> > >>
> > >> Dominik
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
--
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
twitter: craiger