cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: can I specify classpath for wsdllocation param to wsdl2java?
Date Thu, 04 Mar 2010 03:29:07 GMT
On Tuesday 02 March 2010 2:28:22 pm mindchi wrote:
> I have a question about this solution.
> I have a wsdl file which imports another wsdl file, which in turn imports
> an xsd file. I can do the getResource on the top level wsdl file, but will
> CXF be able to figure out where to get the other files, or will it just
> resort
> to the JVM start directory as before. It apparently goes to the JVM start
> directory for those other files.
> 
> Based on what I've tried so far, it looks like there's no way to get all of
> this working cleanly. That is, have everything packaged in a jar and
> accessed
> from there.

It SHOULD work.    I've been working with a couple people that are doing this 
and 2.2.6 does have a bunch of fixes in it to get there.   A good chunk of the 
problems is in JAXB.    I've had to hack around several bugs in JAXB to get it 
working, but the test cases I've been given now work with 2.2.6.
 
> Is this something that there should be a JIRA written up for?

If it's not working for you with 2.2.6, definitely file a JIRA and attach a 
test case.   Attaching the test case is important cause, as I said, the test 
cases other users have provided do work so I'd really need to see what you are 
doing differently.

Dan

> 
> Thanks.
> 
> 
> Thom --
> 
> dkulp wrote:
> > Oh.   Right.   Client side uses a URL and not a string.  Forgot about
> > that.   :-(
> > 
> > Yea, the only real option is to pass:
> > -wsdlLocation ""
> > (empty string) which with 2.1.3 I think will not generate the URL at all.
> > You would then need to do the getResource(...) thing yourself to find the
> > appropriate URL.
> > 
> > Dan
> > 
> > On Friday 31 October 2008 1:34:40 pm sreuland wrote:
> >> Hello Dan, thanks for reply, I've tried 'classpath:my.wsdl' or
> >> 'classpath:/my.wsdl' as wsdlLocation param to wsdl2java. The static
> >> initializer url = new java.net.URL("classpath:my.wsdl");  in generated
> >> Service class throws a MalFormed exception. The only way I've managed to
> >> get the URL() constructor to find my.wsdl is when i specify a 'file'
> >> scheme
> >> such as 'file:my.wsdl', then the URL constructor finds the file but it
> >> has
> >> to be relative to the starting directory of the jvm(not embedded in a
> >> jar).
> >> I figured if code generation in wsdl2java could recognize 'classpath:'
> >> scheme in wsdlLocation param and generate url =
> >> Service.class.getClassLoader().getResource("my.wsdl");  instead of try {
> >> url = new URL("my.wsdl"); } catch (MalformedURLException e) { } then
> >> runtime should find wsdl from classpath since java.net.URL constructor
> >> won't.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message