devijvers
Oct 31st, 2006, 08:08 AM
Hey,
I'm confused as how to read the element values in the SOAP header using the SoapHeaderElement interface. What I have so far is this:
public void invoke(MessageContext messageContext) throws Exception {
SoapMessage soapMessage = (SoapMessage) messageContext.getRequest();
SoapHeader header = soapMessage.getSoapHeader();
String messageID;
String correlationID;
for (Iterator iter = header.examineAllHeaderElements(); iter.hasNext();) {
SoapHeaderElement headerElement = (SoapHeaderElement) iter.next();
}
}
I can use the getName() method to get the element name but I can't find any methods to get the element content or value. Also, I couldn't find any information or resources on how to do this.
I understand I can use OXM to convert the SOAP header elements to objects but for me this is overkill since I only have a few elements I want to read.
Thanks for your feedback.
I'm confused as how to read the element values in the SOAP header using the SoapHeaderElement interface. What I have so far is this:
public void invoke(MessageContext messageContext) throws Exception {
SoapMessage soapMessage = (SoapMessage) messageContext.getRequest();
SoapHeader header = soapMessage.getSoapHeader();
String messageID;
String correlationID;
for (Iterator iter = header.examineAllHeaderElements(); iter.hasNext();) {
SoapHeaderElement headerElement = (SoapHeaderElement) iter.next();
}
}
I can use the getName() method to get the element name but I can't find any methods to get the element content or value. Also, I couldn't find any information or resources on how to do this.
I understand I can use OXM to convert the SOAP header elements to objects but for me this is overkill since I only have a few elements I want to read.
Thanks for your feedback.