use of nl.nn.adapterframework.pipes.Json2XmlValidator in project iaf by ibissource.
the class Json2XmlValidatorTest method init.
protected void init() throws ConfigurationException {
jsonPipe = new JsonPipe();
jsonPipe.setName("xml2json");
jsonPipe.registerForward(new PipeForward("success", null));
jsonPipe.setDirection("xml2json");
jsonPipe.configure();
try {
validator = implementation.newInstance();
} catch (IllegalAccessException e) {
throw new ConfigurationException(e);
} catch (InstantiationException e) {
throw new ConfigurationException(e);
}
validator.setThrowException(true);
validator.setFullSchemaChecking(true);
instance = new Json2XmlValidator();
instance.registerForward(new PipeForward("success", null));
instance.setSoapNamespace(null);
instance.setFailOnWildcards(false);
}
use of nl.nn.adapterframework.pipes.Json2XmlValidator in project iaf by ibissource.
the class Json2XmlValidatorSmileyTest method xmlToJsonViaPipe.
public String xmlToJsonViaPipe(String xml) throws ConfigurationException, PipeStartException, PipeRunException {
Json2XmlValidator json2xml = new Json2XmlValidator();
json2xml.setWarn(false);
json2xml.setSchema(xsd);
json2xml.setRoot("x");
json2xml.setOutputFormat(json2xml.FORMAT_JSON);
json2xml.setThrowException(true);
json2xml.registerForward(new PipeForward("success", null));
json2xml.configure();
json2xml.start();
IPipeLineSession pipeLineSession = new PipeLineSessionBase();
PipeRunResult prr = json2xml.doPipe(xml, pipeLineSession);
return (String) prr.getResult();
}
use of nl.nn.adapterframework.pipes.Json2XmlValidator in project iaf by ibissource.
the class Json2XmlValidatorSmileyTest method jsonToXmlViaPipe.
public String jsonToXmlViaPipe(String json) throws ConfigurationException, PipeStartException, PipeRunException {
Json2XmlValidator json2xml = new Json2XmlValidator();
json2xml.setWarn(false);
json2xml.setSchema(xsd);
json2xml.setRoot("x");
json2xml.setThrowException(true);
json2xml.registerForward(new PipeForward("success", null));
json2xml.configure();
json2xml.start();
IPipeLineSession pipeLineSession = new PipeLineSessionBase();
PipeRunResult prr = json2xml.doPipe(json, pipeLineSession);
return (String) prr.getResult();
}
Aggregations