Search in sources :

Example 21 with SoapMessage

use of org.springframework.ws.soap.SoapMessage in project spring-integration by spring-projects.

the class DefaultSoapHeaderMapperTests method testNullSoapHeader.

@Test
public void testNullSoapHeader() {
    DefaultSoapHeaderMapper mapper = new DefaultSoapHeaderMapper();
    SoapMessage soapMessage = mock(SoapMessage.class);
    Map<String, Object> headers = mapper.toHeadersFromReply(soapMessage);
    assertEquals(0, headers.size());
}
Also used : SaajSoapMessage(org.springframework.ws.soap.saaj.SaajSoapMessage) SoapMessage(org.springframework.ws.soap.SoapMessage) Test(org.junit.Test)

Example 22 with SoapMessage

use of org.springframework.ws.soap.SoapMessage in project spring-integration by spring-projects.

the class AbstractWebServiceInboundGateway method fromSoapHeaders.

protected void fromSoapHeaders(MessageContext messageContext, AbstractIntegrationMessageBuilder<?> builder) {
    WebServiceMessage request = messageContext.getRequest();
    String[] propertyNames = messageContext.getPropertyNames();
    if (propertyNames != null) {
        for (String propertyName : propertyNames) {
            builder.setHeader(propertyName, messageContext.getProperty(propertyName));
        }
    }
    if (request instanceof SoapMessage) {
        SoapMessage soapMessage = (SoapMessage) request;
        Map<String, ?> headers = this.headerMapper.toHeadersFromRequest(soapMessage);
        if (!CollectionUtils.isEmpty(headers)) {
            builder.copyHeaders(headers);
        }
    }
}
Also used : WebServiceMessage(org.springframework.ws.WebServiceMessage) SoapMessage(org.springframework.ws.soap.SoapMessage)

Aggregations

SoapMessage (org.springframework.ws.soap.SoapMessage)22 Test (org.junit.Test)8 SaajSoapMessage (org.springframework.ws.soap.saaj.SaajSoapMessage)7 SoapHeader (org.springframework.ws.soap.SoapHeader)4 WebServiceMessage (org.springframework.ws.WebServiceMessage)3 SoapBody (org.springframework.ws.soap.SoapBody)3 SoapHeaderElement (org.springframework.ws.soap.SoapHeaderElement)3 MessageAddressingProperties (org.springframework.ws.soap.addressing.core.MessageAddressingProperties)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 IOException (java.io.IOException)2 URI (java.net.URI)2 Locale (java.util.Locale)2 QName (javax.xml.namespace.QName)2 Source (javax.xml.transform.Source)2 SoapEnvelope (org.springframework.ws.soap.SoapEnvelope)2 Attachment (com.consol.citrus.samples.todolist.model.Attachment)1 TodoEntry (com.consol.citrus.samples.todolist.model.TodoEntry)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 StringWriter (java.io.StringWriter)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1