throws SOAPException, ASAPException {
SOAPHeaderElement headerElement = null;
SOAPHeader header = message.getSOAPHeader();
for (Iterator i = header.getChildElements(); i.hasNext();) {
Node node = (Node) i.next();
if (node instanceof SOAPHeaderElement) {
headerElement = (SOAPHeaderElement) node;
Name headerElementName = headerElement.getElementName();
String localName = headerElementName.getLocalName();
if (localName.equals(Consts.REQUEST_HEADER)) {
String headerUri = headerElementName.getURI();
if (headerUri.equals(Consts.ASAP_NS)
|| headerUri.equals(Consts.WFXML_NS)) {
break;
}
}
}
}
if (headerElement == null) {
throw new ASAPException(ASAPException.ASAP_ELEMENT_MISSING,
"ASAP request header not found.");
}
for (Iterator i = headerElement.getChildElements(); i.hasNext();) {
Node node = (Node) i.next();
if (node instanceof SOAPElement) {
SOAPElement element = (SOAPElement) node;
String name = element.getElementName().getLocalName();
if (name.equals(Consts.RECEIVER_KEY)) {
return XMLUtil.getFirstLevelTextContent(element);