Search in sources :

Example 1 with RootValidation

use of nl.nn.adapterframework.validation.RootValidation in project iaf by ibissource.

the class SoapValidator method configure.

@Override
public void configure() throws ConfigurationException {
    setSoapNamespace("");
    if (isAllowPlainXml()) {
        // super.setRoot("Envelope,"+soapBody);
        addRequestRootValidation(new RootValidation(SOAP_ENVELOPE + "," + soapBody));
    } else {
        super.setRoot(getRoot());
    }
    if (addSoapEnvelopeToSchemaLocation) {
        if (StringUtils.isEmpty(getSchemaLocation())) {
            throw new ConfigurationException("schemaLocation must be specified");
        }
        super.setSchemaLocation(getSchemaLocation() + (getSchemaLocation().length() > 0 ? " " : "") + soapVersion.getSchemaLocation());
    }
    if (StringUtils.isEmpty(soapBody)) {
        ConfigurationWarnings.add(this, log, "soapBody not specified");
    }
    if (!isAllowPlainXml()) {
        addRequestRootValidation(new RootValidation(SOAP_ENVELOPE, SOAP_BODY, soapBody));
        if (StringUtils.isNotEmpty(outputSoapBody)) {
            addResponseRootValidation(new RootValidation(SOAP_ENVELOPE, SOAP_BODY, outputSoapBody));
        }
        addRequestRootValidation(new RootValidation(SOAP_ENVELOPE, SOAP_HEADER, soapHeader));
        List<String> invalidRootNamespaces = new ArrayList<String>();
        for (String namespace : soapVersion.getNamespaces()) {
            invalidRootNamespaces.add(namespace);
        }
        addInvalidRootNamespaces(Arrays.asList(SOAP_ENVELOPE, SOAP_BODY, soapBody), invalidRootNamespaces);
        addInvalidRootNamespaces(Arrays.asList(SOAP_ENVELOPE, SOAP_HEADER, soapHeader), invalidRootNamespaces);
    }
    super.configure();
}
Also used : RootValidation(nl.nn.adapterframework.validation.RootValidation) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 RootValidation (nl.nn.adapterframework.validation.RootValidation)1