KD SOAP API Documentation  2.2
KDSoapServerSocket_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap project.
4 **
5 ** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 #ifndef KDSOAPSERVERSOCKET_P_H
11 #define KDSOAPSERVERSOCKET_P_H
12 
13 #include <QtGlobal>
14 
15 #include <QTcpSocket> //may define QT_NO_SSL
16 #ifndef QT_NO_SSL
17 #include <QSslSocket>
18 #endif
19 
20 #include <QMap>
21 QT_BEGIN_NAMESPACE
22 class QObject;
23 QT_END_NAMESPACE
24 class KDSoapSocketList;
26 class KDSoapMessage;
27 class KDSoapHeaders;
28 
30 #ifndef QT_NO_SSL
31  : public QSslSocket
32 #else
33  : public QTcpSocket
34 #endif
35 {
36  Q_OBJECT
37 public:
38  KDSoapServerSocket(KDSoapSocketList *owner, QObject *serverObject);
40 
41  void setResponseDelayed();
42  void sendDelayedReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg);
43  void sendReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg);
44 Q_SIGNALS:
46 
47 private Q_SLOTS:
48  void slotReadyRead();
49 
50 private:
51  void handleRequest(const QMap<QByteArray, QByteArray> &headers, const QByteArray &receivedData);
52  bool handleWsdlDownload();
53  bool handleFileDownload(KDSoapServerObjectInterface *serverObjectInterface, const QString &path);
54  void makeCall(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &requestMsg, KDSoapMessage &replyMsg,
55  const KDSoapHeaders &requestHeaders, const QByteArray &soapAction, const QString &path);
56  void handleError(KDSoapMessage &replyMsg, const char *errorCode, const QString &error);
57  void setSocketEnabled(bool enabled);
58  void writeXML(const QByteArray &xmlResponse, bool isFault);
60 
61  KDSoapSocketList *m_owner;
62  QObject *m_serverObject;
63  bool m_delayedResponse;
64  bool m_doDebug;
65  bool m_socketEnabled;
66  bool m_receivedData;
67 
68  // Current request being assembled
69  bool m_useRawXML;
70  int m_bytesReceived;
71  int m_chunkStart;
72  QMap<QByteArray, QByteArray> m_httpHeaders;
73  QByteArray m_requestBuffer;
74  QByteArray m_decodedRequestBuffer; // used for chunked transfer encoding only
75 
76  // Data for the current call (stored here for delayed replies)
77  QString m_messageNamespace;
78  QString m_method;
79 };
80 
81 #endif // KDSOAPSERVERSOCKET_P_H
void sendDelayedReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg)
void socketDeleted(KDSoapServerSocket *)
KDSoapServerSocket(KDSoapSocketList *owner, QObject *serverObject)
void sendReply(KDSoapServerObjectInterface *serverObjectInterface, const KDSoapMessage &replyMsg)

© 2010-2024 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 by doxygen 1.9.1