I've tried different uri forms and not having any luck. When the wsdl2java is
run against a wsdl, the Service class that it generates has a static
initializer for locating the wsdl file during runtime:
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new
QName("http://namespaces.stuff.my", "MyService");
public final static QName MyPort = new
QName("http://namespaces.stuff.my", "MyPort");
....
static {
URL url = null;
try {
url = new URL("my.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from
my.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
}
I'm trying to avoid a published wsdl url on the web, the other option
'file:my.wsdl' does work but is causing maintenance issue as each client
needs to place 'my.wsdl' in jvm's startup directory. Ideally I'd like to
embed the wsdl as a resource in a jar and then reference it from classpath.
Any possibility that wsdl2java could detect if a 'classpath:' scheme is
present in wsdllocation parameter like 'classpath:my/stuff/my.wsdl' and then
emit code like :
static {
URL url = null;
try {
url = new
MyService.class.getClassLoader().getResource("my/stuff/my.wsdl");
} catch (MalformedURLException e) {
System.err.println("Can not initialize the default wsdl from
classpath for my/stuff/my.wsdl");
// e.printStackTrace();
}
WSDL_LOCATION = url;
}
--
View this message in context:
http://www.nabble.com/can-I-specify-classpath-for-wsdllocation-param-to-wsdl2java--tp20258375p20258375.html
Sent from the cxf-user mailing list archive at Nabble.com.