UPnP::Envelope Class Reference
Class to manage a SOAP envelope for service request/response. More...
#include <Envelope.h>
Collaboration diagram for UPnP::Envelope:
Classes | |
class | Fault |
Public Types | |
enum class | ContentType { none , fault , request , response } |
Public Member Functions | |
Envelope (const Service &service) | |
void | clear () |
Wipe the envelope contents. More... | |
bool | isEmpty () const |
bool | isFault () const |
String | serialize (bool pretty) |
Obtain content as XML string. More... | |
size_t | serialize (Print &p, bool pretty) |
Serialize XML content to a stream. More... | |
ContentType | contentType () const |
Get the current envelope content type. More... | |
String | actionName () const |
Get the action name. More... | |
Envelope & | createRequest (const String &actionName) |
Initialise the envelope as a request. More... | |
Envelope & | createResponse (const String &actionName) |
Initialise the envelope as a response. More... | |
void | convertToResponse () |
Set a flag that this should be converted to Response on next setArg() call. More... | |
void | prepareResponse () |
If Response is required but hasn't been prepared yet, do it now. This wipes out the incoming request. More... | |
Fault | createFault (ErrorCode error) |
Initialise the envelope as a fault. More... | |
String | soapAction () const |
Error | load (String &&content) |
Load a SOAP document. More... | |
Error | load (const FlashString &content) |
Fetch fault object | |
Fault | fault () |
const Fault | fault () const |
Argument getters | |
const char * | getArgValue (const String &name) const |
String | getArg (const String &name) const |
bool | getArg (const String &name, char &value, char defaultValue='?') |
bool | getArg (const String &name, String &value) |
template<typename T > | |
std::enable_if< std::is_unsigned< T >::value &&!std::is_floating_point< T >::value, bool >::type | getArg (const String &name, T &value, T defaultValue=T{}) |
template<typename T > | |
std::enable_if< std::is_signed< T >::value &&!std::is_floating_point< T >::value, bool >::type | getArg (const String &name, T &value, T defaultValue=T{}) |
bool | getArg (const String &name, bool &value, bool defaultValue=false) |
bool | getArg (const String &name, uint32_t &value, uint32_t defaultValue=0) |
bool | getArg (const String &name, int32_t &value, int32_t defaultValue=0) |
bool | getArg (const String &name, float &value, float defaultValue=0.0) |
bool | getArg (const String &name, double &value, double defaultValue=0.0) |
bool | getArg (const String &name, Base64 &value) |
Argument setters | |
bool | addArg (const String &name, const String &value) |
bool | addArg (const String &name, const char *value) |
bool | addArg (const String &name, bool value) |
bool | addArg (const String &name, const Base64 &value) |
template<typename T > | |
bool | addArg (const String &name, T value) |
Public Attributes | |
const Service & | service |
Detailed Description
Class to manage a SOAP envelope for service request/response.
Member Enumeration Documentation
◆ ContentType
|
strong |
Constructor & Destructor Documentation
◆ Envelope()
|
inline |
Member Function Documentation
◆ actionName()
|
inline |
Get the action name.
◆ addArg() [1/5]
|
inline |
◆ addArg() [2/5]
◆ addArg() [3/5]
|
inline |
◆ addArg() [4/5]
◆ addArg() [5/5]
template<typename T >
|
inline |
◆ clear()
void UPnP::Envelope::clear | ( | ) |
Wipe the envelope contents.
◆ contentType()
|
inline |
Get the current envelope content type.
◆ convertToResponse()
|
inline |
Set a flag that this should be converted to Response on next setArg() call.
◆ createFault()
◆ createRequest()
Initialise the envelope as a request.
◆ createResponse()
Initialise the envelope as a response.
◆ fault() [1/2]
|
inline |
◆ fault() [2/2]
|
inline |
◆ getArg() [1/11]
◆ getArg() [2/11]
◆ getArg() [3/11]
bool UPnP::Envelope::getArg | ( | const String & | name, |
bool & | value, | ||
bool | defaultValue = false |
||
) |
◆ getArg() [4/11]
|
inline |
◆ getArg() [5/11]
bool UPnP::Envelope::getArg | ( | const String & | name, |
double & | value, | ||
double | defaultValue = 0.0 |
||
) |
◆ getArg() [6/11]
bool UPnP::Envelope::getArg | ( | const String & | name, |
float & | value, | ||
float | defaultValue = 0.0 |
||
) |
◆ getArg() [7/11]
bool UPnP::Envelope::getArg | ( | const String & | name, |
int32_t & | value, | ||
int32_t | defaultValue = 0 |
||
) |
◆ getArg() [8/11]
◆ getArg() [9/11]
template<typename T >
|
inline |
◆ getArg() [10/11]
template<typename T >
|
inline |
◆ getArg() [11/11]
bool UPnP::Envelope::getArg | ( | const String & | name, |
uint32_t & | value, | ||
uint32_t | defaultValue = 0 |
||
) |
◆ getArgValue()
|
inline |
◆ isEmpty()
|
inline |
◆ isFault()
|
inline |
◆ load() [1/2]
Error UPnP::Envelope::load | ( | const FlashString & | content | ) |
◆ load() [2/2]
Load a SOAP document.
- Parameters
-
content MUST remain valid for the lifetime of this Envelope, or until initialise() is called.
◆ prepareResponse()
|
inline |
If Response is required but hasn't been prepared yet, do it now. This wipes out the incoming request.
◆ serialize() [1/2]
◆ serialize() [2/2]
|
inline |
Serialize XML content to a stream.
◆ soapAction()
String UPnP::Envelope::soapAction | ( | ) | const |
Member Data Documentation
◆ service
const Service& UPnP::Envelope::service |
The documentation for this class was generated from the following file: