Search in sources :

Example 1 with XMLStreamBufferException

use of com.sun.xml.stream.buffer.XMLStreamBufferException in project metro-jax-ws by eclipse-ee4j.

the class OutboundStreamHeader method writeTo.

public void writeTo(SOAPMessage saaj) throws SOAPException {
    try {
        SOAPHeader header = saaj.getSOAPHeader();
        if (header == null)
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        infoset.writeTo(header);
    } catch (XMLStreamBufferException e) {
        throw new SOAPException(e);
    }
}
Also used : SOAPException(jakarta.xml.soap.SOAPException) SOAPHeader(jakarta.xml.soap.SOAPHeader) XMLStreamBufferException(com.sun.xml.stream.buffer.XMLStreamBufferException)

Example 2 with XMLStreamBufferException

use of com.sun.xml.stream.buffer.XMLStreamBufferException in project metro-jax-ws by eclipse-ee4j.

the class OutboundReferenceParameterHeader method writeTo.

@Override
public void writeTo(SOAPMessage saaj) throws SOAPException {
    // which leads to NPE.
    try {
        SOAPHeader header = saaj.getSOAPHeader();
        if (header == null) {
            header = saaj.getSOAPPart().getEnvelope().addHeader();
        }
        Element node = (Element) infoset.writeTo(header);
        node.setAttributeNS(AddressingVersion.W3C.nsUri, AddressingVersion.W3C.getPrefix() + ":" + IS_REFERENCE_PARAMETER, TRUE_VALUE);
    } catch (XMLStreamBufferException e) {
        throw new SOAPException(e);
    }
}
Also used : Element(org.w3c.dom.Element) SOAPException(jakarta.xml.soap.SOAPException) SOAPHeader(jakarta.xml.soap.SOAPHeader) XMLStreamBufferException(com.sun.xml.stream.buffer.XMLStreamBufferException)

Aggregations

XMLStreamBufferException (com.sun.xml.stream.buffer.XMLStreamBufferException)2 SOAPException (jakarta.xml.soap.SOAPException)2 SOAPHeader (jakarta.xml.soap.SOAPHeader)2 Element (org.w3c.dom.Element)1