KD SOAP  1.10.0
KDSoapNamespacePrefixes_p.h
1 /****************************************************************************
2 **
3 ** This file is part of the KD Soap library.
4 **
5 ** SPDX-FileCopyrightText: 2010-2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDAB-KDSoap OR LicenseRef-KDAB-KDSoap-US
8 **
9 ** Licensees holding valid commercial KD Soap licenses may use this file in
10 ** accordance with the KD Soap Commercial License Agreement provided with
11 ** the Software.
12 **
13 ** Contact info@kdab.com if any conditions of this licensing are not clear to you.
14 **
15 ****************************************************************************/
16 #ifndef KDSOAPNAMESPACEPREFIXES_P_H
17 #define KDSOAPNAMESPACEPREFIXES_P_H
18 
19 #include <QtCore/QMap>
20 #include <QtCore/QXmlStreamWriter>
21 
22 #include "KDSoapClientInterface.h"
23 #include "KDSoapMessageAddressingProperties.h"
24 
25 class KDSoapNamespacePrefixes : public QMap<QString /*ns*/, QString /*prefix*/>
26 {
27 public:
28  void writeStandardNamespaces(QXmlStreamWriter &writer,
29  KDSoap::SoapVersion version = KDSoap::SOAP1_1,
30  bool messageAddressingEnabled = false,
31  KDSoapMessageAddressingProperties::KDSoapAddressingNamespace messageAddressingNamespace = KDSoapMessageAddressingProperties::Addressing200508
32  );
33 
34  void writeNamespace(QXmlStreamWriter &writer, const QString &ns, const QString &prefix)
35  {
36  //qDebug() << "writeNamespace" << ns << prefix;
37  insert(ns, prefix);
38  writer.writeNamespace(ns, prefix);
39  }
40  QString resolve(const QString &ns, const QString &localName) const
41  {
42  const QString prefix = value(ns);
43  if (prefix.isEmpty()) {
44  qWarning("ERROR: Namespace not found: %s (for localName %s)", qPrintable(ns), qPrintable(localName));
45  }
46  return prefix + QLatin1Char(':') + localName;
47  }
48 };
49 
50 #endif // KDSOAPNAMESPACESPREFIXES_H
KDSoapAddressingNamespace
Definition: KDSoapMessageAddressingProperties.h:100

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/