KD SOAP  2.0.0
KDSoapServerSocket_p.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap library.
4 **
5 ** SPDX-FileCopyrightText: 2010-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LicenseRef-KDAB-KDSoap-AGPL3-Modified OR LicenseRef-KDAB-KDSoap OR LicenseRef-KDAB-KDSoap-US
8 **
9 ** Licensees holding valid commercial KD Soap licenses may use this file in
10 ** accordance with the KD Soap Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 #ifndef KDSOAPSERVERSOCKET_P_H
17 #define KDSOAPSERVERSOCKET_P_H
18 
19 #include <QtGlobal>
20 
21 #include <QTcpSocket> //may define QT_NO_SSL
22 #ifndef QT_NO_SSL
23 #include <QSslSocket>
24 #endif
25 
26 #include <QMap>
27 QT_BEGIN_NAMESPACE
28 class QObject;
29 QT_END_NAMESPACE
30 class KDSoapSocketList;
32 class KDSoapMessage;
33 class KDSoapHeaders;
34 
35 class KDSoapServerSocket
36 #ifndef QT_NO_SSL
37  : public QSslSocket
38 #else
39  : public QTcpSocket
40 #endif
41 {
42  Q_OBJECT
43 public:
44  KDSoapServerSocket(KDSoapSocketList *owner, QObject *serverObject);
45  ~KDSoapServerSocket();
46 
47  void setResponseDelayed();
48  void sendDelayedReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg);
49  void sendReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg);
50 Q_SIGNALS:
51  void socketDeleted(KDSoapServerSocket *);
52 
53 private Q_SLOTS:
54  void slotReadyRead();
55 
56 private:
57  void handleRequest(const QMap<QByteArray, QByteArray> &headers, const QByteArray &receivedData);
58  bool handleWsdlDownload();
59  bool handleFileDownload(KDSoapServerObjectInterface *serverObjectInterface, const QString &path);
60  void makeCall(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &requestMsg, KDSoapMessage &replyMsg,
61  const KDSoapHeaders &requestHeaders, const QByteArray &soapAction, const QString &path);
62  void handleError(KDSoapMessage &replyMsg, const char *errorCode, const QString &error);
63  void setSocketEnabled(bool enabled);
64  void writeXML(const QByteArray &xmlResponse, bool isFault);
65  friend class KDSoapServerObjectInterface;
66 
67  KDSoapSocketList *m_owner;
68  QObject *m_serverObject;
69  bool m_delayedResponse;
70  bool m_doDebug;
71  bool m_socketEnabled;
72  bool m_receivedData;
73 
74  // Current request being assembled
75  bool m_useRawXML;
76  int m_bytesReceived;
77  int m_chunkStart;
78  QMap<QByteArray, QByteArray> m_httpHeaders;
79  QByteArray m_requestBuffer;
80  QByteArray m_decodedRequestBuffer; // used for chunked transfer encoding only
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
KDSoapHeaders
Definition: KDSoapMessage.h:192
KDSoapMessage
Definition: KDSoapMessage.h:35
QObject
QString
KDSoapServerObjectInterface
Definition: KDSoapServerObjectInterface.h:66
QMap< QByteArray, QByteArray >
QByteArray

© 2010-2022 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/
Generated on Fri Jul 22 2022 15:57:43 for KD SOAP by doxygen 1.8.20