XMLElement extEl,
DescriptionElement desc,
ExtensionRegistry extReg)
throws WSDLException
{
SOAPHeaderBlockElement soapHdr =
(SOAPHeaderBlockElement) extReg.createExtElement(parentType, extType);
soapHdr.setExtensionType(extType);
soapHdr.setParentElement((WSDLElement)parent);
String elemDeclQN = extEl.getAttributeValue(Constants.ATTR_ELEMENT);
if(elemDeclQN != null)
{
try {
QName qname = extEl.getQName(elemDeclQN);
soapHdr.setElementName(qname);
} catch (WSDLException e) {
extReg.getErrorReporter().reportError(
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {elemDeclQN, extEl.getLocalName()},
ErrorReporter.SEVERITY_ERROR);
}
}
//This property defaults to 'false' if it is omitted.
String mustUnderstand = extEl.getAttributeValue(SOAPConstants.ATTR_MUSTUNDERSTAND);
soapHdr.setMustUnderstand(new Boolean(mustUnderstand));
//This property defaults to 'false' if it is omitted.
String required = extEl.getAttributeValue(Constants.ATTR_REQUIRED);
soapHdr.setRequired(new Boolean(required));
((SOAPHeaderBlockImpl)soapHdr).setTypes(desc.getTypesElement());
//TODO parseExtensionAttributes(el, SOAPHeaderBlockElement.class, soapHdr, desc);
XMLElement tempEl = extEl.getFirstChildElement();
while (tempEl != null)
{
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempEl.getQName()))
{
soapHdr.addDocumentationElement(parseDocumentation(tempEl, desc));
}
else
{
//TODO parse ext elements
}