Go to the documentation of this file.
52 explicit operator bool()
const
54 return envelope.isFault();
151 responsePrepared =
false;
180 const Fault
fault()
const
182 return Fault(*
const_cast<Envelope*
>(
this));
194 return node ? node->value() :
nullptr;
202 bool getArg(
const String& name,
char& value,
char defaultValue =
'?')
206 value = defaultValue;
220 template <
typename T>
221 typename std::enable_if<std::is_unsigned<T>::value && !std::is_floating_point<T>::value,
bool>::type
222 getArg(
const String& name, T& value, T defaultValue = T{})
225 if(!
getArg(name, n, defaultValue)) {
226 value = defaultValue;
234 template <
typename T>
235 typename std::enable_if<std::is_signed<T>::value && !std::is_floating_point<T>::value,
bool>::type
236 getArg(
const String& name, T& value, T defaultValue = T{})
240 value = defaultValue;
248 bool getArg(
const String& name,
bool& value,
bool defaultValue =
false);
249 bool getArg(
const String& name, uint32_t& value, uint32_t defaultValue = 0);
250 bool getArg(
const String& name, int32_t& value, int32_t defaultValue = 0);
251 bool getArg(
const String& name,
float& value,
float defaultValue = 0.0);
252 bool getArg(
const String& name,
double& value,
double defaultValue = 0.0);
281 return addArg(name, value ?
"1" :
"0");
289 template <
typename T>
bool addArg(
const String& name, T value)
302 Error verifyObjectType(
const String& objectType)
const;
311 bool responsePrepared{
false};
Error load(String &&content)
Load a SOAP document.
String getArg(const String &name) const
Definition: Envelope.h:214
Envelope & createResponse(const String &actionName)
Initialise the envelope as a response.
Node * getNode(Node *node, const char *path, const char *ns, size_t ns_len=0)
describes a counted string stored in flash memory
Definition: String.hpp:173
rapidxml::xml_node< char > Node
Definition: RapidXML.h:37
String serialize(bool pretty)
Obtain content as XML string.
Definition: Envelope.h:120
The String class.
Definition: WString.h:136
Definition: MPU6050.h:3440
String soapAction() const
Class to manage a SOAP envelope for service request/response.
Definition: Envelope.h:52
bool addArg(const String &name, const char *value)
Definition: Envelope.h:291
ErrorCode errorCode() const
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{})
Definition: Envelope.h:239
Fault createFault(ErrorCode error)
Initialise the envelope as a fault.
Error
Definition: Libraries/UPnP/src/include/Network/UPnP/Error.h:45
ContentType contentType() const
Get the current envelope content type.
Definition: Envelope.h:138
Fault fault()
Definition: Envelope.h:192
Represents any kind of device, including a root device.
Definition: UPnP/src/include/Network/UPnP/Service.h:46
String getValue(const Node *node, const char *name, size_t name_size, const char *ns=nullptr, size_t ns_size=0)
String errorDescription() const
bool isFault() const
Definition: Envelope.h:101
bool isEmpty() const
Definition: Envelope.h:96
void prepareResponse()
If Response is required but hasn't been prepared yet, do it now. This wipes out the incoming request.
Definition: Envelope.h:176
const char * getArgValue(const String &name) const
Definition: Envelope.h:208
Definition: WebConstants.h:71
String faultString() const
bool addArg(const String &name, const String &value)
Definition: Envelope.h:283
Definition: ActionRequest.h:24
size_t serialize(const Node &node, String &buffer, bool pretty=false)
Serialize XML text and append to string buffer.
Fault(Envelope &envelope)
Definition: Envelope.h:65
void clear()
Wipe the envelope contents.
Provides formatted output to stream.
Definition: Print.h:36
Node * appendNode(Node *parent, const char *name, const char *value=nullptr, size_t name_size=0, size_t value_size=0)
Append a child element with optional value.
String actionName() const
Get the action name.
Definition: Envelope.h:146
size_t printTo(Print &p) const
ErrorCode
Definition: ErrorCode.h:58
rapidxml::xml_document< char > Document
Definition: RapidXML.h:36
Definition: Envelope.h:62
void convertToResponse()
Set a flag that this should be converted to Response on next setArg() call.
Definition: Envelope.h:164
Envelope & createRequest(const String &actionName)
Initialise the envelope as a request.
Envelope(const Service &service)
Definition: Envelope.h:87
const Service & service
Definition: Envelope.h:315
String encode() const
Definition: Base64.h:92