Issue with XPath configuration inside RampartUtil
-------------------------------------------------
Key: RAMPART-132
URL: https://issues.apache.org/jira/browse/RAMPART-132
Project: Rampart
Issue Type: Bug
Components: rampart-policy
Affects Versions: 1.1, 1.2, 1.3
Reporter: Narayan S Dhillon
Priority: Critical
* Issue:
RampartUtil intializes Jaxen XPath incorrectly. While adding the namespaces
it's using the namespaces found in soap envelope as opposed to what is defined
with XPath expression in sp:XPath element.
This makes XPath expression to fail if targeted message contains different
namespace prefixs.
Below is affected code snippet from
org.apache.rampart.util.RampartUtil.getPartsAndElements(..)
XPath xp = new AXIOMXPath(expression);
Iterator nsIter = namespaces.iterator();
while (nsIter.hasNext()){
OMNamespace tmpNs = (OMNamespace)nsIter.next();
xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
}
Example:
WS-SP policy sample:
<wsp:Policy wsu:Id="InitiatePaymentRequestSignedPolicy">
<sp:SignedElements>
<sp:XPath
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">//S:Envelope/S:Body</sp:XPath>
</sp:SignedElements>
</wsp:Policy>
If soap envelope contains different namespace to "S" then Xpath wont work.
* Possible Solution:
While registering the name spaces in above code snippet, it should also
register the name spaces defined in sp:XPath element.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.