sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::WSWebServiceProtocol Class Reference

#include <WSWebServiceProtocol.h>

Inheritance diagram for sptk::WSWebServiceProtocol:
sptk::BaseWebServiceProtocol sptk::WSProtocol

Public Member Functions

 WSWebServiceProtocol (HttpReader &httpReader, const URL &url, WSServices &services, const Host &host, bool allowCORS, bool keepAlive, bool suppressHttpStatus)
 
RequestInfo process () override
 Process virtual method - to be implemented in derived classes. More...
 
void generateFault (Buffer &output, HttpResponseStatus &httpStatus, String &contentType, const HTTPException &e, bool jsonOutput) const override
 
- Public Member Functions inherited from sptk::BaseWebServiceProtocol
 BaseWebServiceProtocol (TCPSocket *socket, const HttpHeaders &headers, sptk::WSServices &services, const URL &url)
 
- Public Member Functions inherited from sptk::WSProtocol
 WSProtocol (TCPSocket *socket, const HttpHeaders &headers)
 
 WSProtocol (const WSProtocol &)=delete
 
virtual ~WSProtocol ()
 
WSProtocoloperator= (const WSProtocol &)=delete
 
virtual RequestInfo process ()=0
 Process virtual method - to be implemented in derived classes. More...
 

Protected Member Functions

std::shared_ptr< HttpAuthenticationgetAuthentication () override
 
- Protected Member Functions inherited from sptk::BaseWebServiceProtocol
virtual std::shared_ptr< HttpAuthenticationgetAuthentication ()=0
 
virtual void generateFault (Buffer &output, HttpResponseStatus &httpStatus, String &contentType, const HTTPException &e, bool jsonOutput) const =0
 
xdoc::SNode processXmlContent (const char *startOfMessage, const xdoc::SNode &xmlContent) const
 
void processJsonContent (const char *startOfMessage, const xdoc::SNode &jsonContent, RequestInfo &requestInfo, HttpResponseStatus &httpStatus, String &contentType) const
 
String processMessage (Buffer &output, const xdoc::SNode &xmlContent, const xdoc::SNode &jsonContent, const SHttpAuthentication &authentication, bool requestIsJSON, HttpResponseStatus &httpResponseStatus, String &contentType) const
 
- Protected Member Functions inherited from sptk::WSProtocol
TCPSocketsocket ()
 
HttpHeaders & headers ()
 
String header (const sptk::String &name)
 

Additional Inherited Members

- Static Protected Member Functions inherited from sptk::BaseWebServiceProtocol
static void RESTtoSOAP (const URL &url, const char *startOfMessage, const xdoc::SNode &message)
 
static xdoc::SNode findRequestNode (const xdoc::SNode &message, const String &messageType)
 
- Protected Attributes inherited from sptk::BaseWebServiceProtocol
WSServicesm_services
 
const URL m_url
 

Detailed Description

WebService connection handler

Uses WSRequest service object to parse WS request and reply, then closes connection.

Constructor & Destructor Documentation

◆ WSWebServiceProtocol()

sptk::WSWebServiceProtocol::WSWebServiceProtocol ( HttpReader httpReader,
const URL url,
WSServices services,
const Host host,
bool  allowCORS,
bool  keepAlive,
bool  suppressHttpStatus 
)

Constructor

Parameters
httpReaderConnection socket
urlMethod URL
headersConnection HTTP headers
serviceServices that handle request
hostListener's hostname
portListener's port
allowCORSAllow CORS
keepAliveKeep alive

Member Function Documentation

◆ generateFault()

void sptk::WSWebServiceProtocol::generateFault ( Buffer output,
HttpResponseStatus httpStatus,
String contentType,
const HTTPException e,
bool  jsonOutput 
) const
overridevirtual

◆ getAuthentication()

std::shared_ptr< HttpAuthentication > sptk::WSWebServiceProtocol::getAuthentication ( )
overrideprotectedvirtual

◆ process()

RequestInfo sptk::WSWebServiceProtocol::process ( )
overridevirtual

Process virtual method - to be implemented in derived classes.

Implements sptk::WSProtocol.


The documentation for this class was generated from the following file:

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