Package org.apache.axis2.kernel.http
Class MultipartFormDataFormatter
java.lang.Object
org.apache.axis2.kernel.http.MultipartFormDataFormatter
- All Implemented Interfaces:
MessageFormatter
Formates the request message as multipart/form-data. An example of this serialization is shown
below which was extracted from the Web Services Description Language (WSDL) Version 2.0 Part 2: Adjuncts
The following instance data of an input message:
Fréjus
France
@@@@-@@-@@
with the following operation element
<operation ref='t:data'
whttp:location='temperature'
whttp:method='POST'
whttp:inputSerialization='multipart/form-data'/>
will serialize the message as follow:
Content-Type: multipart/form-data; boundary=AaB03x
Content-Length: xxx
--AaB03x
Content-Disposition: form-data; name="town"
Content-Type: application/xml
Fréjus
France
--AaB03x
Content-Disposition: form-data; name="date"
Content-Type: text/plain; charset=utf-8
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.axiom.mime.ContentTypestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatSOAPAction(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, String soapAction) getContentType(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, String soapAction) Different message formats can set their own content types Eg: JSONFormatter can set the content type as application/jsongetTargetAddress(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, URL targetURL) Some message formats may want to alter the target url.voidwriteTo(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, OutputStream outputStream, boolean preserve) To support deffered writing transports as in http chunking..Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.axis2.kernel.MessageFormatter
getDataSource
-
Field Details
-
DEFAULT_CONTENT_TYPE
public static final org.apache.axiom.mime.ContentType DEFAULT_CONTENT_TYPE -
DISPOSITION_TYPE
- See Also:
-
-
Constructor Details
-
MultipartFormDataFormatter
public MultipartFormDataFormatter()
-
-
Method Details
-
getContentType
public String getContentType(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, String soapAction) Different message formats can set their own content types Eg: JSONFormatter can set the content type as application/json- Specified by:
getContentTypein interfaceMessageFormatter- Parameters:
messageContext-format-soapAction-
-
getTargetAddress
public URL getTargetAddress(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, URL targetURL) throws AxisFault Some message formats may want to alter the target url.- Specified by:
getTargetAddressin interfaceMessageFormatter- Returns:
- the target URL
- Throws:
AxisFault
-
formatSOAPAction
public String formatSOAPAction(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, String soapAction) - Specified by:
formatSOAPActionin interfaceMessageFormatter- Returns:
- this only if you want set a transport header for SOAP Action
-
writeTo
public void writeTo(MessageContext messageContext, org.apache.axiom.om.OMOutputFormat format, OutputStream outputStream, boolean preserve) throws AxisFault Description copied from interface:MessageFormatterTo support deffered writing transports as in http chunking.. Axis2 was doing this for some time.. Preserve flag can be used to preserve the envelope for later use. This is usefull when implementing authentication machnisms like NTLM.- Specified by:
writeToin interfaceMessageFormatterpreserve- : do not consume the OM when this is set..- Throws:
AxisFault
-