I am trying to consume a remote web service from my EJB running inside JBoss. I want to use ServiceFactoryImp class and am packging "wsdl" and "jaxrpc-mapping.xml" files inside my EJB JAR file as
META-INF/wsdl/<my-wsdl-file> META-INF/jaxrpc-mapping.xml
ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL mappingURL = cl.getResource("jaxrpc-mapping.xml"); URL wsdlLocationUrl = cl.getResource("enms.wsdl");
Use the full path to the resource:
URL wsdl = cl.getResource("META-INF/wsdl/my.wsdl");