Class SOAPEnvelopeImpl

java.lang.Object
org.apache.axis2.saaj.ProxyNode<T,S>
org.apache.axis2.saaj.NodeImpl<Element,T>
org.apache.axis2.saaj.SOAPElementImpl<org.apache.axiom.soap.SOAPEnvelope>
org.apache.axis2.saaj.SOAPEnvelopeImpl
All Implemented Interfaces:
jakarta.xml.soap.Node, jakarta.xml.soap.SOAPElement, jakarta.xml.soap.SOAPEnvelope, Element, Node

public class SOAPEnvelopeImpl extends SOAPElementImpl<org.apache.axiom.soap.SOAPEnvelope> implements jakarta.xml.soap.SOAPEnvelope
  • Constructor Details

    • SOAPEnvelopeImpl

      public SOAPEnvelopeImpl(org.apache.axiom.soap.SOAPEnvelope envelope)
  • Method Details

    • createName

      public jakarta.xml.soap.Name createName(String localName, String prefix, String uri) throws jakarta.xml.soap.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 jakarta.xml.soap.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:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • createName

      public jakarta.xml.soap.Name createName(String localName, String prefix) throws jakarta.xml.soap.SOAPException
      Specified by:
      createName in interface jakarta.xml.soap.SOAPEnvelope
      Throws:
      jakarta.xml.soap.SOAPException
    • createName

      public jakarta.xml.soap.Name createName(String localName) throws jakarta.xml.soap.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 jakarta.xml.soap.SOAPEnvelope
      Parameters:
      localName - a String giving the local name
      Returns:
      a Name object initialized with the given local name
      Throws:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • getHeader

      public jakarta.xml.soap.SOAPHeader getHeader() throws jakarta.xml.soap.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 jakarta.xml.soap.SOAPEnvelope
      Returns:
      the SOAPHeader object or null if there is none
      Throws:
      jakarta.xml.soap.SOAPException - if there is a problem obtaining the SOAPHeader object
    • getBody

      public jakarta.xml.soap.SOAPBody getBody() throws jakarta.xml.soap.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 jakarta.xml.soap.SOAPEnvelope
      Returns:
      the SOAPBody object for this SOAPEnvelope object or null if there is none
      Throws:
      jakarta.xml.soap.SOAPException - if there is a problem obtaining the SOAPBody object
    • addHeader

      public jakarta.xml.soap.SOAPHeader addHeader() throws jakarta.xml.soap.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 jakarta.xml.soap.SOAPEnvelope
      Returns:
      the new SOAPHeader object
      Throws:
      jakarta.xml.soap.SOAPException - if this SOAPEnvelope object already contains a valid SOAPHeader object
    • addBody

      public jakarta.xml.soap.SOAPBody addBody() throws jakarta.xml.soap.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 jakarta.xml.soap.SOAPEnvelope
      Returns:
      the new SOAPBody object
      Throws:
      jakarta.xml.soap.SOAPException - if this SOAPEnvelope object already contains a valid SOAPBody object
    • addTextNode

      public jakarta.xml.soap.SOAPElement addTextNode(String text) throws jakarta.xml.soap.SOAPException
      Description copied from class: SOAPElementImpl
      Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
      Specified by:
      addTextNode in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addTextNode in class SOAPElementImpl<org.apache.axiom.soap.SOAPEnvelope>
      Parameters:
      text - a String object with the textual content to be added
      Returns:
      the SOAPElement object into which the new Text object was inserted
      Throws:
      jakarta.xml.soap.SOAPException - if there is an error in creating the new Text object
    • addAttribute

      public jakarta.xml.soap.SOAPElement addAttribute(jakarta.xml.soap.Name name, String value) throws jakarta.xml.soap.SOAPException
      Override SOAPElement.addAttribute SOAP1.2 should not allow encodingStyle attribute to be set on Envelop
      Specified by:
      addAttribute in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addAttribute in class SOAPElementImpl<org.apache.axiom.soap.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:
      jakarta.xml.soap.SOAPException - if there is an error in creating the Attribute
    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(jakarta.xml.soap.Name name) throws jakarta.xml.soap.SOAPException
      Override SOAPElement.addChildElement SOAP 1.2 should not allow element to be added after body element
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPEnvelope>
      Throws:
      jakarta.xml.soap.SOAPException