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 LICENSE 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 "libmythupnp/upnpexp.h"
23 #include "libmythupnp/upnp.h"
25 #include "libmythupnp/xsd.h"
26 
29 //
30 //
31 //
34 
35 class UPNP_PUBLIC Wsdl : public QDomDocument
36 {
37  protected:
38  ServiceHost *m_pServiceHost {nullptr};
39  QMap<QString, TypeInfo> m_typesToInclude;
40 
41  QDomElement m_oRoot;
42  QDomElement m_oTypes;
43  QDomElement m_oLastMsg;
44  QDomElement m_oPortType;
45  QDomElement m_oBindings;
46  QDomElement m_oService;
47 
48  protected:
49 
50 
51  QDomElement CreateBindingOperation( MethodInfo &oInfo,
52  const QString &sClassName );
53 
54  QDomElement CreateMessage ( const QString& sMsgName,
55  const QString& sTypeName );
56 
57  QDomElement CreateMethodType ( MethodInfo &oInfo,
58  QString sTypeName,
59  bool bReturnType = false );
60 
61  static bool IsCustomType ( const QString &sTypeName );
62 
63  static QString ReadClassInfo ( const QMetaObject *pMeta,
64  const QString &sKey );
65 
66  QString AddTypeInfo ( QString sType );
67 
68 
69  public:
70 
71  explicit Wsdl( ServiceHost *pServiceHost )
72  : m_pServiceHost( pServiceHost ) {}
73 
74  bool GetWSDL( HTTPRequest *pRequest );
75 };
76 
77 #endif // WSDL_H
Wsdl::m_typesToInclude
QMap< QString, TypeInfo > m_typesToInclude
Definition: wsdl.h:39
Wsdl::m_oRoot
QDomElement m_oRoot
Definition: wsdl.h:41
HTTPRequest
Definition: httprequest.h:109
xsd.h
Wsdl::m_oTypes
QDomElement m_oTypes
Definition: wsdl.h:42
Wsdl::m_oBindings
QDomElement m_oBindings
Definition: wsdl.h:45
Wsdl::Wsdl
Wsdl(ServiceHost *pServiceHost)
Definition: wsdl.h:71
ServiceHost
Definition: servicehost.h:63
upnp.h
Wsdl::m_oPortType
QDomElement m_oPortType
Definition: wsdl.h:44
Wsdl
Definition: wsdl.h:35
MethodInfo
Definition: servicehost.h:34
Wsdl::m_oLastMsg
QDomElement m_oLastMsg
Definition: wsdl.h:43
UPNP_PUBLIC
#define UPNP_PUBLIC
Definition: upnpexp.h:9
servicehost.h
Wsdl::m_oService
QDomElement m_oService
Definition: wsdl.h:46
upnpexp.h