Search in sources :

Example 1 with WsdlXmlValidator

use of nl.nn.adapterframework.pipes.WsdlXmlValidator in project iaf by ibissource.

the class WsdlGeneratorTest method testWsdlXmlValidatorWithWsdl.

@Test
public void testWsdlXmlValidatorWithWsdl() throws Exception {
    PipeLine pipeline = createPipeline();
    WsdlXmlValidator inputValidator = new WsdlXmlValidator();
    inputValidator.setWsdl(validateResource("/WsdlGenerator/HelloWorld.wsdl"));
    inputValidator.setSoapBody("HelloWorld_Request");
    inputValidator.setOutputSoapBody("HelloWorld_Response");
    inputValidator.setSoapBodyNamespace("http://dummy.nl/HelloWorld");
    inputValidator.setThrowException(true);
    pipeline.setInputValidator(inputValidator);
    pipeline.getAdapter().configure();
    WsdlGenerator generator = new WsdlGenerator(pipeline);
    assertNotNull(generator);
    generator.init();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    generator.wsdl(out, "dummyServlet");
    String result = new String(out.toByteArray());
    result = result.replaceAll("[0-9]{4}-.*:[0-9]{2}", "DATETIME");
    TestAssertions.assertEqualsIgnoreCRLF(TestFileUtils.getTestFile("/WsdlGenerator/GeneratedHelloWorld.wsdl"), result);
}
Also used : WsdlXmlValidator(nl.nn.adapterframework.pipes.WsdlXmlValidator) ByteArrayOutputStream(java.io.ByteArrayOutputStream) PipeLine(nl.nn.adapterframework.core.PipeLine) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PipeLine (nl.nn.adapterframework.core.PipeLine)1 WsdlXmlValidator (nl.nn.adapterframework.pipes.WsdlXmlValidator)1 Test (org.junit.Test)1