*/
String id = uriNodeValue.substring(1);
SOAPConstants sc = WSSecurityUtil.getSOAPConstants(doc.getDocumentElement());
Element selectedElem = WSSecurityUtil.findBodyElement(doc, sc);
if (selectedElem == null) {
throw new ResourceResolverException("generic.EmptyMessage",
new Object[]{"Body element not found"},
uri,
BaseURI);
}
String cId = selectedElem.getAttributeNS(WSConstants.WSU_NS, "Id");
/*
* If Body Id match fails, look for a generic Id (without a namespace)
* that matches the URI. If that lookup fails, try to get a namespace
* qualified Id that matches the URI.
*/
if (!id.equals(cId)) {
cId = null;
if ((selectedElem = WSSecurityUtil.getElementByWsuId(doc, uriNodeValue)) != null) {
cId = selectedElem.getAttributeNS(WSConstants.WSU_NS,"Id");
} else if ((selectedElem = WSSecurityUtil.getElementByGenId(doc, uriNodeValue)) != null) {
cId = selectedElem.getAttribute("Id");
}
if (cId == null) {
throw new ResourceResolverException("generic.EmptyMessage",
new Object[]{"Id not found"},
uri,
BaseURI);
}
}