Class BuilderUtil

java.lang.Object
org.apache.axis2.builder.BuilderUtil

public class BuilderUtil extends Object
  • Field Details

  • Constructor Details

    • BuilderUtil

      public BuilderUtil()
  • Method Details

    • buildsoapMessage

      public static org.apache.axiom.soap.SOAPEnvelope buildsoapMessage(MessageContext messageContext, MultipleEntryHashMap requestParameterMap, org.apache.axiom.soap.SOAPFactory soapFactory) throws AxisFault
      Throws:
      AxisFault
    • createSOAPMessageWithoutSchema

      public static void createSOAPMessageWithoutSchema(org.apache.axiom.soap.SOAPFactory soapFactory, org.apache.axiom.om.OMElement bodyFirstChild, MultipleEntryHashMap requestParameterMap)
    • createPOXBuilder

      public static org.apache.axiom.om.OMXMLParserWrapper createPOXBuilder(InputStream in, String encoding)
      Create a builder suitable for an XML message. This method uses StAXParserConfiguration.SOAP to disallow document type declarations (that potentially reference external entities).
      Parameters:
      in - the input stream containing the plain XML message
      encoding - the charset encoding of the message or null if the parser should determine the charset encoding
      Returns:
      the builder
    • getReader

      public static Reader getReader(InputStream is, String charSetEncoding) throws IOException
      Deprecated.
      Instead of using this method, you should probably pass the InputStream directly to the XML parser. If the stream is not XML, you shouldn't be using this method anyway.
      Throws:
      IOException
    • getPushbackInputStream

      public static PushbackInputStream getPushbackInputStream(InputStream is)
      Deprecated.
      If you need a PushbackInputStream just construct one (with the appropriate size).
    • getCharSetEncoding

      public static String getCharSetEncoding(PushbackInputStream is2, String defaultEncoding) throws IOException
      Deprecated.
      It's the role of the XML parser to determine the charset encoding and/or byte order using the algorithm described in the "Autodetection of Character Encodings" appendix of the XML spec. If you need this method, then something is wrong: probably you are using a Reader where you should use an InputStream.
      Throws:
      IOException
    • getEnvelopeNamespace

      public static String getEnvelopeNamespace(String contentType)
    • getCharSetEncoding

      public static String getCharSetEncoding(String contentType)
      Extracts and returns the character set encoding from the Content-type header

      Example: "Content-Type: text/xml; charset=utf-8" would return "utf-8"

      Parameters:
      contentType - a content-type (from HTTP or MIME, for instance)
      Returns:
      the character set encoding if found, or MessageContext.DEFAULT_CHAR_SET_ENCODING
    • createAttachmentsMap

      public static org.apache.axiom.attachments.Attachments createAttachmentsMap(MessageContext msgContext, InputStream inStream, String contentTypeString)
    • isAttachmentsCacheEnabled

      public static boolean isAttachmentsCacheEnabled(MessageContext msgContext)
    • createAttachments

      public static org.apache.axiom.attachments.Attachments createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength)
    • createSOAPModelBuilder

      public static org.apache.axiom.soap.SOAPModelBuilder createSOAPModelBuilder(InputStream in, String encoding)
      Create a SOAP model builder. This method delegates to OMXMLBuilderFactory.createSOAPModelBuilder(InputStream, String) but generates additional logging if an error occurs.
      Parameters:
      in - the input stream containing the SOAP message
      encoding - the charset encoding of the SOAP message or null if the parser should determine the charset encoding
      Returns:
      the builder
    • getBuilderFromSelector

      public static Builder getBuilderFromSelector(String type, MessageContext msgContext) throws AxisFault
      Throws:
      AxisFault
    • validateSOAPVersion

      public static void validateSOAPVersion(String soapNamespaceURIFromTransport, org.apache.axiom.soap.SOAPEnvelope envelope)
    • validateCharSetEncoding

      public static void validateCharSetEncoding(String charsetEncodingFromTransport, String charsetEncodingFromXML, String soapNamespaceURI) throws AxisFault
      Throws:
      AxisFault