Direct Known Subclasses:
ControlResponse

public class SOAPResponseextends HTTPResponse
Represents a SOAP (Simple Object Access Protocol) response message.

This class extends HTTPResponse to handle SOAP protocol responses used in UPnP control operations. It provides functionality for creating and parsing SOAP responses with proper XML formatting and envelope structure.

Key features:

  • SOAP envelope and body creation
  • XML content management
  • UTF-8 encoding support
  • HTTP response integration
  • Fault message handling

This class is used by UPnP devices to send action invocation responses to control points, enabling structured XML responses through SOAP messaging over HTTP.

  • Field Details

    • rootNode

      private Node rootNode
      /////////////////////////////////////////////
  • Constructor Details

    • SOAPResponse

      public SOAPResponse()
      Creates an empty response carrying a fresh SOAP envelope body.
    • SOAPResponse

      public SOAPResponse(HTTPResponse httpRes)
      Copies the connection state of an HTTP response, replacing its payload with an empty SOAP envelope.
      Parameters:
      httpRes - the response to copy the connection state from; its payload is discarded and replaced with an empty SOAP envelope
    • SOAPResponse

      public SOAPResponse(SOAPResponse soapRes)
      Adopts the envelope node of another SOAP response.
      Parameters:
      soapRes - the response whose envelope node is adopted, not copied, by this one
  • Method Details

    • setRootNode

      private void setRootNode(Node node)
      Sets the SOAP body's root node.
      Parameters:
      node - the new root node
    • getRootNode

      private Node getRootNode()
      The SOAP body's root node.
      Returns:
      the root node
    • setEnvelopeNode

      public void setEnvelopeNode(Node node)
      Set the SOAP envelope node.
      Parameters:
      node - the envelope node to set
    • getEnvelopeNode

      public Node getEnvelopeNode()
      Get the SOAP envelope node.
      Returns:
      the envelope node, or null if not set
    • getBodyNode

      public Node getBodyNode()
      Get the SOAP body node.
      Returns:
      the body node, or null if no envelope
    • getMethodResponseNode

      public Node getMethodResponseNode(String name)
      Get the method response node for the given name.
      Parameters:
      name - the method name
      Returns:
      the response node, or null if not found
    • getFaultNode

      public Node getFaultNode()
      Get the SOAP fault node.
      Returns:
      the fault node, or null if not found
    • getFaultCodeNode

      public Node getFaultCodeNode()
      Get the SOAP fault code node.
      Returns:
      the fault code node, or null if not found
    • getFaultStringNode

      public Node getFaultStringNode()
      Get the SOAP fault string node.
      Returns:
      the fault string node, or null if not found
    • getFaultActorNode

      public Node getFaultActorNode()
      Get the SOAP fault actor node.
      Returns:
      the fault actor node, or null if not found
    • getFaultDetailNode

      public Node getFaultDetailNode()
      Get the SOAP fault detail node.
      Returns:
      the fault detail node, or null if not found
    • getFaultCode

      public String getFaultCode()
      Get the SOAP fault code string.
      Returns:
      the fault code, or empty string if not found
    • getFaultString

      public String getFaultString()
      Get the SOAP fault string.
      Returns:
      the fault string, or empty string if not found
    • getFaultActor

      public String getFaultActor()
      Get the SOAP fault actor string.
      Returns:
      the fault actor, or empty string if not found
    • setContent

      public void setContent(Node node)
      Set the content from an XML node.
      Parameters:
      node - the XML node to set as content
    • print

      public void print()
      Writes the response to the debug log, as text or as its root element.
      Overrides:
      print in class HTTPResponse