Details
Description
I'm using a WSDL-first approach to expose a web service. My supplied WSDL file which is in my service bundle is not found during registration of the web service.
I have the following code in my activator:
props = new Hashtable<String, String>();
props.put("service.exported.interfaces", "*");
props.put("service.exported.configs", "wsdl");
props.put("org.apache.cxf.ws.address", "http://localhost:8080/WebService");
props.put("osgi.remote.configuration.wsdl.service.ns", "http://tradeservice.com/");
props.put("osgi.remote.configuration.wsdl.service.name", "Trade");
props.put("osgi.remote.configuration.wsdl.port.name", "TradeSoap");
props.put("osgi.remote.configuration.wsdl.location", "trade.wsdl");
tradeRegistration = ctx.registerService(TradeWebService.class.getName(), new TradeWebServiceImpl(), props);
The trade.wsdl file is in the root of my service bundle and is accessible by classes within my bundle.
When the registerService() method is called I get this error:
NullPointerException: (TopologyManager.java:333)
I debugged through the dsw code and found the problem appears to be this line:
WsdlConfigurationTypeHandler.java:120
URL wsdlURL = dswContext.getBundle().getResource(location);
The WSDL resource is being loaded in the context of the DOSGi bundle, instead of from my service bundle, thus the file is not found and the registration fails.
If I package my WDSL file into the DOSGi bundle, then it works and the web service registers properly and publishes my supplied WSDL.