Class BodyImpl

    • Method Detail

      • getFaultName

        protected abstract NameImpl getFaultName​(String name)
      • isFault

        protected abstract boolean isFault​(SOAPElement child)
      • createFaultElement

        protected abstract SOAPFault createFaultElement()
      • getDefaultFaultCode

        protected abstract QName getDefaultFaultCode()
      • addFault

        public SOAPFault addFault()
                           throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have default values set for the mandatory child elements. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

        A SOAPBody may contain at most one SOAPFault child element.

        Specified by:
        addFault in interface SOAPBody
        Returns:
        the new SOAPFault object
        Throws:
        SOAPException - if there is a SOAP error
      • addFault

        public SOAPFault addFault​(Name faultCode,
                                  String faultString,
                                  Locale locale)
                           throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

        For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

        A SOAPBody may contain at most one SOAPFault child element.

        Specified by:
        addFault in interface SOAPBody
        Parameters:
        faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the Version of SOAP specification in use
        faultString - a String giving an explanation of the fault
        locale - a Locale object indicating the native language of the faultString
        Returns:
        the new SOAPFault object
        Throws:
        SOAPException - if there is a SOAP error
        See Also:
        SOAPFault.setFaultCode(jakarta.xml.soap.Name), SOAPFault.setFaultString(java.lang.String)
      • addFault

        public SOAPFault addFault​(QName faultCode,
                                  String faultString,
                                  Locale locale)
                           throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

        For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

        A SOAPBody may contain at most one SOAPFault child element.

        Specified by:
        addFault in interface SOAPBody
        Parameters:
        faultCode - a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use.
        faultString - a String giving an explanation of the fault
        locale - a Locale object indicating the native language of the faultString
        Returns:
        the new SOAPFault object
        Throws:
        SOAPException - if there is a SOAP error
        See Also:
        SOAPFault.setFaultCode(jakarta.xml.soap.Name), SOAPFault.setFaultString(java.lang.String), SOAPBody.addFault(Name faultCode, String faultString, Locale locale)
      • addFault

        public SOAPFault addFault​(Name faultCode,
                                  String faultString)
                           throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

        For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

        In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang attribute on the Fault/Reason/Text element will be set to java.util.Locale.getDefault()

        A SOAPBody may contain at most one SOAPFault child element.

        Specified by:
        addFault in interface SOAPBody
        Parameters:
        faultCode - a Name object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
        faultString - a String giving an explanation of the fault
        Returns:
        the new SOAPFault object
        Throws:
        SOAPException - if there is a SOAP error
        See Also:
        SOAPFault.setFaultCode(jakarta.xml.soap.Name), SOAPFault.setFaultString(java.lang.String)
      • addFault

        public SOAPFault addFault​(QName faultCode,
                                  String faultString)
                           throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new SOAPFault object and adds it to this SOAPBody object. The type of the SOAPFault will be a SOAP 1.1 or a SOAP 1.2 SOAPFault depending on the protocol specified while creating the MessageFactory instance.

        For SOAP 1.2 the faultCode parameter is the value of the Fault/Code/Value element and the faultString parameter is the value of the Fault/Reason/Text element. For SOAP 1.1 the faultCode parameter is the value of the faultcode element and the faultString parameter is the value of the faultstring element.

        In case of a SOAP 1.2 fault, the default value for the mandatory xml:lang attribute on the Fault/Reason/Text element will be set to java.util.Locale.getDefault()

        A SOAPBody may contain at most one SOAPFault child element

        Specified by:
        addFault in interface SOAPBody
        Parameters:
        faultCode - a QName object giving the fault code to be set; must be one of the fault codes defined in the version of SOAP specification in use
        faultString - a String giving an explanation of the fault
        Returns:
        the new SOAPFault object
        Throws:
        SOAPException - if there is a SOAP error
        See Also:
        SOAPFault.setFaultCode(jakarta.xml.soap.Name), SOAPFault.setFaultString(java.lang.String), SOAPBody.addFault(Name faultCode, String faultString)
      • hasFault

        public boolean hasFault()
        Description copied from interface: SOAPBody
        Indicates whether a SOAPFault object exists in this SOAPBody object.
        Specified by:
        hasFault in interface SOAPBody
        Returns:
        true if a SOAPFault object exists in this SOAPBody object; false otherwise
      • getFault

        public SOAPFault getFault()
        Description copied from interface: SOAPBody
        Returns the SOAPFault object in this SOAPBody object.
        Specified by:
        getFault in interface SOAPBody
        Returns:
        the SOAPFault object in this SOAPBody object if present, null otherwise.
      • addDocument

        public SOAPBodyElement addDocument​(Document document)
                                    throws SOAPException
        Description copied from interface: SOAPBody
        Adds the root node of the DOM Document to this SOAPBody object.

        Calling this method invalidates the document parameter. The client application should discard all references to this Document and its contents upon calling addDocument. The behavior of an application that continues to use such references is undefined.

        Specified by:
        addDocument in interface SOAPBody
        Parameters:
        document - the Document object whose root node will be added to this SOAPBody.
        Returns:
        the SOAPBodyElement that represents the root node that was added.
        Throws:
        SOAPException - if the Document cannot be added
      • setElementQName

        public SOAPElement setElementQName​(QName newName)
                                    throws SOAPException
        Description copied from interface: SOAPElement
        Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.

        Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.

        Specified by:
        setElementQName in interface SOAPElement
        Overrides:
        setElementQName in class ElementImpl
        Parameters:
        newName - the new name for the Element.
        Returns:
        The renamed Node
        Throws:
        SOAPException - if changing the name of this Element is not allowed.
      • extractContentAsDocument

        public Document extractContentAsDocument()
                                          throws SOAPException
        Description copied from interface: SOAPBody
        Creates a new DOM Document and sets the first child of this SOAPBody as it's document element. The child SOAPElement is removed as part of the process.
        Specified by:
        extractContentAsDocument in interface SOAPBody
        Returns:
        the Document representation of the SOAPBody content.
        Throws:
        SOAPException - if there is not exactly one child SOAPElement of the SOAPBody.
      • getFirstChildNoMaterialize

        public Node getFirstChildNoMaterialize()
      • isLazy

        public boolean isLazy()