sptk2 logo
SPTK Home Page
Classes | Typedefs | Enumerations | Functions | Variables
WSDL-related Classes

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)
 
NotEmptyStringsptk::NotEmptyString::operator= (const NotEmptyString &other)
 
 sptk::WSWebSocketsMessage::WSWebSocketsMessage ()=default
 Default constructor.
 
const Buffersptk::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
 
WSNameSpacesptk::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::LogEnginesptk::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
 
WSTypesptk::WSType::operator= (const WSType &)
 
WSTypesptk::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, Stringsptk::WSNotification::m_headers
 
String sptk::WSNotification::m_data
 
const WSTypeTranslator sptk::wsTypeTranslator
 

Detailed Description

Typedef Documentation

◆ WSComplexTypeMap

using sptk::WSComplexTypeMap = typedef std::map<String, SWSParserComplexType>

Map of complex type names to complex type objects

◆ WSOperationMap

using sptk::WSOperationMap = typedef std::map<String, WSOperation>

Map of operation names to operation objects

◆ WSParserElement

Alias for WSDL complex type

Enumeration Type Documentation

◆ WSMultiplicity

enum class sptk::WSMultiplicity : uint8_t
strong

Multiplicity flag

Enumerator
REQUIRED 

Element is required.

ZERO_OR_ONE 

Element is optional.

ZERO_OR_MORE 

Element may occur 0 or more times.

ONE_OR_MORE 

Element may occur one or more times.

Function Documentation

◆ asString()

virtual String sptk::WSType::asString ( ) const
inlinevirtual

Conversion to string

Reimplemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSDateTime.

◆ className()

virtual String sptk::WSType::className ( ) const
inlinevirtual

◆ clear()

virtual void sptk::WSType::clear ( )
pure virtual

Clears content (sets to NULL)

Implemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSComplexType.

Referenced by sptk::WSComplexType::_clear().

◆ decode()

void sptk::WSWebSocketsMessage::decode ( const char *  incomingData)

Decode incoming data into message payload

Parameters
incomingDataIncoming data received from WebSockets

◆ defaultPage()

virtual String sptk::WSRequest::defaultPage ( ) const
inlinevirtual

Returns service default HTML page

Application should overwrite this method to return mor appropriate text

◆ encode()

static void sptk::WSWebSocketsMessage::encode ( const String payload,
OpCode  opcode,
bool  finalMessage,
Buffer output 
)
static

Encode a payload into WebSockets frame

Parameters
payloadMessage to encode
opcodeWebSockets operation code
finalMessage'message is final' flag
outputWebSockets frame, ready to send

◆ exportTo()

virtual void sptk::WSType::exportTo ( const xdoc::SNode &  parent,
const char *  name = nullptr 
) const
pure virtual

Unload data to new XML node

Parameters
parentParent XML node where new node is created
nameOptional name for the child element

Implemented in sptk::WSArray< T >, sptk::WSBasicType, and sptk::WSComplexType.

◆ findSoapBody()

xdoc::SNode sptk::WSRequest::findSoapBody ( const xdoc::SNode &  soapEnvelope,
const WSNameSpace soapNamespace 
)
protected

Find SOAP body node

Parameters
soapEnvelope
Returns

◆ getAlias()

String sptk::WSNameSpace::getAlias ( ) const
inline

Get namespace alias

Returns
Namespace alias

◆ getLocation()

String sptk::WSNameSpace::getLocation ( ) const
inline

Get namespace location

Returns
Namespace location

◆ handleError()

virtual void sptk::WSRequest::handleError ( const xdoc::SNode &  xmlContent,
const xdoc::SNode &  jsonContent,
const sptk::String error,
int  errorCode 
) const
protectedvirtual

Default error handling

Forms server response in case of error. The response should contain error information.

Parameters
xmlContentIncoming XML request, or nullptr if JSON
jsonContentIncoming JSON request, or nullptr if XML
errorError description
errorCodeOptional HTTP error code, or 0

◆ isNull()

virtual bool sptk::WSType::isNull ( ) const
pure virtual

Implemented in sptk::WSComplexType.

◆ load()

virtual void sptk::WSType::load ( const xdoc::SNode &  attr,
bool  nullLargeData = false 
)
pure virtual

Loads type data from request XML node

Parameters
attrXML node
nullLargeDataSet 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 >.

◆ logError()

virtual void sptk::WSRequest::logError ( const sptk::String requestName,
const sptk::String error,
int  errorCode 
) const
protectedvirtual

Default error logging

Logs error information to default logger.

Parameters
requestNameRequest name
errorError description
errorCodeOptional HTTP error code, or 0

◆ operator=()

WSNameSpace & sptk::WSNameSpace::operator= ( const WSNameSpace other)
inline

Assignment

Parameters
otherOther namespace
Returns

◆ process()

RequestInfo sptk::WSWebSocketsProtocol::process ( )
overridevirtual

Process method

Implements WebSockets session

Implements sptk::WSProtocol.

◆ processRequest()

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

Parameters
xmlContentIncoming request and outgoing response

◆ requestBroker()

virtual void sptk::WSRequest::requestBroker ( const String requestName,
const xdoc::SNode &  xmlContent,
const xdoc::SNode &  jsonContent,
HttpAuthentication authentication,
const WSNameSpace requestNameSpace 
)
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.

Parameters
xmlContentIncoming and outgoing SOAP element
authenticationOptional setRequestMethods(move(requestMethods));HTTP authentication
requestNameSpaceRequest SOAP element namespace

◆ title()

virtual String sptk::WSRequest::title ( ) const
inlinevirtual

Returns service title (for service handshake)

Application should overwrite this method to return mor appropriate text

◆ wsdl()

virtual String sptk::WSRequest::wsdl ( ) const
inlinevirtual
Returns
service WSDL

◆ WSNameSpace() [1/2]

sptk::WSNameSpace::WSNameSpace ( const String alias = "",
const String location = "" 
)
inline

Constructor

Parameters
aliasNamespace alias
locationNamespace location

◆ WSNameSpace() [2/2]

sptk::WSNameSpace::WSNameSpace ( const WSNameSpace other)
inline

Constructor

Parameters
otherOther namespace

◆ WSRequest()

sptk::WSRequest::WSRequest ( sptk::LogEngine logEngine = nullptr)
inlineexplicit

Constructor

Parameters
logEngineOptional log engine for error messages

◆ WSType() [1/2]

sptk::WSType::WSType ( )
default

Constructor

◆ WSType() [2/2]

sptk::WSType::WSType ( const char *  name)
inlineexplicit

Constructor

Parameters
nameWSDL element name

◆ WSWebSocketsProtocol()

sptk::WSWebSocketsProtocol::WSWebSocketsProtocol ( TCPSocket socket,
const HttpHeaders &  headers 
)

Constructor

Parameters
socketTCPSocket*, Connection socket
headersconst std::map<String,String>&, Connection HTTP headers

◆ ~WSNameSpace()

sptk::WSNameSpace::~WSNameSpace ( )
defaultnoexcept

Destructor

◆ ~WSRequest()

virtual sptk::WSRequest::~WSRequest ( )
virtualdefault

Destructor

Variable Documentation

◆ wsTypeTranslator

const WSTypeTranslator sptk::wsTypeTranslator
extern

Global WSDL translation object


Fri Oct 14 2022 09:58:32: SPTK 5.4.1