* @param soapObject the SOAP object to add the attribute to
* @param relay whether relay is true or false
*/
public static void addSOAP12RelayAttribute(XMLObject soapObject, boolean relay) {
if (soapObject instanceof org.opensaml.ws.soap.soap12.RelayBearing) {
((org.opensaml.ws.soap.soap12.RelayBearing) soapObject).setSOAP12Relay(new XSBooleanValue(relay, false));
} else if (soapObject instanceof AttributeExtensibleXMLObject) {
((AttributeExtensibleXMLObject) soapObject).getUnknownAttributes().put(
org.opensaml.ws.soap.soap12.RelayBearing.SOAP12_RELAY_ATTR_NAME,
new XSBooleanValue(relay, false).toString());
} else {
throw new IllegalArgumentException("Specified object was neither RelyBearing nor AttributeExtensible");
}
}