Search in sources :

Example 1 with JmsListener

use of nl.nn.adapterframework.jms.JmsListener in project iaf by ibissource.

the class Wsdl method service.

protected void service(XMLStreamWriter w, String servlet) throws XMLStreamException, NamingException {
    String httpPrefix = "";
    String jmsPrefix = "";
    if (httpActive && jmsActive) {
        httpPrefix = "Http";
        jmsPrefix = "Jms";
    }
    if (httpActive) {
        httpService(w, servlet, httpPrefix);
    }
    if (jmsActive) {
        for (IListener listener : WsdlUtils.getListeners(pipeLine.getAdapter())) {
            if (listener instanceof JmsListener) {
                jmsService(w, (JmsListener) listener, jmsPrefix);
            }
        }
    }
}
Also used : JmsListener(nl.nn.adapterframework.jms.JmsListener) IListener(nl.nn.adapterframework.core.IListener)

Example 2 with JmsListener

use of nl.nn.adapterframework.jms.JmsListener in project iaf by ibissource.

the class Wsdl method init.

public void init() throws IOException, XMLStreamException, ConfigurationException {
    inputXsds = new HashSet<XSD>();
    outputXsds = new HashSet<XSD>();
    xsds = new HashSet<XSD>();
    rootXsds = new HashSet<XSD>();
    Set<XSD> inputRootXsds = new HashSet<XSD>();
    inputRootXsds.addAll(getXsds(inputValidator));
    rootXsds.addAll(inputRootXsds);
    inputXsds.addAll(SchemaUtils.getXsdsRecursive(inputRootXsds));
    xsds.addAll(inputXsds);
    if (outputValidator != null) {
        Set<XSD> outputRootXsds = new HashSet<XSD>();
        outputRootXsds.addAll(getXsds(outputValidator));
        rootXsds.addAll(outputRootXsds);
        outputXsds.addAll(SchemaUtils.getXsdsRecursive(outputRootXsds));
        xsds.addAll(outputXsds);
    } else {
        if (isMixedValidator) {
            outputXsds.addAll(inputXsds);
        }
    }
    prefixByXsd = new LinkedHashMap<XSD, String>();
    namespaceByPrefix = new LinkedHashMap<String, String>();
    int prefixCount = 1;
    xsdsGroupedByNamespace = SchemaUtils.getXsdsGroupedByNamespace(xsds, true);
    for (String namespace : xsdsGroupedByNamespace.keySet()) {
        // (see http://www.w3.org/TR/xml-names/#ns-decl).
        if (!"http://www.w3.org/XML/1998/namespace".equals(namespace)) {
            for (XSD xsd : xsdsGroupedByNamespace.get(namespace)) {
                prefixByXsd.put(xsd, "ns" + prefixCount);
            }
            namespaceByPrefix.put("ns" + prefixCount, namespace);
            prefixCount++;
        }
    }
    for (XSD xsd : xsds) {
        if (StringUtils.isEmpty(xsd.getTargetNamespace()) && !xsd.isAddNamespaceToSchema()) {
            warn("XSD '" + xsd + "' doesn't have a targetNamespace and addNamespaceToSchema is false");
        }
    }
    inputRoot = getRoot(inputValidator);
    inputHeaderElement = getHeaderElement(inputValidator, inputXsds);
    inputHeaderIsOptional = isHeaderOptional(inputValidator);
    inputBodyElement = getBodyElement(inputValidator, inputXsds, "inputValidator");
    if (outputValidator != null) {
        outputRoot = getRoot(outputValidator);
        outputHeaderElement = getHeaderElement(outputValidator, outputXsds);
        outputHeaderIsOptional = isHeaderOptional(outputValidator);
        outputBodyElement = getBodyElement(outputValidator, outputXsds, "outputValidator");
    } else {
        if (isMixedValidator) {
            outputRoot = getRoot(inputValidator, true);
            outputHeaderElement = inputHeaderElement;
            outputHeaderIsOptional = inputHeaderIsOptional;
            outputBodyElement = getBodyElement(inputValidator, outputXsds, "outputValidator", true);
        }
    }
    for (IListener listener : WsdlUtils.getListeners(pipeLine.getAdapter())) {
        if (listener instanceof WebServiceListener) {
            httpActive = true;
        } else if (listener instanceof JmsListener) {
            jmsActive = true;
        } else if (listener instanceof JavaListener) {
            JavaListener jl = (JavaListener) listener;
            if (jl.isHttpWsdl())
                httpActive = true;
        }
    }
}
Also used : JmsListener(nl.nn.adapterframework.jms.JmsListener) JavaListener(nl.nn.adapterframework.receivers.JavaListener) IListener(nl.nn.adapterframework.core.IListener) XSD(nl.nn.adapterframework.validation.XSD) WebServiceListener(nl.nn.adapterframework.http.WebServiceListener) HashSet(java.util.HashSet)

Aggregations

IListener (nl.nn.adapterframework.core.IListener)2 JmsListener (nl.nn.adapterframework.jms.JmsListener)2 HashSet (java.util.HashSet)1 WebServiceListener (nl.nn.adapterframework.http.WebServiceListener)1 JavaListener (nl.nn.adapterframework.receivers.JavaListener)1 XSD (nl.nn.adapterframework.validation.XSD)1