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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations