Class SoapUtil

  • All Implemented Interfaces:

    
    public class SoapUtil
    
                        

    SOAP utility functions.

    • Constructor Detail

    • Method Detail

      • setBody

         <T> void setBody(T element, SoapMessage dest)

        Stores element in destined SOAP body.

        Parameters:
        element - element to store in dest.
        dest - SOAP message to store element in.
      • getBody

         <T> Optional<T> getBody(SoapMessage src, Class<T> destType)

        Tries to retrieve SOAP body element from SoapMessage.

        Parameters:
        src - the source message.
        destType - type of first element in body.
        Returns:

        an instance of T, or empty if conversion fails.

      • createUriFromUuid

         String createUriFromUuid(UUID uuid)

        Creates a URI representation of a UUID.

        Parameters:
        uuid - the UUID to convert.
        Returns:

        a UUID URN.

      • createUuidFromUri

         UUID createUuidFromUri(String uri)

        Converts from a URI to a UUID.

        Parameters:
        uri - the URI to convert.
        Returns:

        the converted UUID.

      • determineRequestDistinguishedName

        @Nullable() String determineRequestDistinguishedName(RequestResponseObject requestResponseObject)

        Determines the caller's distinguished name based on the given request-response object.

        The string is using the format defined in RFC 2253.

        Parameters:
        requestResponseObject - the request-response object containing the communication context.
        Returns:

        the caller's distinguished name, or null if no X509 certificate is found in the transport info.

      • setWsaAction

         void setWsaAction(SoapMessage response, String action)

        Takes a response message and sets the WS-Addressing action header.

        Parameters:
        response - the SOAP response message.
        action - the action to put to the response message.
      • createMessage

         SoapMessage createMessage(Envelope envelope)

        Creates a SOAP message with the given envelope.

        Parameters:
        envelope - the envelope to put to the SOAP message.
        Returns:

        a new SOAP message.

      • createMessage

         SoapMessage createMessage(String wsaAction)

        Creates a SOAP message with a specific action and empty body.

        Parameters:
        wsaAction - the action header to set.
        Returns:

        a new SOAP message.

      • createMessage

         SoapMessage createMessage(String wsaAction, @Nullable() Object firstBodyElement)

        Creates a SOAP message with a specific action and first body element.

        Parameters:
        wsaAction - the action header to set.
        firstBodyElement - the first child of the body element.
        Returns:

        a new SOAP message.

      • createMessage

         SoapMessage createMessage(String wsaAction, String wsaTo)

        Creates a SOAP message with a specific action and to element.

        Parameters:
        wsaAction - the action header to set.
        wsaTo - the to header to set.
        Returns:

        a new SOAP message.

      • createMessage

         SoapMessage createMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement)

        Creates a SOAP message with a specific action, to and first body element.

        Parameters:
        wsaAction - the action header to set.
        wsaTo - the to header to set.
        firstBodyElement - the first child of the body element.
        Returns:

        a new SOAP message.

      • createMessage

         SoapMessage createMessage(String wsaAction, String wsaTo, @Nullable() Object firstBodyElement, @Nullable() ReferenceParametersType referenceParameters)

        Creates a SOAP message with a specific action, to, the first body element as well as reference parameters.

        Parameters:
        wsaAction - the action header to set.
        wsaTo - the to header to set.
        firstBodyElement - the first child of the body element.
        referenceParameters - reference parameters to attach to the message.
        Returns:

        a new SOAP message.