Search in sources :

Example 61 with StreamSource

use of javax.xml.transform.stream.StreamSource in project camel by apache.

the class ConsumerExceptionPropagationRouteTest method consumeWebserviceAndTestForSoapFault.

@Test
public void consumeWebserviceAndTestForSoapFault() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlRequestForGoogleStockQuote));
    mockClient.sendRequest(withPayload(source)).andExpect(serverOrReceiverFault());
}
Also used : StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 62 with StreamSource

use of javax.xml.transform.stream.StreamSource in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testClassicalSoapHttpHeaderInterference.

@Test
public void testClassicalSoapHttpHeaderInterference() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new SoapActionCallback("http://www.stockquotes.edu/soapHttpHeaderAction"), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultSoapAction.expectedMinimumMessageCount(1);
    resultSoapAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 63 with StreamSource

use of javax.xml.transform.stream.StreamSource in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWrongWSAddressingAction.

@Test(expected = WebServiceIOException.class)
public void testWrongWSAddressingAction() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback("http://this-is-a-wrong-ws-addressing-action"), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 64 with StreamSource

use of javax.xml.transform.stream.StreamSource in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingAction.

@Test
public void testWSAddressingAction() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback("http://www.stockquotes.edu/myUniqueAction"), TestUtil.NOOP_SOURCE_EXTRACTOR);
    // here is localhost as to by default
    resultEndpointAction.expectedMinimumMessageCount(1);
    resultEndpointAction.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 65 with StreamSource

use of javax.xml.transform.stream.StreamSource in project camel by apache.

the class ConsumerWSAEndpointMappingRouteTest method testWSAddressingActionAndTo.

@Test
public void testWSAddressingActionAndTo() throws Exception {
    StreamSource source = new StreamSource(new StringReader(xmlBody));
    webServiceTemplate.sendSourceAndReceive(source, new ActionCallback(new URI("http://actionAndTo"), new Addressing10(), new URI("http://url4.to")), TestUtil.NOOP_SOURCE_EXTRACTOR);
    resultEndpointActionAndTo.expectedMinimumMessageCount(1);
    resultEndpointActionAndTo.assertIsSatisfied();
}
Also used : SoapActionCallback(org.springframework.ws.soap.client.core.SoapActionCallback) ActionCallback(org.springframework.ws.soap.addressing.client.ActionCallback) StreamSource(javax.xml.transform.stream.StreamSource) StringReader(java.io.StringReader) Addressing10(org.springframework.ws.soap.addressing.version.Addressing10) URI(java.net.URI) Test(org.junit.Test)

Aggregations

StreamSource (javax.xml.transform.stream.StreamSource)338 Source (javax.xml.transform.Source)115 StringReader (java.io.StringReader)101 StreamResult (javax.xml.transform.stream.StreamResult)85 Transformer (javax.xml.transform.Transformer)74 Test (org.junit.Test)73 InputStream (java.io.InputStream)68 TransformerFactory (javax.xml.transform.TransformerFactory)58 ByteArrayInputStream (java.io.ByteArrayInputStream)56 IOException (java.io.IOException)52 DOMSource (javax.xml.transform.dom.DOMSource)49 TransformerException (javax.xml.transform.TransformerException)48 StringWriter (java.io.StringWriter)45 SchemaFactory (javax.xml.validation.SchemaFactory)44 InputSource (org.xml.sax.InputSource)44 Schema (javax.xml.validation.Schema)43 SAXException (org.xml.sax.SAXException)42 SAXSource (javax.xml.transform.sax.SAXSource)33 Validator (javax.xml.validation.Validator)31 File (java.io.File)27