use of nl.nn.adapterframework.core.PipeForward in project iaf by ibissource.
the class WsdlXmlValidatorTest method wsdlTibcoFailMessage.
@Test(expected = XmlValidatorException.class)
public void wsdlTibcoFailMessage() throws IOException, PipeRunException, SAXException, WSDLException, ConfigurationException, XmlValidatorException {
WsdlXmlValidator val = new WsdlXmlValidator();
val.setWsdl(TIBCO);
val.setThrowException(true);
val.registerForward(new PipeForward("success", null));
val.configure();
val.validate("<Envelope xmlns=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" + " <Body>\n" + " <MessageHeader xmlns=\"http://www.ing.com/CSP/XSD/General/Message_2\">\n" + " <From>\n" + " <Id>Ibis4Toegang</Id>\n" + " </From>\n" + " <HeaderFields>\n" + " <ConversationId/>\n" + " <MessageId>WPNLD8921975_0a4ac029-7747a1ed_12da7d4b033_-7ff3</MessageId>\n" + " <ExternalRefToMessageId/>\n" + " <Timestamp>2001-12-17T09:30:47</Timestamp>\n" + " </HeaderFields>\n" + " </MessageHeader>\n" + " <Request xmlns=\"http://www.ing.com/nl/banking/coe/xsd/bankingcustomer_generate_01/getpartybasicdatabanking_01\">\n" + " <BankSparen xmlns=\"http://www.ing.com/bis/xsd/nl/banking/bankingcustomer_generate_01_getpartybasicdatabanking_request_01\">\n" + " <PRD>\n" + " <KLTERROR>\n" + " <KLT_NA_RELNUM>181373377001</KLT_NA_RELNUM>\n" + " </KLTERROR>\n" + " </PRD>\n" + " </BankSparen>\n" + " </Request>\n" + " </Body>\n" + "</Envelope>\n" + "", session);
}
use of nl.nn.adapterframework.core.PipeForward in project iaf by ibissource.
the class XmlValidatorTest method getSuccess.
static PipeForward getSuccess() {
PipeForward forward = new PipeForward();
forward.setName("success");
return forward;
}
use of nl.nn.adapterframework.core.PipeForward in project iaf by ibissource.
the class XmlValidatorTest2 method validate.
@Override
public String validate(String rootNamespace, String schemaLocation, boolean addNamespaceToSchema, boolean ignoreUnknownNamespaces, String inputfile, String[] expectedFailureReasons) throws ConfigurationException, InstantiationException, IllegalAccessException, XmlValidatorException, PipeRunException, IOException {
String testXml = inputfile != null ? getTestXml(inputfile + ".xml") : null;
IPipeLineSession session = new PipeLineSessionBase();
try {
XmlValidator validator = getValidator(schemaLocation, addNamespaceToSchema, implementation);
validator.setIgnoreUnknownNamespaces(ignoreUnknownNamespaces);
PipeForward forward = validator.validate(testXml, session);
evaluateResult(forward.getName(), session, null, expectedFailureReasons);
} catch (Exception e) {
evaluateResult(null, session, e, expectedFailureReasons);
return "Invalid XML";
}
return null;
}
use of nl.nn.adapterframework.core.PipeForward in project iaf by ibissource.
the class Json2WsdlXmlValidatorTest method wsdlValidate.
public void wsdlValidate(String wsdl, String soapBody, String testSoap, String testXml, String testJsonStraight, String testJsonCompact, String targetContent1, String targetContent2) throws IOException, PipeRunException, SAXException, WSDLException, ConfigurationException, XmlValidatorException {
WsdlXmlValidator val = new WsdlXmlValidator();
val.setWsdl(wsdl);
// val.setSoapBody("TradePriceRequest");
val.setThrowException(true);
val.registerForward(new PipeForward("success", null));
val.setSoapBody(soapBody);
val.configure();
boolean compactJsonArrays = false;
validate("Validate XML", val, getTestXml(testSoap), null, compactJsonArrays, targetContent1, targetContent2);
validate("XML to JSON", val, getTestXml(testSoap), "json", compactJsonArrays, targetContent1, targetContent2);
validate("JSON to XML", val, getTestXml(testJsonStraight), "xml", compactJsonArrays, targetContent1, targetContent2);
validate("JSON to JSON", val, getTestXml(testJsonStraight), "json", compactJsonArrays, targetContent1, targetContent2);
compactJsonArrays = true;
validate("Validate XML", val, getTestXml(testSoap), null, compactJsonArrays, targetContent1, targetContent2);
validate("XML to JSON", val, getTestXml(testSoap), "json", compactJsonArrays, targetContent1, targetContent2);
// basic json Parsing compactJsonArrays=true
validate("JSON to XML", val, getTestXml(testJsonCompact), "xml", compactJsonArrays, targetContent1, targetContent2);
validate("JSON to JSON", val, getTestXml(testJsonCompact), "json", compactJsonArrays, targetContent1, targetContent2);
validate("JSON to XML, extra spaces", val, " " + getTestXml(testJsonCompact), "xml", compactJsonArrays, targetContent1, targetContent2);
// check compatibiliy of compactJsonArrays=true with straight json
validate("straight JSON to XML", val, getTestXml(testJsonStraight), "xml", compactJsonArrays, targetContent1, targetContent2);
validate("straight JSON to JSON", val, getTestXml(testJsonStraight), "json", compactJsonArrays, targetContent1, targetContent2);
}
Aggregations