MythTV  master
wsdl.h
Go to the documentation of this file.
1 // Program Name: wsdl.h
3 // Created : Jan. 19, 2010
4 //
5 // Purpose : WSDL XML Generation Class
6 //
7 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
8 //
9 // Licensed under the GPL v2 or later, see COPYING for details
10 //
12 
13 #ifndef WSDL_H
14 #define WSDL_H
15 
16 #include <QMetaObject>
17 #include <QMetaMethod>
18 #include <QString>
19 #include <QMap>
20 #include <QDomDocument>
21 
22 #include "upnpexp.h"
23 #include "upnp.h"
24 
25 #include "servicehost.h"
26 #include "xsd.h"
27 
30 //
31 //
32 //
35 
36 class UPNP_PUBLIC Wsdl : public QDomDocument
37 {
38  protected:
39  ServiceHost *m_pServiceHost {nullptr};
40  QMap<QString, TypeInfo> m_typesToInclude;
41 
42  QDomElement m_oRoot;
43  QDomElement m_oTypes;
44  QDomElement m_oLastMsg;
45  QDomElement m_oPortType;
46  QDomElement m_oBindings;
47  QDomElement m_oService;
48 
49  protected:
50 
51 
52  QDomElement CreateBindingOperation( MethodInfo &oInfo,
53  const QString &sClassName );
54 
55  QDomElement CreateMessage ( const QString& sMsgName,
56  const QString& sTypeName );
57 
58  QDomElement CreateMethodType ( MethodInfo &oInfo,
59  QString sTypeName,
60  bool bReturnType = false );
61 
62  static bool IsCustomType ( QString &sTypeName );
63 
64  static QString ReadClassInfo ( const QMetaObject *pMeta,
65  const QString &sKey );
66 
67  QString AddTypeInfo ( QString sType );
68 
69 
70  public:
71 
72  explicit Wsdl( ServiceHost *pServiceHost )
73  : m_pServiceHost( pServiceHost ) {}
74 
75  bool GetWSDL( HTTPRequest *pRequest );
76 };
77 
78 #endif // WSDL_H
Wsdl::m_typesToInclude
QMap< QString, TypeInfo > m_typesToInclude
Definition: wsdl.h:40
Wsdl::m_oRoot
QDomElement m_oRoot
Definition: wsdl.h:42
HTTPRequest
Definition: httprequest.h:107
xsd.h
Wsdl::m_oTypes
QDomElement m_oTypes
Definition: wsdl.h:43
Wsdl::m_oBindings
QDomElement m_oBindings
Definition: wsdl.h:46
Wsdl::Wsdl
Wsdl(ServiceHost *pServiceHost)
Definition: wsdl.h:72
ServiceHost
Definition: servicehost.h:62
upnp.h
Wsdl::m_oPortType
QDomElement m_oPortType
Definition: wsdl.h:45
Wsdl
Definition: wsdl.h:36
MethodInfo
Definition: servicehost.h:33
Wsdl::m_oLastMsg
QDomElement m_oLastMsg
Definition: wsdl.h:44
UPNP_PUBLIC
#define UPNP_PUBLIC
Definition: upnpexp.h:9
servicehost.h
Wsdl::m_oService
QDomElement m_oService
Definition: wsdl.h:47
upnpexp.h