/** * Loads a web service from a web service wrapper * * @param wrapper Web service wrapper * @throws Exception */ protected void loadService(IServiceConfig wsDef) throws Exception { // first create the service String serviceId = wsDef.getId(); AxisService axisService = AxisUtil.createService(wsDef, getAxisConfiguration()); // add any additional transports addTransports(axisService); // add any end points addServiceEndPoints(axisService); // create the WSDL for the service AxisUtil.createServiceWsdl(axisService, wsDef, getAxisConfiguration()); // add the wrapper to the service list services.put(serviceId, wsDef); // start the service axisConfig.addService(axisService); axisConfig.startService(axisService.getName()); // enable or disable the service as the wrapper dictates axisService.setActive(wsDef.isEnabled()); }
public void unloadServices() throws AxisFault { Set<String> keys = services.keySet(); List<String> removed = new ArrayList<String>(); // iterate through the list of web service wrappers for (String key : keys) { IServiceConfig wrapper = services.get(key); // use the service name to remove them from the Axis system String serviceName = wrapper.getServiceClass().getSimpleName(); axisConfig.removeService(serviceName); // build a list of the ones removed removed.add(serviceName); } // now remove the wrappers from the services list for (String serviceName : removed) { services.remove(serviceName); } }
/** Load the web services from the list of web service wrappers */ public void loadServices() { List<IServiceConfig> wsDfns = getWebServiceDefinitions(); for (IServiceConfig wsDef : wsDfns) { try { loadService(wsDef); } catch (Exception e) { // Axis cannot handle a typed exception from this method, we must just log the error and // continue on Logger.error( getClass().getName(), Messages.getInstance() .getErrorString( "AbstractAxisConfigurator.ERROR_0001_COULD_NOT_LOAD_SERVICE", wsDef.getId()), e); //$NON-NLS-1$ } } }