sptk2 logo
SPTK Home Page
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
sptk::WSParser Class Reference

#include <WSParser.h>

Classes

class  ComplexTypeIndex
 

Public Types

using ElementMap = std::map< String, const WSParserElement * >
 
using XmlTypeMap = std::map< String, const xdoc::Node * >
 
using DocumentationMap = std::map< String, String >
 

Public Member Functions

 WSParser ()=default
 
 WSParser (const WSParser &other)=delete
 
 WSParser (WSParser &&other)=delete
 
virtual ~WSParser ()=default
 
WSParseroperator= (const WSParser &other)=delete
 
WSParseroperator= (WSParser &&other)=delete
 
void clear ()
 
void parse (const fs::path &wsdlFile)
 
void generate (const String &sourceDirectory=".", const String &headerFile="", const OpenApiGenerator::Options &options=OpenApiGenerator::Options(), bool verbose=false, const String &serviceNamespace="")
 
void generateWsdlCxx (const String &sourceDirectory, const String &headerFile, const fs::path &wsdlFileName) const
 
const Stringdescription () const
 

Static Public Member Functions

static String strip_namespace (const String &name)
 
static String get_namespace (const String &name)
 

Protected Member Functions

void parseElement (const xdoc::SNode &elementNode)
 
void parseComplexType (xdoc::SNode &complexTypeElement)
 
void parseOperation (const xdoc::SNode &operationNode)
 
void parseSchema (const xdoc::SNode &schemaElement)
 
void generateDefinition (const Strings &usedClasses, std::ostream &output)
 
void generateImplementation (std::ostream &output) const
 

Static Protected Member Functions

static void parseSimpleType (const xdoc::SNode &simpleTypeElement)
 

Detailed Description

Parser of WSDL files

Loads a WSDL file and converts it to a set of abstract classes that can be saved as C++ source files to a directory. The actual web service is built by deriving concrete classes from these abstract classes.

Member Typedef Documentation

◆ DocumentationMap

Map of operation names to operation objects

◆ ElementMap

Map of element names to element objects

◆ XmlTypeMap

using sptk::WSParser::XmlTypeMap = std::map<String, const xdoc::Node*>

Map of element names to corresponding WSDL (XML) elements

Constructor & Destructor Documentation

◆ WSParser()

sptk::WSParser::WSParser ( )
default

Constructor

◆ ~WSParser()

virtual sptk::WSParser::~WSParser ( )
virtualdefault

Destructor

Member Function Documentation

◆ clear()

void sptk::WSParser::clear ( )

Clears parsed data

◆ generate()

void sptk::WSParser::generate ( const String sourceDirectory = ".",
const String headerFile = "",
const OpenApiGenerator::Options options = OpenApiGenerator::Options(),
bool  verbose = false,
const String serviceNamespace = "" 
)

Stores parsed classes to files in source directory

Parameters
sourceDirectoryDirectory to store output classes
headerFileOptional header file to insert at the start of each generated file

◆ generateDefinition()

void sptk::WSParser::generateDefinition ( const Strings usedClasses,
std::ostream &  output 
)
protected

Generates service definition to output stream

Parameters
usedClassesList of this service complex types (classes)
outputOutput stream

◆ generateImplementation()

void sptk::WSParser::generateImplementation ( std::ostream &  output) const
protected

Generates service implementation to output stream

Parameters
outputOutput stream

◆ generateWsdlCxx()

void sptk::WSParser::generateWsdlCxx ( const String sourceDirectory,
const String headerFile,
const fs::path &  wsdlFileName 
) const

Stores WSDL to C++ file

Parameters
sourceDirectoryDirectory to store output files
headerFileOptional header file to insert at the start of each generated file
wsdlFileNameWSDL content

◆ get_namespace()

static String sptk::WSParser::get_namespace ( const String name)
static

Utility function that returns namespace from the element name

Parameters
nameElement name

◆ parse()

void sptk::WSParser::parse ( const fs::path &  wsdlFile)

Loads WSDL-file and parses it to output classes

Parameters
wsdlFileWSDL file name

◆ parseComplexType()

void sptk::WSParser::parseComplexType ( xdoc::SNode &  complexTypeElement)
protected

Parses xsd:complexType nodes directly under xsd:schema

Parameters
complexTypeElementSchema complex type

◆ parseElement()

void sptk::WSParser::parseElement ( const xdoc::SNode &  elementNode)
protected

Parses xsd:element nodes directly under xsd:schema

Parameters
elementNodeSchema element

◆ parseOperation()

void sptk::WSParser::parseOperation ( const xdoc::SNode &  operationNode)
protected

Parses wsdl:operation nodes directly under xsd:schema

Parameters
operationNodeSchema complex type

◆ parseSchema()

void sptk::WSParser::parseSchema ( const xdoc::SNode &  schemaElement)
protected

Parses xsd:schema

Parameters
schemaElementSchema element

◆ parseSimpleType()

static void sptk::WSParser::parseSimpleType ( const xdoc::SNode &  simpleTypeElement)
staticprotected

Parses xsd:simpleType nodes directly under xsd:schema

Parameters
simpleTypeElementSchema simple type

◆ strip_namespace()

static String sptk::WSParser::strip_namespace ( const String name)
static

Utility function that removes namespace from the element name

Parameters
nameElement name

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

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