FileDocCategorySizeDatePackage
HeaderBuilder.javaAPI DocApache Axis 1.43473Sat Apr 22 18:57:28 BST 2006org.apache.axis.message

HeaderBuilder

public class HeaderBuilder extends SOAPHandler
author
Glen Daniels (gdaniels@allaire.com)

Fields Summary
protected static Log
log
private SOAPHeaderElement
header
private SOAPEnvelope
envelope
Constructors Summary
HeaderBuilder(SOAPEnvelope envelope)


     
    
        this.envelope = envelope;
    
Methods Summary
public voidonEndChild(java.lang.String namespace, java.lang.String localName, org.apache.axis.encoding.DeserializationContext context)

    
public SOAPHandleronStartChild(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, org.apache.axis.encoding.DeserializationContext context)

        try {
            header = new SOAPHeaderElement(namespace, localName, prefix,
                                           attributes, context);
        } catch (AxisFault axisFault) {
            throw new SAXException(axisFault);
        }

        SOAPHandler handler = new SOAPHandler();
        handler.myElement = header;

        return handler;
    
public voidstartElement(java.lang.String namespace, java.lang.String localName, java.lang.String prefix, org.xml.sax.Attributes attributes, org.apache.axis.encoding.DeserializationContext context)

        SOAPConstants soapConstants = context.getSOAPConstants();

        if (soapConstants == SOAPConstants.SOAP12_CONSTANTS &&
            attributes.getValue(Constants.URI_SOAP12_ENV, Constants.ATTR_ENCODING_STYLE) != null) {

            AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_SENDER,
                null, Messages.getMessage("noEncodingStyleAttrAppear", "Header"), null, null, null);

            throw new SAXException(fault);
        }

        if (!context.isDoneParsing()) {
            if (myElement == null) {
                try {
                    myElement = new SOAPHeader(namespace, localName, prefix,
                                               attributes, context,
                                               envelope.getSOAPConstants());
                } catch (AxisFault axisFault) {
                    throw new SAXException(axisFault);
                }
                envelope.setHeader((SOAPHeader)myElement);
            }
            context.pushNewElement(myElement);
        }