#include <rwsf/webservice/MessageAttachment.h>
In generated code, rwsf represents any message parts specified in a WSDL with 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.
MessageAttachment ();
Default constructor. The message is assigned a default unique Content-ID header, and a Content-Type of "application/binary."
MessageAttachment ( const std::string& uid, const std::string& ct = "application/binary" );
Constructs a MessageAttachment with the specified uid and Content-Type. The uid should be in the form of a URL. If the URL is of the cid URL scheme, a Content-ID header will be associated with that value, otherwise a Content-Location is used.
Parameters:
uid |
unique ID for this attachment instance |
ct |
any Content-Type header value specified by MIME |
std::string getContentId () const;
Returns the Content-Id for this attachment. If it is not present, returns a null string.
std::string getContentLocation () const;
Returns the Content-Location for this attachment. If it is not present, returns a null string.
std::string getContentType () const;
Returns the Content-Type for this attachment. If it is not present, returns a null string.
std::string getHeader(const std::string& name) const;
Returns the first header with the given name.
std::string getPayload () const;
Returns the attachment's payload as a std::string.
static std::string getUniqueContentId ( void* base );
Returns a Unique identifier for this attachment
std::string 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.
const rwsf::MimeHeaders& headers() const; rwsf::MimeHeaders& headers();
Returns a reference to the data structure that holds the headers for this instance.
void setContentId ( const std::string& ci );
Sets the Content-Id ci header for this instance. If a Content-ID header is already present, it will be replaced.
Note: A Content-ID header value should take the form of "<" + unique identifier + ">".
void setContentLocation ( const std::string& cl );
Sets the Content-Location cl 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.
void setContentType ( const std::string& ct );
Sets the Content-Type ct. If a Content-Type header is already present, it is replaced.
void setPayload ( const std::string& payload );
Sets the payload.
void 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 will be associated with that value, otherwise a Content-Location header will be used.
MessageAttachment& operator=(const MessageAttachment& m);
Assignment Operator.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.