KD SOAP
 All Classes Functions Enumerations Enumerator Pages
KDSoapServerSocket_p.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2014 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com.
3 ** All rights reserved.
4 **
5 ** This file is part of the KD Soap library.
6 **
7 ** Licensees holding valid commercial KD Soap licenses may use this file in
8 ** accordance with the KD Soap Commercial License Agreement provided with
9 ** the Software.
10 **
11 **
12 ** This file may be distributed and/or modified under the terms of the
13 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
14 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
15 **
16 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 **
19 ** Contact info@kdab.com if any conditions of this licensing are not
20 ** clear to you.
21 **
22 **********************************************************************/
23 #ifndef KDSOAPSERVERSOCKET_P_H
24 #define KDSOAPSERVERSOCKET_P_H
25 
26 #include <QtGlobal>
27 
28 #ifndef QT_NO_OPENSSL
29 #include <QSslSocket>
30 #else
31 #include <QTcpSocket>
32 #endif
33 
34 #include <QMap>
35 QT_BEGIN_NAMESPACE
36 class QObject;
37 QT_END_NAMESPACE
38 class KDSoapSocketList;
40 class KDSoapMessage;
41 class KDSoapHeaders;
42 
43 class KDSoapServerSocket
44 #ifndef QT_NO_OPENSSL
45  : public QSslSocket
46 #else
47  : public QTcpSocket
48 #endif
49 {
50  Q_OBJECT
51 public:
52  KDSoapServerSocket(KDSoapSocketList* owner, QObject* serverObject);
53  ~KDSoapServerSocket();
54 
55  void setResponseDelayed();
56  void sendDelayedReply(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage& replyMsg);
57  void sendReply(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage& replyMsg);
58 
59 Q_SIGNALS:
60  void socketDeleted(KDSoapServerSocket *);
61 
62 private Q_SLOTS:
63  void slotReadyRead();
64 
65 private:
66  bool handleWsdlDownload();
67  bool handleFileDownload(KDSoapServerObjectInterface* serverObjectInterface, const QString& path);
68  void makeCall(KDSoapServerObjectInterface* serverObjectInterface,
69  const KDSoapMessage& requestMsg, KDSoapMessage& replyMsg,
70  const KDSoapHeaders& requestHeaders,
71  const QByteArray& soapAction, const QString &path);
72  void handleError(KDSoapMessage& replyMsg, const char* errorCode, const QString& error);
73  void setSocketEnabled(bool enabled);
74 
75  KDSoapSocketList* m_owner;
76  QObject* m_serverObject;
77  bool m_delayedResponse;
78  bool m_doDebug;
79  bool m_socketEnabled;
80  QByteArray m_requestBuffer;
81 
82  // Data for the current call (stored here for delayed replies)
83  QString m_messageNamespace;
84  QString m_method;
85 };
86 
87 #endif // KDSOAPSERVERSOCKET_P_H

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-soap/