use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class IbisDebuggerAdvice method debugProvideOutputStream.
/**
* Provides advice for {@link IOutputStreamingSupport#provideOutputStream(PipeLineSession session, IForwardTarget next)}
*/
public MessageOutputStream debugProvideOutputStream(ProceedingJoinPoint proceedingJoinPoint, PipeLineSession session) throws Throwable {
if (!isEnabled()) {
return (MessageOutputStream) proceedingJoinPoint.proceed();
}
String correlationId = session == null ? null : session.getMessageId();
if (log.isDebugEnabled())
log.debug("debugProvideOutputStream thread id [" + Thread.currentThread().getId() + "] thread name [" + Thread.currentThread().getName() + "] correlationId [" + correlationId + "]");
if (proceedingJoinPoint.getTarget() instanceof ISender) {
ISender sender = (ISender) proceedingJoinPoint.getTarget();
// Use WriterPlaceHolder to make the contents that is later written to the MessageOutputStream appear as input of the Sender
WriterPlaceHolder writerPlaceHolder = ibisDebugger.senderInput(sender, correlationId, new WriterPlaceHolder());
MessageOutputStream resultStream = (MessageOutputStream) proceedingJoinPoint.proceed();
String resultMessage = handleMessageOutputStream(writerPlaceHolder, resultStream);
ibisDebugger.senderOutput(sender, correlationId, resultMessage);
return resultStream;
}
if (proceedingJoinPoint.getTarget() instanceof IPipe) {
IPipe pipe = (IPipe) proceedingJoinPoint.getTarget();
PipeLine pipeLine = pipe instanceof AbstractPipe ? ((AbstractPipe) pipe).getPipeLine() : new PipeLine();
// Use WriterPlaceHolder to make the contents that is later written to the MessageOutputStream appear as input of the Pipe
WriterPlaceHolder writerPlaceHolder = ibisDebugger.pipeInput(pipeLine, pipe, correlationId, new WriterPlaceHolder());
MessageOutputStream resultStream = (MessageOutputStream) proceedingJoinPoint.proceed();
String resultMessage = handleMessageOutputStream(writerPlaceHolder, resultStream);
ibisDebugger.pipeOutput(pipeLine, pipe, correlationId, resultMessage);
return resultStream;
}
log.warn("Could not identify outputstream provider [" + proceedingJoinPoint.getTarget().getClass().getName() + "] as pipe or sender");
return (MessageOutputStream) proceedingJoinPoint.proceed();
}
use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class WsdlTest method includeXsdInWsdl.
@Test
public void includeXsdInWsdl() throws XMLStreamException, IOException, ParserConfigurationException, SAXException, ConfigurationException, URISyntaxException, NamingException {
PipeLine simple = mockPipeLine(getXmlValidatorInstance("a", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), getXmlValidatorInstance("b", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), "urn:webservice1", "IncludeXsds");
WsdlGenerator wsdl = new WsdlGenerator(simple);
wsdl.setUseIncludes(true);
wsdl.init();
test(wsdl, "WsdlTest/includexsds.test.wsdl");
}
use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class WsdlTest method noroottagMixed.
@Test
public void noroottagMixed() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
XmlValidator inputValidator = getXmlValidatorInstance(null, "b", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd");
IValidator outputValidator = inputValidator.getResponseValidator();
PipeLine simple = mockPipeLine(inputValidator, outputValidator, "urn:webservice1", "TestRootTag");
WsdlGenerator wsdl = new WsdlGenerator(simple);
wsdl.init();
test(wsdl, "WsdlTest/noroottag.test.wsdl");
}
use of nl.nn.adapterframework.core.PipeLine in project iaf by ibissource.
the class WsdlTest method wubCalculateQuoteAndPolicyValuesLifeRetail.
@Test
public void wubCalculateQuoteAndPolicyValuesLifeRetail() throws XMLStreamException, IOException, SAXException, ParserConfigurationException, URISyntaxException, ConfigurationException, NamingException {
PipeLine pipe = mockPipeLine(getXmlValidatorInstance("CalculationRequest", null, null, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail " + "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRequestv2.1.xsd"), getXmlValidatorInstance("CalculationResponse", null, null, "http://wub2nn.nn.nl/CalculateQuoteAndPolicyValuesLifeRetail_response " + "WsdlTest/CalculateQuoteAndPolicyValuesLifeRetail/xsd/CalculationRespons.xsd"), "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.PipeLine in project iaf by ibissource.
the class WsdlTest method basicMultipleRootTagsAllowed.
@Test
public void basicMultipleRootTagsAllowed() throws XMLStreamException, IOException, ParserConfigurationException, SAXException, ConfigurationException, URISyntaxException, NamingException {
PipeLine simple = mockPipeLine(getXmlValidatorInstance("a,x,y", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), getXmlValidatorInstance("b,p,q", "WsdlTest/test.xsd", "urn:webservice1 WsdlTest/test.xsd"), "urn:webservice1", "Test1");
WsdlGenerator wsdl = new WsdlGenerator(simple);
wsdl.init();
test(wsdl, "WsdlTest/webservice1.test.wsdl");
}
Aggregations