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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations