Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Windows XP
Java 1.4
Description
Given the following sample compact policy:
<wsp:Policy>
<wsam:Addressing>
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<wsam:AnonymousResponses/>
</wsp:All>
<wsp:All>
<wsam:NonAnonymousResponses/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</wsam:Addressing>
</wsp:Policy>
The resulting normalized version should look something like:
<wsp:Policy>
<wsp:ExactlyOne>
<wsp:All>
<wsam:Addressing>
<wsp:Policy>
<wsp:All>
<wsam:AnonymousResponses/>
</wsp:All>
</wsp:Policy>
</wsam:Addressing>
</wsp:All>
<wsp:All>
<wsam:Addressing>
<wsp:Policy>
<wsp:All>
<wsam:NonAnonymousResponses/>
</wsp:All>
</wsp:Policy>
</wsam:Addressing>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
When Neethi processes this without using AssertionBuilders, it places the entire <Addressing> assertion into a single XmlPrimtiveAssertion. When normalizing deeply, the XmlPrimtiveAssertion class is asked to normalize this large assertion. Yet the XmlPrimtiveAssertion only seems to normalize an Assertion if it is set to optional (creating two alternatives from one). To normalize this compact <Addressing> assertion would mean to inspect its children looking for policy operators, which XmlPrimtiveAssertion does not seem to do.
The result is that when normalization completes the policy is not actually normalized. What is the correct solution to get this sort of policy fully normalized?