Package be.ehealth.technicalconnector.ws.domain

# Class GenericResponse

java.lang.Object
be.ehealth.technicalconnector.ws.domain.GenericResponse

public class GenericResponse extends Object
This class contains all the information for the generic response.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GenericResponse(jakarta.xml.soap.SOAPMessage message)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `asNode()`
  Getter that returns the response as `Node`.
  `<T> T`
  `asObject(Class<T> clazz)`
  Obtain the response as Object.
  `Source`
  `asSource()`
  Getter that returns the response as `Source`.
  `String`
  `asString()`
  Getter that returns the response as `String`.
  `byte[]`
  `getAttachment(String cid)`
  Method to obtain an Attachement based on de swaref id
  `void`
  `getSOAPException()`
  Helper method that verifies if the `SOAPBody` contains a `SOAPFault`.
  `jakarta.xml.soap.SOAPMessage`
  `getSOAPMessage()`
  Getter that returns the original `SOAPMessage`.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GenericResponse

    public GenericResponse(jakarta.xml.soap.SOAPMessage message)

- ## Method Details

  - ### asNode

    public Node asNode() throws jakarta.xml.soap.SOAPException
    Getter that returns the response as `Node`.

    Warning:For obtaining the Attachement: the method getAttachement can be used.

    Throws:
      `jakarta.xml.soap.SOAPException`

  - ### asString

    public String asString() throws TechnicalConnectorException
    Getter that returns the response as `String`.

    Warning:For obtaining the Attachement: the method getAttachement can be used.

    Throws:
      `TechnicalConnectorException`

  - ### getSOAPMessage

    public jakarta.xml.soap.SOAPMessage getSOAPMessage()
    Getter that returns the original `SOAPMessage`.

  - ### asObject

    public <T> T asObject(Class<T> clazz) throws jakarta.xml.soap.SOAPException
    Obtain the response as Object.

    Warning: the object passed as parameter must be an JAXBObject with the @XmlRootElement annotation

    Throws:
      `jakarta.xml.soap.SOAPException`

  - ### getAttachment

    public byte[] getAttachment(String cid) throws jakarta.xml.soap.SOAPException
    Method to obtain an Attachement based on de swaref id
    Throws:
      `jakarta.xml.soap.SOAPException`

  - ### asSource

    public Source asSource() throws jakarta.xml.soap.SOAPException
    Getter that returns the response as `Source`.

    Warning:For obtaining the Attachement: the method getAttachement can be used.

    Throws:
      `jakarta.xml.soap.SOAPException`

  - ### getSOAPException

    public void getSOAPException() throws jakarta.xml.soap.SOAPException
    Helper method that verifies if the `SOAPBody` contains a `SOAPFault`.
    Throws:
      `jakarta.xml.soap.SOAPException`