KDSOAP 1.2
KDSoapServerSocket_p.h
00001 /****************************************************************************
00002 ** Copyright (C) 2010-2012 Klaralvdalens Datakonsult AB.  All rights reserved.
00003 **
00004 ** This file is part of the KD Soap library.
00005 **
00006 ** Licensees holding valid commercial KD Soap licenses may use this file in
00007 ** accordance with the KD Soap Commercial License Agreement provided with
00008 ** the Software.
00009 **
00010 **
00011 ** This file may be distributed and/or modified under the terms of the
00012 ** GNU General Public License version 2 and version 3 as published by the
00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included.
00014 **
00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 **
00018 ** Contact info@kdab.com if any conditions of this licensing are not
00019 ** clear to you.
00020 **
00021 **********************************************************************/
00022 #ifndef KDSOAPSERVERSOCKET_P_H
00023 #define KDSOAPSERVERSOCKET_P_H
00024 
00025 #include <QtGlobal>
00026 
00027 #ifndef QT_NO_OPENSSL
00028 #include <QSslSocket>
00029 #else
00030 #include <QTcpSocket>
00031 #endif
00032 
00033 #include <QMap>
00034 class QObject;
00035 class KDSoapSocketList;
00036 class KDSoapServerObjectInterface;
00037 class KDSoapMessage;
00038 class KDSoapHeaders;
00039 
00040 class KDSoapServerSocket
00041 #ifndef QT_NO_OPENSSL
00042         : public QSslSocket
00043 #else
00044         : public QTcpSocket
00045 #endif
00046 {
00047     Q_OBJECT
00048 public:
00049     KDSoapServerSocket(KDSoapSocketList* owner, QObject* serverObject);
00050     ~KDSoapServerSocket();
00051 
00052     void setResponseDelayed();
00053     void sendDelayedReply(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage& replyMsg);
00054     void sendReply(KDSoapServerObjectInterface* serverObjectInterface, const KDSoapMessage& replyMsg);
00055 
00056 Q_SIGNALS:
00057     void socketDeleted(KDSoapServerSocket *);
00058 
00059 private Q_SLOTS:
00060     void slotReadyRead();
00061 
00062 private:
00063     void makeCall(KDSoapServerObjectInterface* serverObjectInterface,
00064                   const KDSoapMessage& requestMsg, KDSoapMessage& replyMsg,
00065                   const KDSoapHeaders& requestHeaders,
00066                   const QByteArray& soapAction);
00067     void handleError(KDSoapMessage& replyMsg, const char* errorCode, const QString& error);
00068     void setSocketEnabled(bool enabled);
00069 
00070     KDSoapSocketList* m_owner;
00071     QObject* m_serverObject;
00072     bool m_delayedResponse;
00073     bool m_doDebug;
00074     bool m_socketEnabled;
00075     QByteArray m_requestBuffer;
00076 
00077     // Data for the current call (stored here for delayed replies)
00078     QString m_messageNamespace;
00079     QString m_method;
00080 };
00081 
00082 #endif // KDSOAPSERVERSOCKET_P_H
 All Classes Functions Enumerations Enumerator

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