Search in sources :

Example 56 with ConfigurationException

use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.

the class SoapWrapperTest method getBodyXmlAndStoreSoapNamespace.

@Test
public void getBodyXmlAndStoreSoapNamespace() throws ConfigurationException {
    SoapWrapper soapWrapper = SoapWrapper.getInstance();
    String soapMessage = xmlMessage;
    String expectedSoapBody = xmlMessage;
    String soapBody = null;
    PipeLineSession session = new PipeLineSession();
    String sessionKey = "SoapVersion";
    try {
        soapBody = soapWrapper.getBody(new Message(soapMessage), true, session, sessionKey).asString();
    } catch (Exception e) {
        soapBody = e.getMessage();
    }
    assertEquals(expectedSoapBody, soapBody);
    String soapVersion = (String) session.get(sessionKey);
    assertEquals(SoapVersion.NONE.namespace, soapVersion);
}
Also used : Message(nl.nn.adapterframework.stream.Message) SOAPMessage(javax.xml.soap.SOAPMessage) PipeLineSession(nl.nn.adapterframework.core.PipeLineSession) KeySelectorException(javax.xml.crypto.KeySelectorException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Test(org.junit.Test)

Example 57 with ConfigurationException

use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.

the class SoapWrapperTest method signSoap11MessageBadFlow.

@Test
public void signSoap11MessageBadFlow() throws ConfigurationException, IOException, TransformerException, SAXException {
    SoapWrapper soapWrapper = SoapWrapper.getInstance();
    String soapMessage = "noSOAP";
    String soapBody = null;
    try {
        soapBody = soapWrapper.signMessage(new Message(soapMessage), "test", "test", false).asString();
    } catch (Exception e) {
        soapBody = e.getMessage();
    }
    assertEquals("Could not sign message", soapBody);
}
Also used : Message(nl.nn.adapterframework.stream.Message) SOAPMessage(javax.xml.soap.SOAPMessage) KeySelectorException(javax.xml.crypto.KeySelectorException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Test(org.junit.Test)

Example 58 with ConfigurationException

use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.

the class SoapWrapperTest method getBodyXml.

@Test
public void getBodyXml() throws ConfigurationException {
    SoapWrapper soapWrapper = SoapWrapper.getInstance();
    String soapMessage = xmlMessage;
    String expectedSoapBody = "";
    String soapBody = null;
    try {
        soapBody = soapWrapper.getBody(new Message(soapMessage)).asString();
    } catch (Exception e) {
        soapBody = e.getMessage();
    }
    assertEquals(expectedSoapBody, soapBody);
}
Also used : Message(nl.nn.adapterframework.stream.Message) SOAPMessage(javax.xml.soap.SOAPMessage) KeySelectorException(javax.xml.crypto.KeySelectorException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Test(org.junit.Test)

Example 59 with ConfigurationException

use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.

the class SoapWrapperTest method getBody11AndStoreSoapNamespace.

@Test
public void getBody11AndStoreSoapNamespace() throws ConfigurationException {
    SoapWrapper soapWrapper = SoapWrapper.getInstance();
    String soapMessage = soapMessageSoap11;
    String expectedSoapBody = expectedSoapBody11;
    String soapBody = null;
    PipeLineSession session = new PipeLineSession();
    String sessionKey = "SoapVersion";
    try {
        soapBody = soapWrapper.getBody(new Message(soapMessage), true, session, sessionKey).asString();
    } catch (Exception e) {
        soapBody = e.getMessage();
    }
    assertEquals(expectedSoapBody, soapBody);
    String soapVersion = (String) session.get(sessionKey);
    assertEquals(SoapVersion.SOAP11.namespace, soapVersion);
}
Also used : Message(nl.nn.adapterframework.stream.Message) SOAPMessage(javax.xml.soap.SOAPMessage) PipeLineSession(nl.nn.adapterframework.core.PipeLineSession) KeySelectorException(javax.xml.crypto.KeySelectorException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Test(org.junit.Test)

Example 60 with ConfigurationException

use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.

the class SoapWrapperTest method getBody11.

@Test
public void getBody11() throws ConfigurationException {
    SoapWrapper soapWrapper = SoapWrapper.getInstance();
    String soapMessage = soapMessageSoap11;
    String expectedSoapBody = expectedSoapBody11;
    String soapBody = null;
    try {
        soapBody = soapWrapper.getBody(new Message(soapMessage)).asString();
    } catch (Exception e) {
        soapBody = e.getMessage();
    }
    assertEquals(expectedSoapBody, soapBody);
}
Also used : Message(nl.nn.adapterframework.stream.Message) SOAPMessage(javax.xml.soap.SOAPMessage) KeySelectorException(javax.xml.crypto.KeySelectorException) SAXException(org.xml.sax.SAXException) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Test(org.junit.Test)

Aggregations

ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)187 IOException (java.io.IOException)52 PipeRunException (nl.nn.adapterframework.core.PipeRunException)25 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)24 Parameter (nl.nn.adapterframework.parameters.Parameter)20 ArrayList (java.util.ArrayList)19 URL (java.net.URL)17 ParameterList (nl.nn.adapterframework.parameters.ParameterList)16 SAXException (org.xml.sax.SAXException)14 TransformerException (javax.xml.transform.TransformerException)12 Test (org.junit.Test)12 CredentialFactory (nl.nn.adapterframework.util.CredentialFactory)11 HashMap (java.util.HashMap)10 File (java.io.File)9 StringTokenizer (java.util.StringTokenizer)8 Connection (java.sql.Connection)7 Map (java.util.Map)7 ListenerException (nl.nn.adapterframework.core.ListenerException)7 ParameterException (nl.nn.adapterframework.core.ParameterException)7 JdbcException (nl.nn.adapterframework.jdbc.JdbcException)7