KD SOAP 2.0.0
Loading...
Searching...
No Matches
KDSoapServerSocket_p.h
1/****************************************************************************
2**
3** This file is part of the KD Soap library.
4**
5** SPDX-FileCopyrightText: 2010-2021 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>
27QT_BEGIN_NAMESPACE
28class QObject;
29QT_END_NAMESPACE
30class KDSoapSocketList;
32class KDSoapMessage;
33class KDSoapHeaders;
34
35class KDSoapServerSocket
36#ifndef QT_NO_SSL
37 : public QSslSocket
38#else
39 : public QTcpSocket
40#endif
41{
42 Q_OBJECT
43public:
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);
50Q_SIGNALS:
51 void socketDeleted(KDSoapServerSocket *);
52
53private Q_SLOTS:
54 void slotReadyRead();
55
56private:
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
Definition: KDSoapMessage.h:192
Definition: KDSoapMessage.h:35
Definition: KDSoapServerObjectInterface.h:66

© 2010-2021 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 Thu Apr 2 2026 10:58:54 for KD SOAP by doxygen 1.9.6