Class PayloadUtils
- java.lang.Object
-
- org.wso2.carbon.connector.core.util.PayloadUtils
-
public final class PayloadUtils extends Object
Utils for setting content as the message payload in the message context
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
handleSpecialProperties(String contentType, org.apache.axis2.context.MessageContext axis2MessageCtx)
Changes the content type and handles other headersstatic void
preparePayload(org.apache.axis2.context.MessageContext messageContext, String xmlString)
Converts the XML String to XML Element and sets in message contextstatic void
setContent(org.apache.axis2.context.MessageContext messageContext, InputStream inputStream, String contentType)
Builds content according to the content type and set in the message bodystatic void
setPayloadInEnvelope(org.apache.axis2.context.MessageContext axis2MsgCtx, org.apache.axiom.om.OMElement payload)
Sets the OMElement in the message context
-
-
-
Method Detail
-
setContent
public static void setContent(org.apache.axis2.context.MessageContext messageContext, InputStream inputStream, String contentType) throws ContentBuilderException
Builds content according to the content type and set in the message body- Parameters:
messageContext
- Axis2 Message ContextinputStream
- Content to be built as an input streamcontentType
- Content Type of the content to be set in the payload- Throws:
ContentBuilderException
- if failed to build the content
-
handleSpecialProperties
public static void handleSpecialProperties(String contentType, org.apache.axis2.context.MessageContext axis2MessageCtx)
Changes the content type and handles other headers- Parameters:
contentType
- ContentType to be set in headeraxis2MessageCtx
- Axis2 Message Context
-
preparePayload
public static void preparePayload(org.apache.axis2.context.MessageContext messageContext, String xmlString) throws ContentBuilderException
Converts the XML String to XML Element and sets in message context- Parameters:
messageContext
- Axis2 Message ContextxmlString
- XML String to be set in the body- Throws:
ContentBuilderException
-
setPayloadInEnvelope
public static void setPayloadInEnvelope(org.apache.axis2.context.MessageContext axis2MsgCtx, org.apache.axiom.om.OMElement payload) throws ContentBuilderException
Sets the OMElement in the message context- Parameters:
axis2MsgCtx
- Axis2 Message Contextpayload
- OMElement to be set in the body- Throws:
ContentBuilderException
- if failed to set payload
-
-