Search in sources :

Example 1 with SOAPHeader

use of jakarta.xml.soap.SOAPHeader in project openmq by eclipse-ee4j.

the class MessageUtil method newMessageInstance.

public static SOAPMessage newMessageInstance() throws SOAPException {
    SOAPMessage soapm = null;
    /**
     * sync create new instance to make sure to work in ALL SAAJ impl.
     */
    synchronized (syncObj) {
        soapm = messageFactory.createMessage();
    }
    SOAPHeader sh = soapm.getSOAPHeader();
    SOAPHeaderElement she = addJMSNsSOAPHeaderElement(sh, Constants.MESSAGE_HEADER);
    addMessageHeaderChildElements(she);
    soapm.saveChanges();
    return soapm;
}
Also used : SOAPHeaderElement(jakarta.xml.soap.SOAPHeaderElement) SOAPMessage(jakarta.xml.soap.SOAPMessage) SOAPHeader(jakarta.xml.soap.SOAPHeader)

Example 2 with SOAPHeader

use of jakarta.xml.soap.SOAPHeader in project openmq by eclipse-ee4j.

the class MessageUtil method removeMessageHeaderElement.

public static SOAPHeaderElement removeMessageHeaderElement(SOAPMessage message) throws SOAPException {
    SOAPHeader soapHeader = message.getSOAPHeader();
    SOAPHeaderElement she = (SOAPHeaderElement) getJMSChildElement(soapHeader, Constants.MESSAGE_HEADER);
    she.detachNode();
    message.saveChanges();
    return she;
}
Also used : SOAPHeaderElement(jakarta.xml.soap.SOAPHeaderElement) SOAPHeader(jakarta.xml.soap.SOAPHeader)

Example 3 with SOAPHeader

use of jakarta.xml.soap.SOAPHeader in project openmq by eclipse-ee4j.

the class MessageUtil method getJMSProperties.

public static Iterator getJMSProperties(SOAPMessage m) throws SOAPException {
    SOAPHeader sheader = m.getSOAPHeader();
    Name propEleName = createJMSName(InternalConstants.JMS_PROPERTY);
    Iterator it = sheader.getChildElements(propEleName);
    if (it.hasNext()) {
        SOAPHeaderElement she = (SOAPHeaderElement) it.next();
        return she.getChildElements();
    }
    // iterator with no elements.
    return it;
}
Also used : SOAPHeaderElement(jakarta.xml.soap.SOAPHeaderElement) Iterator(java.util.Iterator) SOAPHeader(jakarta.xml.soap.SOAPHeader) Name(jakarta.xml.soap.Name)

Example 4 with SOAPHeader

use of jakarta.xml.soap.SOAPHeader in project openmq by eclipse-ee4j.

the class MessageUtil method getMessageHeaderElement.

public static SOAPHeaderElement getMessageHeaderElement(SOAPMessage message) throws SOAPException {
    SOAPHeader soapHeader = message.getSOAPHeader();
    SOAPHeaderElement she = (SOAPHeaderElement) getJMSChildElement(soapHeader, Constants.MESSAGE_HEADER);
    return she;
}
Also used : SOAPHeaderElement(jakarta.xml.soap.SOAPHeaderElement) SOAPHeader(jakarta.xml.soap.SOAPHeader)

Example 5 with SOAPHeader

use of jakarta.xml.soap.SOAPHeader in project metro-jax-ws by eclipse-ee4j.

the class SAAJMessageHeaders method find.

private SOAPHeaderElement find(String nsUri, String localName) {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return null;
    }
    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while (allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem.getNamespaceURI().equals(nsUri) && nextHdrElem.getLocalName().equals(localName)) {
            return nextHdrElem;
        }
    }
    return null;
}
Also used : SOAPHeaderElement(jakarta.xml.soap.SOAPHeaderElement) Iterator(java.util.Iterator) SOAPHeader(jakarta.xml.soap.SOAPHeader)

Aggregations

SOAPHeader (jakarta.xml.soap.SOAPHeader)24 SOAPHeaderElement (jakarta.xml.soap.SOAPHeaderElement)15 Iterator (java.util.Iterator)8 SOAPException (jakarta.xml.soap.SOAPException)5 Node (org.w3c.dom.Node)4 SAAJHeader (com.sun.xml.ws.message.saaj.SAAJHeader)3 QName (javax.xml.namespace.QName)3 XMLStreamBufferException (com.sun.xml.stream.buffer.XMLStreamBufferException)2 Header (com.sun.xml.ws.api.message.Header)2 SOAPMessage (jakarta.xml.soap.SOAPMessage)2 ArrayList (java.util.ArrayList)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 Transformer (javax.xml.transform.Transformer)2 SAXException (org.xml.sax.SAXException)2 XMLStreamBufferSource (com.sun.xml.stream.buffer.XMLStreamBufferSource)1 JAXBException (jakarta.xml.bind.JAXBException)1 Name (jakarta.xml.soap.Name)1 SOAPElement (jakarta.xml.soap.SOAPElement)1 WebServiceException (jakarta.xml.ws.WebServiceException)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1