Please port the fix for CXF-5645 to JBoss WS CXF.
Here is the original issue description:
The wsp:Optional attribute doesn't work for WS-RM in JBoss WS CXF. As far as the specs tell both WS-Addressing 1.0 and WS-RM 1.1 should support wsp:Optional, that is, if wsp:Optional is set to true on a WS-RM policy the WS-RM policy should become optional – the endpoint should allow both messages with and without WS-RM . However, my experimentation showed that it actually doesn't.
What I did is as follows (see the attached reproducer for details):
- Configured in WSDL (greeting.wsdl) an endpoint as optionally WS-RM enabled like the following:
- Sent a WS-RM unaware (= no SOAP header) SOAP request from the client but got the following SOAP Fault:
 In WS-RM Policy 1.1 p.8:
Per WS-Policy, this is compact notation for two policy alternatives, one with and one without the assertion. The intuition is that the behavior indicated by the assertion is optional, or in this case, that WS-ReliableMessaging MAY be used.