resources - Java - Apache CXF Load WSDL From Jar -


i using apache cxf connect soap api. i've saved wsdl in eclipse project , want load this. project looks this:

src gen resources +           meta-inf +                    mywsdl.wsdl 

i can load wsdl if hard code in path root of drive:

static {     url url = null;     try {         url = new url("file:/home/peter/workspace/project/resources/meta-inf/mywsdl.wsdl");         system.out.println(url);     } catch (malformedurlexception e) {        //blah     } } 

however, if try load wsdl resource fails:

static {     url url = null;     try {                     url = myserviceclass.class.getresource("/resource/meta-inf/bfexchangeservice.wsdl");          system.out.println(url); //prints null     } catch (malformedurlexception e) {        //blah     } } 

how load wsdl within project (and, eventually, .jar)?

cheers,

pete

class.getresource loads file classpath, you're on right track.

so, store wsdl somewhere on classpath, e.g. source folder, , treat source folder root of 'filesystem' e.g. getresource("/mywsdl.wsdl")

hth


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -