use of org.apache.soap.server.DeploymentDescriptor in project iaf by ibissource.
the class SoapConfigManager method loadRegistry.
public void loadRegistry() throws SOAPException {
URL servicesRegistry;
String message;
try {
servicesRegistry = context.getResource(filename);
} catch (MalformedURLException e) {
message = "cannot find URL for registry from resource-name '" + filename + "'";
log.error(message, e);
throw new SOAPException(Constants.FAULT_CODE_SERVER, message, e);
}
if (servicesRegistry == null) {
message = "cannot find registry from resource-name '" + filename + "'";
log.error(message);
throw new SOAPException(Constants.FAULT_CODE_SERVER, message);
}
Element element = null;
try {
Document document = xdb.parse(servicesRegistry.openStream());
element = document.getDocumentElement();
} catch (Exception e) {
message = "exception while reading servicesRegistry from " + servicesRegistry;
log.error(message, e);
throw new SOAPException(Constants.FAULT_CODE_SERVER, message, e);
}
log.info("loading servicesRegistry from " + servicesRegistry);
;
NodeList nodelist = element.getElementsByTagNameNS("http://xml.apache.org/xml-soap/deployment", "service");
int i = nodelist.getLength();
dds = new Hashtable();
for (int j = 0; j < i; j++) {
Element element1 = (Element) nodelist.item(j);
DeploymentDescriptor deploymentdescriptor = DeploymentDescriptor.fromXML(element1);
String s = deploymentdescriptor.getID();
log.info("deploying service " + s);
dds.put(s, deploymentdescriptor);
}
}
use of org.apache.soap.server.DeploymentDescriptor in project iaf by ibissource.
the class SoapConfigManager method query.
public DeploymentDescriptor query(String id) throws SOAPException {
DeploymentDescriptor dd = super.query(id);
if (dd == null) {
if (defaultDD == null) {
synchronized (this) {
if (defaultDD == null && StringUtils.isNotEmpty(getDefaultProvider())) {
defaultDD = new DeploymentDescriptor();
defaultDD.setID("urn:default");
defaultDD.setScope(DeploymentDescriptor.SCOPE_REQUEST);
defaultDD.setServiceClass(getDefaultProvider());
defaultDD.setProviderType(DeploymentDescriptor.PROVIDER_USER_DEFINED);
defaultDD.setIsStatic(true);
defaultDD.setMethods(new String[] { "dummy" });
defaultDD.setFaultListener(new String[] { "org.apache.soap.server.DOMFaultListener" });
defaultDD.setDefaultSMRClass(SoapMappingRegistryWithDefault.class.getName());
}
}
}
dd = defaultDD;
}
dd.setFaultListener(new String[] { LoggingSOAPFaultListener.class.getName() });
log.info("SoapConfigManager.query[" + id + "] returned DeploymentDescriptor [" + dd + "]");
return (dd);
}
Aggregations