Q:

How to add wsdl file to java project resources correctly and get it path

i have wsdl file and i need to add this file to my java project resources. I have generated code from wsdl by wsimport.
What i have - 
1) added file to resources package
2) in my class from wsipmort i change url property from
URL url = null;
url = new URL("http://someUrl/someWsdlFile?wsdl");

to 
File file = new File("resources/someWsdlFile.wsdl");
String absolutePath = file.getAbsolutePath();
        try {
        url = new URL(absolutePath);
    } catch (MalformedURLException ex) {
        e = new WebServiceException(ex);
    }

and when i run my code i get an exception - 
javax.xml.ws.WebServiceException: java.net.MalformedURLException: unknown protocol: d

when i have url like this
url = new URL("file:C:/Users/someWsdlFile.wsdl");

my code works correctly without exception 
unknown protocol: d

so what am I doing wrong?

A:

To find a resource from the search path used to load classes, use following method.
ClassLoader.getSystemResource("someWsdlFile.wsdl");

If load your resource available in the classpath then use folloing method.
 yourClass.class.getResource("someWsdlFile.wsdl");

