Classes | |
class | sptk::NotEmptyString |
String that should always contain non-empty string. More... | |
class | sptk::WSProtocol |
Abstract base class for different protocols used in Web Service servers. More... | |
class | sptk::WSStaticHttpProtocol |
Handler for static files (.html, .js, .png, etc) More... | |
class | sptk::WSWebServiceProtocol |
class | sptk::WSWebSocketsMessage |
class | sptk::WSWebSocketsProtocol |
class | sptk::WSNotification |
class | sptk::WSNotificationManager |
class | sptk::SourceModule |
Helper module to generate source files. More... | |
class | sptk::WSComplexType |
class | sptk::WSListener |
struct | sptk::WSOperation |
class | sptk::WSParser |
class | sptk::WSParserAttribute |
class | sptk::WSParserComplexType |
class | sptk::WSNameSpace |
class | sptk::WSRequest |
class | sptk::WSType |
class | sptk::WSTypeTranslator |
Typedefs | |
using | sptk::WSOperationMap = std::map< String, WSOperation > |
using | sptk::SWSParserAttribute = std::shared_ptr< WSParserAttribute > |
using | sptk::SWSParserComplexType = std::shared_ptr< WSParserComplexType > |
using | sptk::WSParserComplexTypeList = std::list< SWSParserComplexType > |
using | sptk::WSParserElement = WSParserComplexType |
using | sptk::WSComplexTypeMap = std::map< String, SWSParserComplexType > |
using | sptk::WSRequest::RequestMethod = std::function< void(const sptk::xdoc::SNode &, const sptk::xdoc::SNode &, sptk::HttpAuthentication *, const sptk::WSNameSpace &)> |
using | sptk::SWSRequest = std::shared_ptr< WSRequest > |
Enumerations | |
enum class | OpCode : uint8_t { CONTINUATION = 0 , TEXT = 1 , BINARY = 2 , CONNECTION_CLOSE = 8 , PING1 = 9 , PING2 = 10 } |
enum class | sptk::WSMultiplicity : uint8_t { WSMultiplicity::REQUIRED = 1 , WSMultiplicity::ZERO_OR_ONE = 2 , WSMultiplicity::ZERO_OR_MORE = 4 , WSMultiplicity::ONE_OR_MORE = 8 } |
Functions | |
sptk::NotEmptyString::NotEmptyString (std::string other) | |
sptk::NotEmptyString::NotEmptyString (const NotEmptyString &other) | |
NotEmptyString & | sptk::NotEmptyString::operator= (const NotEmptyString &other) |
sptk::WSWebSocketsMessage::WSWebSocketsMessage ()=default | |
Default constructor. | |
const Buffer & | sptk::WSWebSocketsMessage::payload () const |
Return message payload buffer. | |
void | sptk::WSWebSocketsMessage::decode (const char *incomingData) |
static void | sptk::WSWebSocketsMessage::encode (const String &payload, OpCode opcode, bool finalMessage, Buffer &output) |
OpCode | sptk::WSWebSocketsMessage::opcode () const |
Get operation code. | |
void | sptk::WSWebSocketsMessage::opcode (OpCode code) |
Set operation code. | |
uint32_t | sptk::WSWebSocketsMessage::statusCode () const |
Operation status code. | |
bool | sptk::WSWebSocketsMessage::isFinal () const |
'message is final' flag | |
sptk::WSWebSocketsProtocol::WSWebSocketsProtocol (TCPSocket *socket, const HttpHeaders &headers) | |
RequestInfo | sptk::WSWebSocketsProtocol::process () override |
void | sptk::WSWebSocketsProtocol::replyCloseConnectionRequest (uint16_t statusCode, const String &closeReason) |
sptk::WSNameSpace::WSNameSpace (const String &alias="", const String &location="") | |
sptk::WSNameSpace::WSNameSpace (const WSNameSpace &other) | |
sptk::WSNameSpace::~WSNameSpace () noexcept=default | |
WSNameSpace & | sptk::WSNameSpace::operator= (const WSNameSpace &other) |
String | sptk::WSNameSpace::getAlias () const |
String | sptk::WSNameSpace::getLocation () const |
sptk::WSRequest::WSRequest (sptk::LogEngine *logEngine=nullptr) | |
virtual | sptk::WSRequest::~WSRequest ()=default |
void | sptk::WSRequest::processRequest (const xdoc::SNode &xmlContent, const xdoc::SNode &jsonContent, HttpAuthentication *authentication, String &requestName) |
virtual String | sptk::WSRequest::title () const |
virtual String | sptk::WSRequest::defaultPage () const |
virtual String | sptk::WSRequest::wsdl () const |
static String | sptk::WSRequest::tagName (const String &nodeName) |
static String | sptk::WSRequest::nameSpace (const String &nodeName) |
sptk::LogEngine * | sptk::WSRequest::getLogEngine () |
virtual void | sptk::WSRequest::requestBroker (const String &requestName, const xdoc::SNode &xmlContent, const xdoc::SNode &jsonContent, HttpAuthentication *authentication, const WSNameSpace &requestNameSpace) |
virtual void | sptk::WSRequest::handleError (const xdoc::SNode &xmlContent, const xdoc::SNode &jsonContent, const sptk::String &error, int errorCode) const |
virtual void | sptk::WSRequest::logError (const sptk::String &requestName, const sptk::String &error, int errorCode) const |
xdoc::SNode | sptk::WSRequest::findSoapBody (const xdoc::SNode &soapEnvelope, const WSNameSpace &soapNamespace) |
void | sptk::WSRequest::setRequestMethods (std::map< sptk::String, RequestMethod > &&requestMethods) |
sptk::WSType::WSType ()=default | |
sptk::WSType::WSType (const char *name) | |
sptk::WSType::WSType (const WSType &)=default | |
sptk::WSType::WSType (WSType &&) noexcept=default | |
WSType & | sptk::WSType::operator= (const WSType &) |
WSType & | sptk::WSType::operator= (WSType &&) noexcept |
virtual String | sptk::WSType::className () const |
virtual String | sptk::WSType::name () const |
virtual void | sptk::WSType::owaspCheck (const String &value) |
virtual void | sptk::WSType::clear ()=0 |
virtual void | sptk::WSType::load (const xdoc::SNode &attr, bool nullLargeData=false)=0 |
virtual String | sptk::WSType::asString () const |
virtual bool | sptk::WSType::isNull () const =0 |
virtual void | sptk::WSType::exportTo (const xdoc::SNode &parent, const char *name=nullptr) const =0 |
Variables | |
const std::map< String, String > | sptk::WSNotification::m_headers |
String | sptk::WSNotification::m_data |
const WSTypeTranslator | sptk::wsTypeTranslator |
using sptk::WSComplexTypeMap = typedef std::map<String, SWSParserComplexType> |
Map of complex type names to complex type objects
using sptk::WSOperationMap = typedef std::map<String, WSOperation> |
Map of operation names to operation objects
using sptk::WSParserElement = typedef WSParserComplexType |
Alias for WSDL complex type
|
strong |
|
inlinevirtual |
Conversion to string
Reimplemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSDateTime.
|
inlinevirtual |
Get WS type name
Reimplemented in sptk::WSArray< T >, sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, sptk::WSInteger, and sptk::WSComplexType.
|
pure virtual |
Clears content (sets to NULL)
Implemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSComplexType.
Referenced by sptk::WSComplexType::_clear().
void sptk::WSWebSocketsMessage::decode | ( | const char * | incomingData | ) |
Decode incoming data into message payload
incomingData | Incoming data received from WebSockets |
|
inlinevirtual |
Returns service default HTML page
Application should overwrite this method to return mor appropriate text
|
static |
Encode a payload into WebSockets frame
payload | Message to encode |
opcode | WebSockets operation code |
finalMessage | 'message is final' flag |
output | WebSockets frame, ready to send |
|
pure virtual |
Unload data to new XML node
parent | Parent XML node where new node is created |
name | Optional name for the child element |
Implemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSComplexType.
|
protected |
Find SOAP body node
soapEnvelope |
|
inline |
Get namespace alias
|
inline |
Get namespace location
|
protectedvirtual |
Default error handling
Forms server response in case of error. The response should contain error information.
xmlContent | Incoming XML request, or nullptr if JSON |
jsonContent | Incoming JSON request, or nullptr if XML |
error | Error description |
errorCode | Optional HTTP error code, or 0 |
|
pure virtual |
Implemented in sptk::WSComplexType.
|
pure virtual |
Loads type data from request XML node
attr | XML node |
nullLargeData | Set null for elements with data size > 256 bytes |
Implemented in sptk::WSBasicType, sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, sptk::WSInteger, sptk::WSComplexType, and sptk::WSArray< T >.
|
protectedvirtual |
Default error logging
Logs error information to default logger.
requestName | Request name |
error | Error description |
errorCode | Optional HTTP error code, or 0 |
|
inline |
Assignment
other | Other namespace |
|
overridevirtual |
void sptk::WSRequest::processRequest | ( | const xdoc::SNode & | xmlContent, |
const xdoc::SNode & | jsonContent, | ||
HttpAuthentication * | authentication, | ||
String & | requestName | ||
) |
Processes incoming requests
The processing results are stored in the same request XML
xmlContent | Incoming request and outgoing response |
|
protectedvirtual |
Internal SOAP body processor
Receives incoming SOAP body of Web Service requests, and returns application response. This method is abstract and overwritten in derived generated classes.
xmlContent | Incoming and outgoing SOAP element |
authentication | Optional setRequestMethods(move(requestMethods));HTTP authentication |
requestNameSpace | Request SOAP element namespace |
|
inlinevirtual |
Returns service title (for service handshake)
Application should overwrite this method to return mor appropriate text
|
inlinevirtual |
Constructor
alias | Namespace alias |
location | Namespace location |
|
inline |
Constructor
other | Other namespace |
|
inlineexplicit |
Constructor
logEngine | Optional log engine for error messages |
|
default |
Constructor
|
inlineexplicit |
Constructor
name | WSDL element name |
sptk::WSWebSocketsProtocol::WSWebSocketsProtocol | ( | TCPSocket * | socket, |
const HttpHeaders & | headers | ||
) |
Constructor
socket | TCPSocket*, Connection socket |
headers | const std::map<String,String>&, Connection HTTP headers |
|
defaultnoexcept |
Destructor
|
virtualdefault |
Destructor
|
extern |
Global WSDL translation object