KD SOAP  2.0.0
KDSoapServerObjectInterface.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 KDSOAPSERVEROBJECTINTERFACE_H
17 #define KDSOAPSERVEROBJECTINTERFACE_H
18 
19 #include "KDSoapServerGlobal.h"
20 #include <KDSoapClient/KDSoapMessage.h>
21 #include "KDSoapDelayedResponseHandle.h"
22 
23 #include <QtCore/QObject>
24 #include <QtCore/QByteArray>
25 #include <QtCore/QVector>
26 #include <QIODevice>
27 
28 class KDSoapServerSocket;
29 
30 QT_BEGIN_NAMESPACE
31 class QAbstractSocket;
32 QT_END_NAMESPACE
33 
65 class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface
66 {
67 public:
75  virtual ~KDSoapServerObjectInterface();
76 
90  virtual void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction);
91 
104  virtual QIODevice *processFileRequest(const QString &path, QByteArray &contentType);
105 
124  virtual void processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path);
125 
126  struct KDSOAPSERVER_EXPORT HttpResponseHeaderItem
127  {
128  HttpResponseHeaderItem();
129  HttpResponseHeaderItem(const QByteArray &name, const QByteArray &value);
130  QByteArray m_value;
131  QByteArray m_name;
132  };
133 
135 
142  virtual HttpResponseHeaderItems additionalHttpResponseHeaderItems() const;
143 
150  void doneProcessingRequestWithPath(const KDSoapServerObjectInterface &otherInterface);
151 
157  KDSoapHeaders requestHeaders() const;
158 
162  QByteArray soapAction() const;
163 
167  void setResponseHeaders(const KDSoapHeaders &headers);
168 
176  void setResponseNamespace(const QString &ns);
177 
189  void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor = QString(), const QString &detail = QString());
190 
202  void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor, const KDSoapValue &detail);
203 
207  bool hasFault() const;
208 
214  QAbstractSocket *serverSocket() const;
215 
224  KDSoapDelayedResponseHandle prepareDelayedResponse(); // only valid during processRequest()
230  bool isDelayedResponse() const; // only valid during processRequest()
231 
238  void sendDelayedResponse(const KDSoapDelayedResponseHandle &responseHandle, const KDSoapMessage &response);
239 
246  void writeHTTP(const QByteArray &httpReply);
247 
256  void writeXML(const QByteArray &reply, bool isFault = false);
257 
258 private:
259  friend class KDSoapServerSocket;
260  void setServerSocket(KDSoapServerSocket *serverSocket); // only valid during processRequest()
261  void setRequestHeaders(const KDSoapHeaders &headers, const QByteArray &soapAction);
262  KDSoapHeaders responseHeaders() const;
263  QString responseNamespace() const;
264  void storeFaultAttributes(KDSoapMessage &message) const;
265  class Private;
266  Private *const d;
267 };
268 
269 QT_BEGIN_NAMESPACE
270 Q_DECLARE_INTERFACE(KDSoapServerObjectInterface, "com.kdab.KDSoap.ServerObjectInterface/1.0")
271 QT_END_NAMESPACE
272 
273 #endif // KDSOAPSERVEROBJECTINTERFACE_H
KDSoapHeaders
Definition: KDSoapMessage.h:192
QIODevice
KDSoapValue
Definition: KDSoapValue.h:66
KDSoapMessage
Definition: KDSoapMessage.h:35
QString
KDSoapServerObjectInterface
Definition: KDSoapServerObjectInterface.h:66
KDSoapServerObjectInterface::isDelayedResponse
bool isDelayedResponse() const
KDSoapDelayedResponseHandle
Definition: KDSoapDelayedResponseHandle.h:33
QVector
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