Search in sources :

Example 1 with SoapHeaderException

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

the class DefaultSoapHeaderMapper method populateUserDefinedHeader.

@Override
protected void populateUserDefinedHeader(String headerName, Object headerValue, SoapMessage target) {
    SoapHeader soapHeader = target.getSoapHeader();
    if (headerValue instanceof String) {
        QName qname = QNameUtils.parseQNameString(headerName);
        soapHeader.addAttribute(qname, (String) headerValue);
    } else if (headerValue instanceof Source) {
        Result result = soapHeader.getResult();
        try {
            this.transformerHelper.transform((Source) headerValue, result);
        } catch (TransformerException e) {
            throw new SoapHeaderException("Could not transform source [" + headerValue + "] to result [" + result + "]", e);
        }
    }
}
Also used : QName(javax.xml.namespace.QName) SoapHeader(org.springframework.ws.soap.SoapHeader) SoapHeaderException(org.springframework.ws.soap.SoapHeaderException) Source(javax.xml.transform.Source) TransformerException(javax.xml.transform.TransformerException) Result(javax.xml.transform.Result)

Aggregations

QName (javax.xml.namespace.QName)1 Result (javax.xml.transform.Result)1 Source (javax.xml.transform.Source)1 TransformerException (javax.xml.transform.TransformerException)1 SoapHeader (org.springframework.ws.soap.SoapHeader)1 SoapHeaderException (org.springframework.ws.soap.SoapHeaderException)1