Package org.apache.axis2.builder
Class BuilderUtil
java.lang.Object
org.apache.axis2.builder.BuilderUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.axiom.soap.SOAPEnvelopebuildsoapMessage(MessageContext messageContext, MultipleEntryHashMap requestParameterMap, org.apache.axiom.soap.SOAPFactory soapFactory) static org.apache.axiom.attachments.AttachmentscreateAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength) static org.apache.axiom.attachments.AttachmentscreateAttachmentsMap(MessageContext msgContext, InputStream inStream, String contentTypeString) static org.apache.axiom.om.OMXMLParserWrappercreatePOXBuilder(InputStream in, String encoding) Create a builder suitable for an XML message.static voidcreateSOAPMessageWithoutSchema(org.apache.axiom.soap.SOAPFactory soapFactory, org.apache.axiom.om.OMElement bodyFirstChild, MultipleEntryHashMap requestParameterMap) static org.apache.axiom.soap.SOAPModelBuildercreateSOAPModelBuilder(InputStream in, String encoding) Create a SOAP model builder.static BuildergetBuilderFromSelector(String type, MessageContext msgContext) Deprecated.static StringgetCharSetEncoding(PushbackInputStream is2, String defaultEncoding) 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.static StringgetCharSetEncoding(String contentType) Extracts and returns the character set encoding from the Content-type headerstatic StringgetEnvelopeNamespace(String contentType) static PushbackInputStreamDeprecated.If you need aPushbackInputStreamjust construct one (with the appropriate size).static ReadergetReader(InputStream is, String charSetEncoding) Deprecated.Instead of using this method, you should probably pass theInputStreamdirectly to the XML parser.static booleanisAttachmentsCacheEnabled(MessageContext msgContext) static voidvalidateCharSetEncoding(String charsetEncodingFromTransport, String charsetEncodingFromXML, String soapNamespaceURI) static voidvalidateSOAPVersion(String soapNamespaceURIFromTransport, org.apache.axiom.soap.SOAPEnvelope envelope)
-
Field Details
-
BOM_SIZE
public static final int BOM_SIZEDeprecated.- See Also:
-
-
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 usesStAXParserConfiguration.SOAPto disallow document type declarations (that potentially reference external entities).- Parameters:
in- the input stream containing the plain XML messageencoding- the charset encoding of the message ornullif the parser should determine the charset encoding- Returns:
- the builder
-
getReader
Deprecated.Instead of using this method, you should probably pass theInputStreamdirectly to the XML parser. If the stream is not XML, you shouldn't be using this method anyway.- Throws:
IOException
-
getPushbackInputStream
Deprecated.If you need aPushbackInputStreamjust 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 aReaderwhere you should use anInputStream.- Throws:
IOException
-
getEnvelopeNamespace
-
getCharSetEncoding
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
-
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 toOMXMLBuilderFactory.createSOAPModelBuilder(InputStream, String)but generates additional logging if an error occurs.- Parameters:
in- the input stream containing the SOAP messageencoding- the charset encoding of the SOAP message ornullif the parser should determine the charset encoding- Returns:
- the builder
-
getBuilderFromSelector
public static Builder getBuilderFromSelector(String type, MessageContext msgContext) throws AxisFault Deprecated.- 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
-
MessageProcessorSelector.getMessageBuilder(String, MessageContext).