use of nl.nn.adapterframework.core.IValidator in project iaf by ibissource.
the class WsdlGeneratorUtils method canProvideWSDL.
// Check if the adapter has WebServiceListener with an InputValidator OR
// InputValidator==SoapValidator OR
// IXmlValidator.getSchema()!=NULL && webServiceListenerNamespace!=NULL
public static boolean canProvideWSDL(Adapter adapter) {
boolean hasWebServiceListener = false;
String webServiceListenerNamespace = null;
for (IListener<?> listener : WsdlGeneratorUtils.getListeners(adapter)) {
if (listener instanceof WebServiceListener) {
hasWebServiceListener = true;
webServiceListenerNamespace = ((WebServiceListener) listener).getServiceNamespaceURI();
}
}
IValidator inputValidator = adapter.getPipeLine().getInputValidator();
if (inputValidator instanceof SoapValidator) {
// We have to check this first as the SoapValidator cannot use getSchema()
return true;
} else if (inputValidator instanceof IXmlValidator) {
IXmlValidator xmlValidator = (IXmlValidator) inputValidator;
if (xmlValidator.getSchema() != null) {
return StringUtils.isNotEmpty(webServiceListenerNamespace);
}
}
// If not an IXmlValidator, return false
return hasWebServiceListener;
}
use of nl.nn.adapterframework.core.IValidator in project iaf by ibissource.
the class WsdlTest method wubCalculateQuoteAndPolicyValuesLifeRetailMixed.
@Test
public void wubCalculateQuoteAndPolicyValuesLifeRetailMixed() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
XmlValidator inputValidator = getXmlValidatorInstance("CalculationRequest", "CalculationResponse", null, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRequestv2.1.xsd " + "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail_response WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRespons.xsd");
IValidator outputValidator = inputValidator.getResponseValidator();
PipeLine pipe = mockPipeLine(inputValidator, outputValidator, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail", "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail");
WsdlGenerator wsdl = new WsdlGenerator(pipe);
wsdl.init();
wsdl.setUseIncludes(true);
test(wsdl, "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail.test.wsdl");
}
use of nl.nn.adapterframework.core.IValidator in project iaf by ibissource.
the class WsdlTest method wubFindIntermediaryMixed.
@Test
public void wubFindIntermediaryMixed() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
XmlValidator inputValidator = getXmlValidatorInstance("FindIntermediaryREQ", "FindIntermediaryRLY", null, "http://wub2nn.nn.nl/FindIntermediary WsdlTest/FindIntermediary/xsd/XSD_FindIntermediary_v1.1_r1.0.xsd");
IValidator outputValidator = inputValidator.getResponseValidator();
PipeLine pipe = mockPipeLine(inputValidator, outputValidator, "http://wub2nn.nn.nl/FindIntermediary", "WsdlTest/FindIntermediary");
WsdlGenerator wsdl = new WsdlGenerator(pipe);
wsdl.setUseIncludes(true);
wsdl.init();
assertTrue(wsdl.isUseIncludes());
test(wsdl, "WsdlTest/FindIntermediary.test.wsdl");
zip(wsdl);
// assertEquals(2, wsdl.getXSDs(true).size()); TODO?
}
use of nl.nn.adapterframework.core.IValidator in project iaf by ibissource.
the class WsdlTest method basicMixed.
@Test
public void basicMixed() throws XMLStreamException, IOException, ParserConfigurationException, SAXException, ConfigurationException, URISyntaxException, NamingException {
XmlValidator inputValidator = getXmlValidatorInstance("a", "b", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd");
IValidator outputValidator = inputValidator.getResponseValidator();
PipeLine simple = mockPipeLine(inputValidator, outputValidator, "urn:webservice1", "Test1");
WsdlGenerator wsdl = new WsdlGenerator(simple);
wsdl.init();
test(wsdl, "WsdlTest/webservice1.test.wsdl");
}
use of nl.nn.adapterframework.core.IValidator in project iaf by ibissource.
the class InputOutputPipeProcessorTest method setUp.
@Before
public void setUp() {
processor = new InputOutputPipeProcessor();
PipeProcessor chain = new PipeProcessor() {
@Override
public PipeRunResult processPipe(PipeLine pipeLine, IPipe pipe, Message message, PipeLineSession pipeLineSession) throws PipeRunException {
return pipe.doPipe(message, pipeLineSession);
}
@Override
public PipeRunResult validate(PipeLine pipeLine, IValidator validator, Message message, PipeLineSession pipeLineSession, String messageRoot) throws PipeRunException {
return validator.validate(message, pipeLineSession, messageRoot);
}
};
processor.setPipeProcessor(chain);
pipeLine = new PipeLine();
Adapter owner = new Adapter();
owner.setName("PipeLine owner");
pipeLine.setOwner(owner);
session = new PipeLineSession();
}
Aggregations