use of jakarta.xml.soap.SOAPHeaderElement 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.SOAPHeaderElement in project openmq by eclipse-ee4j.
the class MessageUtil method addJMSPropertyElement.
public static SOAPHeaderElement addJMSPropertyElement(SOAPHeader sheader) throws SOAPException {
SOAPHeaderElement she = null;
// Name pname = createJMSName (Constants.JMS_PROPERTY);
// System.out.println("*** JMS property exists: " + pname.getQualifiedName());
she = getJMSPropertyElement(sheader);
if (she == null) {
she = addJMSNsSOAPHeaderElement(sheader, InternalConstants.JMS_PROPERTY);
}
return she;
}
use of jakarta.xml.soap.SOAPHeaderElement in project openmq by eclipse-ee4j.
the class MessageUtil method getSOAPHeaderElement.
public static SOAPHeaderElement getSOAPHeaderElement(SOAPMessage message, String headerName, String nameSpace) throws SOAPException {
Iterator it = message.getSOAPHeader().examineAllHeaderElements();
while (it.hasNext()) {
SOAPHeaderElement she = (SOAPHeaderElement) it.next();
String uri = she.getNamespaceURI();
String localName = she.getLocalName();
if (headerName.equals(localName) && nameSpace.equals(uri)) {
// found message header.
return she;
}
}
return null;
}
use of jakarta.xml.soap.SOAPHeaderElement in project openmq by eclipse-ee4j.
the class MessageUtil method checkJMSMessageHeader.
public static void checkJMSMessageHeader(SOAPMessage sm) throws SOAPException {
SOAPHeaderElement msgHeader = getMessageHeaderElement(sm);
if (msgHeader != null) {
msgHeader.detachNode();
}
addMessageHeader(sm);
}
use of jakarta.xml.soap.SOAPHeaderElement in project openmq by eclipse-ee4j.
the class MessageUtil method getServiceAttribute.
public static String getServiceAttribute(SOAPMessage soapm, String localName) throws SOAPException {
SOAPHeaderElement mh = getMessageHeaderElement(soapm);
SOAPElement serviceElement = getJMSChildElement(mh, Constants.SERVICE);
if (serviceElement == null) {
throw new SOAPException("Message does not contain a Service SOAP Header Element.");
}
Name n = createJMSName(localName);
String value = serviceElement.getAttributeValue(n);
return value;
}
Aggregations