public interface ScriptMessageContext
extends org.apache.synapse.MessageContext
Modifier and Type | Method and Description |
---|---|
void |
addHeader(boolean mustUnderstand,
Object content)
Add a new SOAP header to the message.
|
Object |
getEnvelopeXML()
Get the XML representation of the complete SOAP envelope.
|
Object |
getJsonText()
Get the Message Payload as a text.
|
Object |
getPayloadJSON()
Get the JSON object representation of the JSON message body of the request.
|
String |
getPayloadText()
Get the Message Payload as a text.
|
Object |
getPayloadXML()
Get the XML representation of SOAP Body payload.
|
Object |
jsonObject(org.apache.synapse.MessageContext messageContext)
Get the JSON object representation of the JSON message body of the request.
|
void |
removeProperty(String key,
String scope)
Remove property from the message.
|
void |
setFaultTo(String reference)
This is used to set the value which specifies the receiver of the faults relating to the message.
|
void |
setFrom(String reference)
This is used to set the value which specifies the sender of the message.
|
boolean |
setJsonObject(org.apache.synapse.MessageContext messageContext,
Object jsonObject)
Saves the JavaScript Object to the message context.
|
boolean |
setJsonText(org.apache.synapse.MessageContext messageContext,
Object jsonObject)
Saves the JSON String to the message context.
|
void |
setPayloadJSON(Object jsonPayload)
Saves the payload of this message context as a JSON payload.
|
void |
setPayloadXML(Object payload)
Set the SOAP body payload from XML.
|
void |
setProperty(String key,
Object value,
String scope)
Add a new property to the message.
|
void |
setReplyTo(String reference)
This is used to set the value which specifies the receiver of the replies to the message.
|
void |
setScriptEngine(ScriptEngine scriptEngine)
Set a script engine.
|
void |
setTo(String reference)
This is used to set the value which specifies the receiver of the message.
|
getConfiguration, getContextEntries, getContinuationStateStack, getDefaultConfiguration, getEndpoint, getEntry, getEnvelope, getEnvironment, getFaultSequence, getFaultStack, getFaultTo, getFormat, getFrom, getLocalEntry, getMainSequence, getMessageFlowTracingState, getMessageID, getMessageString, getProperty, getPropertyKeySet, getRelatesTo, getReplyTo, getSequence, getSequenceTemplate, getServiceLog, getSoapAction, getTo, getTracingState, getWSAAction, getWSAMessageID, isContinuationEnabled, isDoingGET, isDoingMTOM, isDoingPOX, isDoingSWA, isFaultResponse, isResponse, isSOAP11, pushContinuationState, pushFaultHandler, setConfiguration, setContextEntries, setContinuationEnabled, setDoingGET, setDoingMTOM, setDoingPOX, setDoingSWA, setEnvelope, setEnvironment, setFaultResponse, setFaultTo, setFrom, setMessageFlowTracingState, setMessageID, setProperty, setRelatesTo, setReplyTo, setResponse, setSoapAction, setTo, setTracingState, setWSAAction, setWSAMessageID
Object getPayloadXML() throws ScriptException
ScriptException
- in-case of an error in getting
the XML representation of SOAP Body payloadvoid setPayloadXML(Object payload) throws org.apache.axiom.om.OMException, ScriptException
payload
- Message payloadScriptException
- For errors in converting xml To OMorg.apache.axiom.om.OMException
- For errors in OM manipulationObject getPayloadJSON()
Object getJsonText()
String getPayloadText()
boolean setJsonObject(org.apache.synapse.MessageContext messageContext, Object jsonObject)
messageContext
- The message context of the sequencejsonObject
- JavaScript Object which is passed to be saved in message contextboolean setJsonText(org.apache.synapse.MessageContext messageContext, Object jsonObject)
messageContext
- The message context of the sequencejsonObject
- JavaScript string which is passed to be saved in message contextObject jsonObject(org.apache.synapse.MessageContext messageContext)
void setScriptEngine(ScriptEngine scriptEngine)
scriptEngine
- a ScriptEngine instancevoid addHeader(boolean mustUnderstand, Object content) throws ScriptException
mustUnderstand
- the value for the soapenv:mustUnderstand
attributecontent
- the XML for the new headerScriptException
- if an error occurs when converting the XML to OMObject getEnvelopeXML() throws ScriptException
ScriptException
- in-case of an error in getting
the XML representation of SOAP envelopevoid setTo(String reference)
reference
- specifies the receiver of the messagevoid setFaultTo(String reference)
reference
- specifies the specifies the receiver of the faults relating to the messagevoid setFrom(String reference)
reference
- specifies the sender of the messagevoid setReplyTo(String reference)
reference
- specifies the receiver of the replies to the messagevoid setProperty(String key, Object value, String scope)
key
- unique identifier of propertyvalue
- value of propertyscope
- scope of the propertyvoid removeProperty(String key, String scope)
key
- unique identifier of propertyscope
- scope of the propertyvoid setPayloadJSON(Object jsonPayload) throws ScriptException
jsonPayload
- Javascript native object to be set as the message bodyScriptException
- in case of creating a JSON object out of
the javascript native object.Copyright © 2005–2024 Apache Software Foundation. All rights reserved.