/** * Returns whether the mustUnderstand attribute for this <CODE>SOAPHeaderBlock</CODE> object is * turned on. * * @return <CODE>true</CODE> if the mustUnderstand attribute of this <CODE>SOAPHeaderBlock</CODE> * object is turned on; <CODE>false</CODE> otherwise */ public boolean getMustUnderstand() throws SOAPProcessingException { // First, try getting the information from the property // Fallback to getting the information from the attribute String mustUnderstand; if (this.hasOMDataSourceProperty(MUST_UNDERSTAND_PROPERTY)) { mustUnderstand = this.getOMDataSourceProperty(MUST_UNDERSTAND_PROPERTY); } else { mustUnderstand = getAttribute( SOAPConstants.ATTR_MUSTUNDERSTAND, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); } // Parse the value if (mustUnderstand != null) { if (SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equals(mustUnderstand)) { return true; } else if (SOAPConstants.ATTR_MUSTUNDERSTAND_FALSE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_0.equals(mustUnderstand)) { return false; } else { throw new SOAPProcessingException( "Invalid value found in mustUnderstand value of " + this.getLocalName() + " header block"); } } return false; }
public void setMustUnderstand(String mustUnderstand) throws SOAPProcessingException { if (SOAPConstants.ATTR_MUSTUNDERSTAND_TRUE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_FALSE.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_0.equals(mustUnderstand) || SOAPConstants.ATTR_MUSTUNDERSTAND_1.equals(mustUnderstand)) { setAttribute( SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); } else { throw new SOAPProcessingException( "mustUndertand should be one of \"true\", \"false\", \"0\" or \"1\" "); } }