Package org.citrusframework.ws.message
Class SoapMessage
java.lang.Object
org.citrusframework.message.DefaultMessage
org.citrusframework.ws.message.SoapMessage
- All Implemented Interfaces:
Serializable,Message
- Direct Known Subclasses:
SoapFault
SOAP message representation holding additional elements like SOAP action, header fragment data and
attachments.
- Since:
- 2.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor initializing with empty message payload.SoapMessage(Object payload) Default constructor using just message payload.SoapMessage(Object payload, Map<String, Object> headers) Default constructor using payload and headers.SoapMessage(Message message) Constructs copy of given message. -
Method Summary
Modifier and TypeMethodDescriptionSets the Http accepted content type header for response.addAttachment(SoapAttachment attachment) Adds new attachment to this message.addHeaderData(String headerData) contentType(String contentType) Sets the Http request content type header.Gets the list of message attachments.Gets the soap action for this message.Sets new header name value pair.booleanGets mtom attachments enabledmtomEnabled(boolean mtomEnabled) Enable or disable mtom attachmentsreasonPhrase(String reasonPhrase) Sets the Http response reason phrase header.soapAction(String soapAction) Set soap action for this message.status(org.springframework.http.HttpStatus statusCode) Sets the Http response status code.statusCode(Integer statusCode) Sets the Http response status code header.toString()Methods inherited from class org.citrusframework.message.DefaultMessage
getHeader, getHeaderData, getHeaders, getId, getName, getPayload, getPayload, getTimestamp, getType, removeHeader, setName, setPayload, setType, setType
-
Constructor Details
-
SoapMessage
public SoapMessage()Empty constructor initializing with empty message payload. -
SoapMessage
Constructs copy of given message.- Parameters:
message-
-
SoapMessage
Default constructor using just message payload.- Parameters:
payload-
-
SoapMessage
Default constructor using payload and headers.- Parameters:
payload-headers-
-
-
Method Details
-
header
Sets new header name value pair.- Parameters:
headerName-headerValue-- Returns:
-
setHeader
- Specified by:
setHeaderin interfaceMessage- Overrides:
setHeaderin classDefaultMessage
-
addHeaderData
- Specified by:
addHeaderDatain interfaceMessage- Overrides:
addHeaderDatain classDefaultMessage
-
contentType
Sets the Http request content type header.- Parameters:
contentType- The content type header value to use- Returns:
- The altered HttpMessage
-
accept
Sets the Http accepted content type header for response.- Parameters:
accept- The accept header value to set- Returns:
- The altered HttpMessage
-
status
Sets the Http response status code.- Parameters:
statusCode- The status code header to respond with- Returns:
- The altered HttpMessage
-
statusCode
Sets the Http response status code header.- Parameters:
statusCode- The status code header value to respond with- Returns:
- The altered HttpMessage
-
reasonPhrase
Sets the Http response reason phrase header.- Parameters:
reasonPhrase- The reason phrase header value to use- Returns:
- The altered HttpMessage
-
soapAction
Set soap action for this message.- Parameters:
soapAction-
-
mtomEnabled
Enable or disable mtom attachments- Parameters:
mtomEnabled-
-
addAttachment
Adds new attachment to this message.- Parameters:
attachment-
-
getSoapAction
Gets the soap action for this message.- Returns:
-
getAttachments
Gets the list of message attachments.- Returns:
-
isMtomEnabled
public boolean isMtomEnabled()Gets mtom attachments enabled- Returns:
-
toString
- Overrides:
toStringin classDefaultMessage
-