Ok, I think I understand. Here was the solution in case it helps anyone else:
The encryptionParts should be specified with a namespace indicated by an empty
set of curly brackets. This will default to the soap namespace, apparently the
one used by the client request, either 1.1 or 1.2. Omitting the {namespace}
altogether did not work for me.
<entry key="encryptionParts" value="{Content}{}Body" />
From: Hart, Andrew B.
Sent: Friday, January 29, 2016 12:22 PM
To: '[email protected]'
Subject: WS-Security configuration for both Soap 1.1 and 1.2
I am using Apache CXF 2.3.1 with JBoss 6.
I have several web services that are configured to use WS-Security in a
java-first method. I have added the annotation
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING) and now my web
services are deployed using Soap 1.2.
However, in order to get the WS-Security working, I had to change the
signatureParts and encryptionParts in my jboss-cxf.xml configuration file to
replace the Soap 1.1 schema ref with Soap 1.2 like this:
<!-- <entry key="encryptionParts"
value="{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body" /> -->
<entry key="encryptionParts"
value="{Content}{http://www.w3.org/2003/05/soap-envelope}Body" />
(signatureParts in a similar manner...)
Which I presume will fail if I receive a Soap 1.1 request.
How can I specify that either Soap 1.1 or Soap 1.2 may be used?
-- Andrew Hart
Software Engineer
Data Networks Corporation