HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::MessageAttachment Class Reference

Represents a MIME attachment in generated code. More...

#include <rwsf/webservice/MessageAttachment.h>

Public Member Functions

 MessageAttachment ()
 MessageAttachment (const MessageAttachment &m)
 MessageAttachment (const std::string &uid, const std::string &ct="application/binary")
std::string getContentId () const
std::string getContentLocation () const
std::string getContentType () const
std::string getPayload () const
std::string getUniqueId () const
rwsf::MimeHeadersheaders ()
const rwsf::MimeHeadersheaders () const
MessageAttachmentoperator= (const MessageAttachment &m)
void setContentId (const std::string &ci)
void setContentLocation (const std::string &cl)
void setContentType (const std::string &ct)
void setPayload (const std::string &payload)
void setUniqueId (const std::string &uid)

Detailed Description

In generated code, RWSF represents WSDL-defined message parts that have a Multipurpose Internet Mail Extensions (MIME) binding as type rwsf::MessageAttachment. This class encapsulates the message payload, its Content-Type, and any custom-defined Content-Id or Content-Location data.

Constructor & Destructor Documentation

◆ MessageAttachment() [1/3]

rwsf::MessageAttachment::MessageAttachment ( )

Default constructor. The message is assigned a default, unique Content-ID header, and a Content-Type of 'application/binary'.

◆ MessageAttachment() [2/3]

rwsf::MessageAttachment::MessageAttachment ( const std::string & uid,
const std::string & ct = "application/binary" )

Constructs a MessageAttachment with the specified Unique ID uid and Content-Type ct. The uid should be in the form of a URL. If the URL is of the cid scheme, a Content-ID header is associated with that value, otherwise a Content-Location is used.

◆ MessageAttachment() [3/3]

rwsf::MessageAttachment::MessageAttachment ( const MessageAttachment & m)

Copy constructor.

Member Function Documentation

◆ getContentId()

std::string rwsf::MessageAttachment::getContentId ( ) const

Gets the Content-ID header associated with this instance. If it is not present, a null string is returned.

◆ getContentLocation()

std::string rwsf::MessageAttachment::getContentLocation ( ) const

Gets the Content-Location header associated with this instance. If it is not present, a null string is returned.

◆ getContentType()

std::string rwsf::MessageAttachment::getContentType ( ) const

Gets the Content-Type header associated with this instance. If it is not present, a null string is returned.

◆ getPayload()

std::string rwsf::MessageAttachment::getPayload ( ) const

Gets the payload of the attachment.

◆ getUniqueId()

std::string rwsf::MessageAttachment::getUniqueId ( ) const

Returns the Unique ID for this instance. If a Content-ID header is present, it is used, otherwise the Content-Location header is used. If neither is present, an empty string is returned.

Note
If the Content-ID header is present, the returned string has cid: prepended to it.

◆ headers() [1/2]

rwsf::MimeHeaders & rwsf::MessageAttachment::headers ( )

Returns a reference to the data structure holding the headers for this instance.

◆ headers() [2/2]

const rwsf::MimeHeaders & rwsf::MessageAttachment::headers ( ) const

Returns a reference to the data structure holding the headers for this instance.

◆ operator=()

MessageAttachment & rwsf::MessageAttachment::operator= ( const MessageAttachment & m)

Assignment operator.

◆ setContentId()

void rwsf::MessageAttachment::setContentId ( const std::string & ci)

Sets the Content-ID header for this instance. If a Content-ID header is already present, it is replaced.

Note
A Content-ID header value should take the form of '<' + unique identifier + '>'.

◆ setContentLocation()

void rwsf::MessageAttachment::setContentLocation ( const std::string & cl)

Sets the Content-Location header for this instance. If a Content-Location header is already present, it will be replaced.

Note
A Content-Location header value should take the form of a URL.

◆ setContentType()

void rwsf::MessageAttachment::setContentType ( const std::string & ct)

Sets the Content-Type header for this instance. If a Content-Type header is already present, it is replaced.

◆ setPayload()

void rwsf::MessageAttachment::setPayload ( const std::string & payload)

Sets the payload of the attachment.

◆ setUniqueId()

void rwsf::MessageAttachment::setUniqueId ( const std::string & uid)

Sets the Unique ID for this instance. The uid specified should be in the form of a URL. If the URL is of a cid scheme, a Content-ID header is associated with that value, otherwise a Content-Location header is used.

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.