// get message object and convert to SOAPEnvelope
OMElement omEnvelope = messageContext.getMessage().getAsOMElement();
// confirm headers are there. I can cast here only because I know the implementation. :)
SOAP11HeaderImpl omHeader = (SOAP11HeaderImpl)omEnvelope.getChildElements().next();
Iterator<OMSourcedElementImpl> it = omHeader.getChildElements();
// TODO: not sure if the order of the header additions is or should be preserved.
// in other words, this test may be a little too strict.
OMSourcedElementImpl headerElem1 = it.next();
OMSourcedElementImpl headerElem2 = it.next();
// should only be two header elements, so...