KDSOAP
|
00001 /**************************************************************************** 00002 ** Copyright (C) 2010-2011 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 KDSOAPMESSAGE_H 00023 #define KDSOAPMESSAGE_H 00024 00025 #include <QSharedDataPointer> 00026 #include <QVariant> 00027 #include "KDSoapValue.h" 00028 class QString; 00029 class KDSoapMessageData; 00030 class KDSoapHeaders; 00031 00035 class KDSOAP_EXPORT KDSoapMessage : public KDSoapValue 00036 { 00037 public: 00041 KDSoapMessage(); 00045 ~KDSoapMessage(); 00046 00050 KDSoapMessage(const KDSoapMessage& other); 00054 KDSoapMessage &operator=(const KDSoapMessage &other); 00055 00059 KDSoapMessage &operator=(const KDSoapValue &other); 00060 00065 void setUse(Use use); 00069 Use use() const; 00070 00085 void addArgument(const QString& argumentName, const QVariant& argumentValue, const QString& typeNameSpace = QString(), const QString& typeName = QString()); 00086 00100 void addArgument(const QString& argumentName, const KDSoapValueList& argumentValueList, const QString& typeNameSpace = QString(), const QString& typeName = QString()); 00101 00106 KDSoapValueList& arguments(); 00107 00112 const KDSoapValueList& arguments() const; 00113 00121 bool isFault() const; 00122 00126 QString faultAsString() const; 00127 00132 void setFault(bool fault); 00133 00134 private: 00135 friend class KDSoapPendingCall; 00136 friend class KDSoapServerSocket; 00137 enum XmlError { 00138 NoError=0, 00139 ParseError, 00140 PrematureEndOfDocumentError 00141 }; 00142 00143 XmlError parseSoapXml(const QByteArray& data, QString* pMessageNamespace, KDSoapHeaders* pRequestHeaders); 00144 QSharedDataPointer<KDSoapMessageData> d; 00145 }; 00146 00151 class KDSOAP_EXPORT KDSoapHeaders : public QList<KDSoapMessage> 00152 { 00153 public: 00157 KDSoapMessage header(const QString& name) const; 00158 }; 00159 00163 KDSOAP_EXPORT QDebug operator<<(QDebug dbg, const KDSoapMessage &msg); 00164 00165 #endif // KDSOAPMESSAGE_H