KD SOAP
 All Classes Functions Enumerations Enumerator Pages
KDSoapServerObjectInterface.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2014 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 
66 class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface
67 {
68 public:
76  virtual ~KDSoapServerObjectInterface();
77 
91  virtual void processRequest(const KDSoapMessage& request, KDSoapMessage& response, const QByteArray& soapAction);
92 
105  virtual QIODevice* processFileRequest(const QString& path, QByteArray &contentType);
106 
125  virtual void processRequestWithPath(const KDSoapMessage& request, KDSoapMessage& response, const QByteArray& soapAction, const QString& path);
126 
133  void doneProcessingRequestWithPath(const KDSoapServerObjectInterface &otherInterface);
134 
140  KDSoapHeaders requestHeaders() const;
141 
145  QByteArray soapAction() const;
146 
150  void setResponseHeaders(const KDSoapHeaders& headers);
151 
159  void setResponseNamespace(const QString& ns);
160 
172  void setFault(const QString& faultCode, const QString& faultString, const QString& faultActor = QString(), const QString& detail = QString());
173 
185  void setFault(const QString& faultCode, const QString& faultString, const QString& faultActor, const KDSoapValue& detail);
186 
190  bool hasFault() const;
191 
200  KDSoapDelayedResponseHandle prepareDelayedResponse(); // only valid during processRequest()
206  bool isDelayedResponse() const; // only valid during processRequest()
207 
214  void sendDelayedResponse(const KDSoapDelayedResponseHandle& responseHandle, const KDSoapMessage& response);
215 
216 private:
217  friend class KDSoapServerSocket;
218  void setServerSocket(KDSoapServerSocket* serverSocket); // only valid during processRequest()
219  void setRequestHeaders(const KDSoapHeaders& headers, const QByteArray& soapAction);
220  KDSoapHeaders responseHeaders() const;
221  QString responseNamespace() const;
222  void storeFaultAttributes(KDSoapMessage& message) const;
223  class Private;
224  Private* const d;
225 };
226 
227 QT_BEGIN_NAMESPACE
228 Q_DECLARE_INTERFACE(KDSoapServerObjectInterface,
229  "com.kdab.KDSoap.ServerObjectInterface/1.0")
230 QT_END_NAMESPACE
231 
232 #endif // KDSOAPSERVEROBJECTINTERFACE_H

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