KD SOAP  1.9.1
KDSoapNamespacePrefixes_p.h
1 /****************************************************************************
2 ** Copyright (C) 2010-2020 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 KDSOAPNAMESPACEPREFIXES_P_H
24 #define KDSOAPNAMESPACEPREFIXES_P_H
25 
26 #include <QtCore/QMap>
27 #include <QtCore/QXmlStreamWriter>
28 
29 #include "KDSoapClientInterface.h"
30 #include "KDSoapMessageAddressingProperties.h"
31 
32 class KDSoapNamespacePrefixes : public QMap<QString /*ns*/, QString /*prefix*/>
33 {
34 public:
35  void writeStandardNamespaces(QXmlStreamWriter &writer,
36  KDSoap::SoapVersion version = KDSoap::SOAP1_1,
37  bool messageAddressingEnabled = false,
38  KDSoapMessageAddressingProperties::KDSoapAddressingNamespace messageAddressingNamespace = KDSoapMessageAddressingProperties::Addressing200508
39  );
40 
41  void writeNamespace(QXmlStreamWriter &writer, const QString &ns, const QString &prefix)
42  {
43  //qDebug() << "writeNamespace" << ns << prefix;
44  insert(ns, prefix);
45  writer.writeNamespace(ns, prefix);
46  }
47  QString resolve(const QString &ns, const QString &localName) const
48  {
49  const QString prefix = value(ns);
50  if (prefix.isEmpty()) {
51  qWarning("ERROR: Namespace not found: %s (for localName %s)", qPrintable(ns), qPrintable(localName));
52  }
53  return prefix + QLatin1Char(':') + localName;
54  }
55 };
56 
57 #endif // KDSOAPNAMESPACESPREFIXES_H
KDSoapAddressingNamespace
Definition: KDSoapMessageAddressingProperties.h:107

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-soap/