4#ifndef _Stroika_Frameworks_UPnP_SOAP_Action_h_
5#define _Stroika_Frameworks_UPnP_SOAP_Action_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
13#include "Stroika/Foundation/Common/KeyValuePair.h"
14#include "Stroika/Foundation/Containers/Mapping.h"
15#include "Stroika/Foundation/Containers/Sequence.h"
16#include "Stroika/Foundation/Execution/Exceptions.h"
22#include "Stroika/Frameworks/WebServer/Message.h"
83 template <DataTypes::IValue T>
125 template <DataTypes::IValue T = String>
127 template <DataTypes::IValue T>
161 template <DataTypes::IValue T = String>
163 template <DataTypes::IValue T>
185 static constexpr unsigned int kInvalidArgs = 402;
186 static constexpr unsigned int kActionFailed = 501;
187 static constexpr unsigned int kArgumentValueInvalid = 600;
188 static constexpr unsigned int kArgumentValueOutOfRange = 601;
189 static constexpr unsigned int kOptionalActionNotImplemented = 602;
190 static constexpr unsigned int kOutOfMemory = 603;
191 static constexpr unsigned int kHumanInterventionRequired = 604;
192 static constexpr unsigned int kStringArgumentTooLong = 605;
211 bool operator== (
const ActionError&)
const =
default;
253 void DeSerialize (
const Foundation::Memory::BLOB& b, ActionResponse* response,
const WebService::SOAP::Options& options = {});
254 void DeSerialize (
const Foundation::Memory::BLOB& b, ActionError* error,
const WebService::SOAP::Options& options = {});
264 ActionResponse
Invoke (
const URI& controlURL,
const ActionRequest& request,
const WebService::SOAP::Options& options = {});
265 ActionResponse
Invoke (Foundation::IO::Network::Transfer::Connection::Ptr connection,
const URI& controlURL,
const ActionRequest& request,
266 const WebService::SOAP::Options& options = {});
280 void CheckRequest (
const ActionRequest& request,
const ServiceDescription& description);
String is like std::u32string, except it is much easier to use, often much more space efficient,...
A Mapping uniquely associates two elements: a key and a value (use Assocation to allow multiple value...
Exception<> is a replacement (subclass) for any std c++ exception class (e.g. the default 'std::excep...
An ActionError, thrown: Invoke throws the one a service answers with, and a HandleAction doAction thr...
variant< bool, uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t, float, double, Foundation::Characters::Character, String, Foundation::Time::Date, Foundation::Time::DateTime, Foundation::Time::TimeOfDay, Foundation::Memory::BLOB, Foundation::IO::Network::URI, Foundation::Common::GUID > Value
A value of any of UPnP's data types, as its C++ type (the table above) - for code that learns a value...
DataType
UPnP's data types - each named, as a service's description names it (Common::DefaultNames): ui2,...
Foundation::Memory::BLOB Serialize(const ActionRequest &request, const WebService::SOAP::Options &options={})
The SOAP message - its XML, UTF-8 - which sends it: a request, a response, or an error (a SOAP fault)
ActionResponse Invoke(const URI &controlURL, const ActionRequest &request, const WebService::SOAP::Options &options={})
Ask the service at controlURL to do request's action - and return its answer. Throws ActionException ...
Foundation::Containers::Sequence< Argument > Arguments
void DeSerialize(const Foundation::Memory::BLOB &b, ActionRequest *request, const WebService::SOAP::Options &options={})
The SOAP message read: what Serialize writes, and any other's. Throws DataExchange::BadFormatExceptio...
Foundation::Containers::Mapping< String, ActionHandler > ActionHandlers
A service's actions' handlers, each by its action's name - as its description names it.
void CheckRequest(const ActionRequest &request, const ServiceDescription &description)
Throws the ActionException a service answers request with if its description - its actions,...
void HandleAction(WebServer::Message &m, const String &serviceType, const ActionHandler &doAction, const WebService::SOAP::Options &options={})
Answer a control request, at the controlURL's route of the service of type serviceType: doAction's ou...
function< Arguments(const ActionRequest &)> ActionHandler
What a service does for a request for one of its actions: the action's out arguments - or,...
A service's answer to an ActionRequest, it having not done the action: why not (UPnP Device Architect...
nonvirtual String ToString() const
nonvirtual WebService::SOAP::Fault AsFault() const
As SOAP sends it: a Client fault, UPnPError, its detail a UPnPError element.
static constexpr unsigned int kInvalidAction
static optional< ActionError > FromFault(const WebService::SOAP::Fault &fault, const WebService::SOAP::Options &options={})
The UPnPError a SOAP fault's detail holds; nullopt if it holds none - the detail read with options' X...
A control point's request that a service do one of its actions.
nonvirtual String GetSOAPAction() const
nonvirtual String ToString() const
nonvirtual optional< T > LookupArgument(const String &name) const
nonvirtual optional< T > LookupArgument(const String &name, DataTypes::DataType dataType) const
The value of the argument called name, read as a T.
A service's answer to an ActionRequest, it having done the action: the action's out arguments.
nonvirtual optional< T > LookupArgument(const String &name, DataTypes::DataType dataType) const
The value of the argument called name, read as a T.
nonvirtual optional< T > LookupArgument(const String &name) const
nonvirtual String ToString() const
One of an action's arguments: its name, and its value as text, as UPnP writes it (DataTypes::ToText) ...
A service's description - its SCPD (UPnP Device Architecture 1.1, section 2.5): its actions,...
A call's answer, the method having not been done: why not (section 4.4) - sent in an HTTP response wh...
What SOAP must be told that has a sensible default - taken by Serialize and DeSerialize,...