KD SOAP
 All Classes Functions Enumerations Enumerator Pages
KDSoapServerObjectInterface.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2013 Klaralvdalens Datakonsult AB. All rights reserved.
3 **
4 ** This file is part of the KD Soap library.
5 **
6 ** Licensees holding valid commercial KD Soap licenses may use this file in
7 ** accordance with the KD Soap Commercial License Agreement provided with
8 ** the Software.
9 **
10 **
11 ** This file may be distributed and/or modified under the terms of the
12 ** GNU Lesser General Public License version 2 and version 3 as published by the
13 ** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included.
14 **
15 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 **
18 ** Contact info@kdab.com if any conditions of this licensing are not
19 ** clear to you.
20 **
21 **********************************************************************/
22 #ifndef KDSOAPSERVEROBJECTINTERFACE_H
23 #define KDSOAPSERVEROBJECTINTERFACE_H
24 
25 #include "KDSoapServerGlobal.h"
26 #include <KDSoapClient/KDSoapMessage.h>
27 #include "KDSoapDelayedResponseHandle.h"
28 
29 #include <QtCore/QObject>
30 #include <QIODevice>
31 
32 class KDSoapServerSocket;
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 
131  KDSoapHeaders requestHeaders() const;
132 
136  QByteArray soapAction() const;
137 
141  void setResponseHeaders(const KDSoapHeaders& headers);
142 
150  void setResponseNamespace(const QString& ns);
151 
163  void setFault(const QString& faultCode, const QString& faultString, const QString& faultActor = QString(), const QString& detail = QString());
164 
168  bool hasFault() const;
169 
178  KDSoapDelayedResponseHandle prepareDelayedResponse(); // only valid during processRequest()
184  bool isDelayedResponse() const; // only valid during processRequest()
185 
192  void sendDelayedResponse(const KDSoapDelayedResponseHandle& responseHandle, const KDSoapMessage& response);
193 
194 private:
195  friend class KDSoapServerSocket;
196  void setServerSocket(KDSoapServerSocket* serverSocket); // only valid during processRequest()
197  void setRequestHeaders(const KDSoapHeaders& headers, const QByteArray& soapAction);
198  KDSoapHeaders responseHeaders() const;
199  QString responseNamespace() const;
200  void storeFaultAttributes(KDSoapMessage& message) const;
201  class Private;
202  Private* const d;
203 };
204 
205 QT_BEGIN_NAMESPACE
206 Q_DECLARE_INTERFACE(KDSoapServerObjectInterface,
207  "com.kdab.KDSoap.ServerObjectInterface/1.0")
208 QT_END_NAMESPACE
209 
210 #endif // KDSOAPSERVEROBJECTINTERFACE_H

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