KD SOAP  1.7.0
KDSoapServerObjectInterface.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com.
3 ** All rights reserved.
4 **
5 ** This file is part of the KD Soap library.
6 **
7 ** Licensees holding valid commercial KD Soap licenses may use this file in
8 ** accordance with the KD Soap Commercial License Agreement provided with
9 ** the Software.
10 **
11 **
12 ** This file may be distributed and/or modified under the terms of the
13 ** GNU Lesser General Public License version 2.1 and version 3 as published by the
14 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
15 **
16 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
17 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 **
19 ** Contact info@kdab.com if any conditions of this licensing are not
20 ** clear to you.
21 **
22 **********************************************************************/
23 #ifndef KDSOAPSERVEROBJECTINTERFACE_H
24 #define KDSOAPSERVEROBJECTINTERFACE_H
25 
26 #include "KDSoapServerGlobal.h"
27 #include <KDSoapClient/KDSoapMessage.h>
28 #include "KDSoapDelayedResponseHandle.h"
29 
30 #include <QtCore/QObject>
31 #include <QIODevice>
32 
33 class KDSoapServerSocket;
34 class QAbstractSocket;
35 
67 class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface
68 {
69 public:
77  virtual ~KDSoapServerObjectInterface();
78 
92  virtual void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction);
93 
106  virtual QIODevice *processFileRequest(const QString &path, QByteArray &contentType);
107 
126  virtual void processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path);
127 
134  void doneProcessingRequestWithPath(const KDSoapServerObjectInterface &otherInterface);
135 
141  KDSoapHeaders requestHeaders() const;
142 
146  QByteArray soapAction() const;
147 
151  void setResponseHeaders(const KDSoapHeaders &headers);
152 
160  void setResponseNamespace(const QString &ns);
161 
173  void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor = QString(), const QString &detail = QString());
174 
186  void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor, const KDSoapValue &detail);
187 
191  bool hasFault() const;
192 
198  QAbstractSocket *serverSocket() const;
199 
208  KDSoapDelayedResponseHandle prepareDelayedResponse(); // only valid during processRequest()
214  bool isDelayedResponse() const; // only valid during processRequest()
215 
222  void sendDelayedResponse(const KDSoapDelayedResponseHandle &responseHandle, const KDSoapMessage &response);
223 
230  void writeHTTP(const QByteArray &httpReply);
231 
240  void writeXML(const QByteArray &reply, bool isFault = false);
241 
242 private:
243  friend class KDSoapServerSocket;
244  void setServerSocket(KDSoapServerSocket *serverSocket); // only valid during processRequest()
245  void setRequestHeaders(const KDSoapHeaders &headers, const QByteArray &soapAction);
246  KDSoapHeaders responseHeaders() const;
247  QString responseNamespace() const;
248  void storeFaultAttributes(KDSoapMessage &message) const;
249  class Private;
250  Private *const d;
251 };
252 
253 QT_BEGIN_NAMESPACE
254 Q_DECLARE_INTERFACE(KDSoapServerObjectInterface,
255  "com.kdab.KDSoap.ServerObjectInterface/1.0")
256 QT_END_NAMESPACE
257 
258 #endif // KDSOAPSERVEROBJECTINTERFACE_H
Definition: KDSoapValue.h:61
Definition: KDSoapMessage.h:187
Definition: KDSoapServerObjectInterface.h:67
Definition: KDSoapMessage.h:41
Definition: KDSoapDelayedResponseHandle.h:39

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-soap/