use of nl.nn.adapterframework.pipes.JsonPipe 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(Direction.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.JsonPipe in project iaf by ibissource.
the class RestListener method transformToJson.
public String transformToJson(String message) throws PipeRunException {
JsonPipe pipe = new JsonPipe();
pipe.setDirection(Direction.XML2JSON);
PipeRunResult pipeResult = pipe.doPipe(new Message(message), new PipeLineSession());
try {
return pipeResult.getResult().asString();
} catch (IOException e) {
throw new PipeRunException(null, "cannot transform result", e);
}
}
use of nl.nn.adapterframework.pipes.JsonPipe in project iaf by ibissource.
the class RestListener method transformToXml.
public String transformToXml(String message) throws PipeRunException {
JsonPipe pipe = new JsonPipe();
PipeRunResult pipeResult = pipe.doPipe(new Message(message), new PipeLineSession());
try {
return pipeResult.getResult().asString();
} catch (IOException e) {
throw new PipeRunException(null, "cannot transform result", e);
}
}
Aggregations