#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 |
WSParser & | operator= (const WSParser &other)=delete |
WSParser & | operator= (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 String & | description () 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) |
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.
using sptk::WSParser::DocumentationMap = std::map<String, String> |
Map of operation names to operation objects
using sptk::WSParser::ElementMap = std::map<String, const WSParserElement*> |
Map of element names to element objects
using sptk::WSParser::XmlTypeMap = std::map<String, const xdoc::Node*> |
Map of element names to corresponding WSDL (XML) elements
|
default |
Constructor
|
virtualdefault |
Destructor
void sptk::WSParser::clear | ( | ) |
Clears parsed data
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
sourceDirectory | Directory to store output classes |
headerFile | Optional header file to insert at the start of each generated file |
|
protected |
Generates service definition to output stream
usedClasses | List of this service complex types (classes) |
output | Output stream |
|
protected |
Generates service implementation to output stream
output | Output stream |
void sptk::WSParser::generateWsdlCxx | ( | const String & | sourceDirectory, |
const String & | headerFile, | ||
const fs::path & | wsdlFileName | ||
) | const |
Stores WSDL to C++ file
sourceDirectory | Directory to store output files |
headerFile | Optional header file to insert at the start of each generated file |
wsdlFileName | WSDL content |
Utility function that returns namespace from the element name
name | Element name |
void sptk::WSParser::parse | ( | const fs::path & | wsdlFile | ) |
Loads WSDL-file and parses it to output classes
wsdlFile | WSDL file name |
|
protected |
Parses xsd:complexType nodes directly under xsd:schema
complexTypeElement | Schema complex type |
|
protected |
Parses xsd:element nodes directly under xsd:schema
elementNode | Schema element |
|
protected |
Parses wsdl:operation nodes directly under xsd:schema
operationNode | Schema complex type |
|
protected |
Parses xsd:schema
schemaElement | Schema element |
|
staticprotected |
Parses xsd:simpleType nodes directly under xsd:schema
simpleTypeElement | Schema simple type |
Utility function that removes namespace from the element name
name | Element name |