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