protected Element readActionRequestElement( Element bodyElement, ActionRequestMessage message, ActionInvocation actionInvocation) { NodeList bodyChildren = bodyElement.getChildNodes(); log.fine( "Looking for action request element matching namespace:" + message.getActionNamespace()); for (int i = 0; i < bodyChildren.getLength(); i++) { Node bodyChild = bodyChildren.item(i); if (bodyChild.getNodeType() != Node.ELEMENT_NODE) continue; String unprefixedName = getUnprefixedNodeName(bodyChild); if (unprefixedName.equals(actionInvocation.getAction().getName())) { if (bodyChild.getNamespaceURI() == null || !bodyChild.getNamespaceURI().equals(message.getActionNamespace())) throw new UnsupportedDataException( "Illegal or missing namespace on action request element: " + bodyChild); log.fine("Reading action request element: " + unprefixedName); return (Element) bodyChild; } } throw new UnsupportedDataException( "Could not read action request element matching namespace: " + message.getActionNamespace()); }
protected Element writeActionRequestElement( Document d, Element bodyElement, ActionRequestMessage message, ActionInvocation actionInvocation) { log.fine("Writing action request element: " + actionInvocation.getAction().getName()); Element actionRequestElement = d.createElementNS( message.getActionNamespace(), "u:" + actionInvocation.getAction().getName()); bodyElement.appendChild(actionRequestElement); return actionRequestElement; }