Class SOAPEnvelopeImpl

    • Constructor Detail

      • SOAPEnvelopeImpl

        public SOAPEnvelopeImpl​(SOAPEnvelope envelope)
    • Method Detail

      • createName

        public Name createName​(String localName,
                               String prefix,
                               String uri)
                        throws SOAPException
        Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI.

        This factory method creates Name objects for use in the SOAP/XML document.

        Specified by:
        createName in interface SOAPEnvelope
        Parameters:
        localName - a String giving the local name
        prefix - a String giving the prefix of the namespace
        uri - a String giving the URI of the namespace
        Returns:
        a Name object initialized with the given local name, namespace prefix, and namespace URI
        Throws:
        SOAPException - if there is a SOAP error
      • createName

        public Name createName​(String localName)
                        throws SOAPException
        Creates a new Name object initialized with the given local name.

        This factory method creates Name objects for use in the SOAP/XML document.

        Specified by:
        createName in interface SOAPEnvelope
        Parameters:
        localName - a String giving the local name
        Returns:
        a Name object initialized with the given local name
        Throws:
        SOAPException - if there is a SOAP error
      • getHeader

        public SOAPHeader getHeader()
                             throws SOAPException
        Returns the SOAPHeader object for this SOAPEnvelope object.

        A new SOAPMessage object is by default created with a SOAPEnvelope object that contains an empty SOAPHeader object. As a result, the method getHeader will always return a SOAPHeader object unless the header has been removed and a new one has not been added.

        Specified by:
        getHeader in interface SOAPEnvelope
        Returns:
        the SOAPHeader object or null if there is none
        Throws:
        SOAPException - if there is a problem obtaining the SOAPHeader object
      • getBody

        public SOAPBody getBody()
                         throws SOAPException
        Returns the SOAPBody object associated with this SOAPEnvelope object.

        A new SOAPMessage object is by default created with a SOAPEnvelope object that contains an empty SOAPBody object. As a result, the method getBody will always return a SOAPBody object unless the body has been removed and a new one has not been added.

        Specified by:
        getBody in interface SOAPEnvelope
        Returns:
        the SOAPBody object for this SOAPEnvelope object or null if there is none
        Throws:
        SOAPException - if there is a problem obtaining the SOAPBody object
      • addHeader

        public SOAPHeader addHeader()
                             throws SOAPException
        Creates a SOAPHeader object and sets it as the SOAPHeader object for this SOAPEnvelope object.

        It is illegal to add a header when the envelope already contains a header. Therefore, this method should be called only after the existing header has been removed.

        Specified by:
        addHeader in interface SOAPEnvelope
        Returns:
        the new SOAPHeader object
        Throws:
        SOAPException - if this SOAPEnvelope object already contains a valid SOAPHeader object
      • addBody

        public SOAPBody addBody()
                         throws SOAPException
        Creates a SOAPBody object and sets it as the SOAPBody object for this SOAPEnvelope object.

        It is illegal to add a body when the envelope already contains a body. Therefore, this method should be called only after the existing body has been removed.

        Specified by:
        addBody in interface SOAPEnvelope
        Returns:
        the new SOAPBody object
        Throws:
        SOAPException - if this SOAPEnvelope object already contains a valid SOAPBody object
      • addAttribute

        public SOAPElement addAttribute​(Name name,
                                        String value)
                                 throws SOAPException
        Override SOAPElement.addAttribute SOAP1.2 should not allow encodingStyle attribute to be set on Envelop
        Specified by:
        addAttribute in interface SOAPElement
        Overrides:
        addAttribute in class SOAPElementImpl<SOAPEnvelope>
        Parameters:
        name - a Name object with the name of the attribute
        value - a String giving the value of the attribute
        Returns:
        the SOAPElement object into which the attribute was inserted
        Throws:
        SOAPException - if there is an error in creating the Attribute