public SOAPHeaderElement addNotUnderstoodHeaderElement(QName qname) throws SOAPException { if (Constants.NS_SOAP11_ENV.equals(getNamespaceURI())) throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "SOAP11_NOT_SUPPORT_NOTUNDERSTOOD")); // create NotUnderstood header block QName notUnderstoodName = new QName(getNamespaceURI(), "NotUnderstood", getPrefix()); SOAPHeaderElement notUnderstoodElement = addHeaderElement(notUnderstoodName); // set qname attribute SAAJUtils.setQualifiedAttributeValue(notUnderstoodElement, "qname", qname); return notUnderstoodElement; }
public SOAPHeaderElement addUpgradeHeaderElement(Iterator supportedSoapUris) throws SOAPException { if (supportedSoapUris == null) throw new SOAPException(BundleUtils.getMessage(bundle, "LIST_OF_SUPPORTED_URIS_CANNOT_BE_NULL")); if (!supportedSoapUris.hasNext()) throw new SOAPException(BundleUtils.getMessage(bundle, "LIST_OF_SUPPORTED_URIS_CANNOT_BE_EMPTY")); final String namespaceURI = getNamespaceURI(); final String prefix = getPrefix(); // create Upgrade header block QName upgradeName = new QName(namespaceURI, "Upgrade", prefix); SOAPHeaderElement upgradeElement = addHeaderElement(upgradeName); while (supportedSoapUris.hasNext()) { String soapUri = (String)supportedSoapUris.next(); SOAPElement supportedElement = upgradeElement.addChildElement("SupportedEnvelope", prefix, namespaceURI); SAAJUtils.setQualifiedAttributeValue(supportedElement, "qname", new QName(soapUri, "Envelope")); } return upgradeElement; }
/** Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object. */ public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException { if (name == null) throw new SOAPException(BundleUtils.getMessage(bundle, "INVALID_SOAPHEADERELEMENT_NAME", name)); return addHeaderElement(new NameImpl(name.getLocalName(), name.getPrefix(), name.getURI()).toQName()); }