Search in sources :

Example 1 with DeploymentDescriptor

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);
    }
}
Also used : MalformedURLException(java.net.MalformedURLException) Hashtable(java.util.Hashtable) SOAPException(org.apache.soap.SOAPException) Element(org.w3c.dom.Element) NodeList(org.w3c.dom.NodeList) DeploymentDescriptor(org.apache.soap.server.DeploymentDescriptor) Document(org.w3c.dom.Document) URL(java.net.URL) MalformedURLException(java.net.MalformedURLException) SOAPException(org.apache.soap.SOAPException)

Example 2 with 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);
}
Also used : DeploymentDescriptor(org.apache.soap.server.DeploymentDescriptor) LoggingSOAPFaultListener(nl.nn.adapterframework.soap.LoggingSOAPFaultListener)

Aggregations

DeploymentDescriptor (org.apache.soap.server.DeploymentDescriptor)2 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 Hashtable (java.util.Hashtable)1 LoggingSOAPFaultListener (nl.nn.adapterframework.soap.LoggingSOAPFaultListener)1 SOAPException (org.apache.soap.SOAPException)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1 NodeList (org.w3c.dom.NodeList)1