Class MessageUtils


  • public class MessageUtils
    extends Object
    Class MessageUtils contains helper methods that are used to build the payload.
    • Constructor Detail

      • MessageUtils

        public MessageUtils()
    • Method Detail

      • buildMessage

        public static void buildMessage​(org.apache.axis2.context.MessageContext msgCtx)
                                 throws IOException
        Throws:
        IOException
      • buildMessage

        public static void buildMessage​(org.apache.axis2.context.MessageContext msgCtx,
                                        boolean earlyBuild)
                                 throws IOException
        Throws:
        IOException
      • getMIMEContentType

        public static String getMIMEContentType​(String contentType)
        Get MIME content type out of content-type header.
        Parameters:
        contentType - content type header value
        Returns:
        MIME content type
      • isEmptyPayloadStream

        public static boolean isEmptyPayloadStream​(InputStream inputStream)
                                            throws IOException
        Function to check given inputstream is empty or not Used to check whether content of the payload input stream is empty or not.
        Parameters:
        inputStream - target inputstream
        Returns:
        true if it is a empty stream
        Throws:
        IOException
      • getMessageFormatter

        public static org.apache.axis2.transport.MessageFormatter getMessageFormatter​(org.apache.axis2.context.MessageContext msgContext)
        This selects the formatter for a given message format based on the the content type of the received message. content-type to builder mapping can be specified through the Axis2.xml.
        Parameters:
        msgContext - axis2 MessageContext
        Returns:
        the formatter registered against the given content-type
      • getOMOutputFormat

        public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat​(org.apache.axis2.context.MessageContext msgContext)