* @param mustUnderstand whether mustUnderstand is true or false
*/
public static void addSOAP12MustUnderstandAttribute(XMLObject soapObject, boolean mustUnderstand) {
if (soapObject instanceof org.opensaml.ws.soap.soap12.MustUnderstandBearing) {
((org.opensaml.ws.soap.soap12.MustUnderstandBearing) soapObject)
.setSOAP12MustUnderstand(new XSBooleanValue(mustUnderstand, false));
} else if (soapObject instanceof AttributeExtensibleXMLObject) {
((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
org.opensaml.ws.soap.soap12.MustUnderstandBearing.SOAP12_MUST_UNDERSTAND_ATTR_NAME,
new XSBooleanValue(mustUnderstand, false).toString());
} else {
throw new IllegalArgumentException("Specified object was neither MustUnderstandBearing nor AttributeExtensible");
}
}