From c8cc9c694786fd51d9d9088d46522243b89da055 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Wed, 2 Jan 2019 22:19:04 +0100 Subject: [PATCH 001/679] Remove unused includes from tests --- unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp | 1 - .../dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp | 1 - unittests/dwservice_wsdl/test_dwservice_wsdl.cpp | 1 - unittests/encapsecurity/test_encapsecurity.cpp | 1 - unittests/groupwise_wsdl/test_groupwise_wsdl.cpp | 1 - unittests/import_definition/test_import_definition.cpp | 1 - unittests/literal_true_false/test_literal.cpp | 1 - .../msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp | 1 - unittests/msexchange_wsdl/msexchange_wsdl.cpp | 1 - unittests/salesforce_wsdl/salesforce_wsdl.cpp | 1 - unittests/unqualified_formdefault/test_unqualified.cpp | 1 - unittests/webcalls_wsdl/webcalls_wsdl.cpp | 2 -- 12 files changed, 13 deletions(-) diff --git a/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp b/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp index 7de010ca7..a16dfecb9 100644 --- a/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp +++ b/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp @@ -24,7 +24,6 @@ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapValue.h" -#include "KDSoapAuthentication.h" #include "KDDateTime.h" #include "wsdl_DWService_12.h" #include "httpserver_p.h" diff --git a/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp b/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp index 1851ea9ae..4a38b8343 100644 --- a/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp +++ b/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp @@ -24,7 +24,6 @@ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapValue.h" -#include "KDSoapAuthentication.h" #include "KDDateTime.h" #include "httpserver_p.h" #include diff --git a/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp b/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp index c7b9c6b1d..a68170a54 100644 --- a/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp +++ b/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp @@ -24,7 +24,6 @@ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapValue.h" -#include "KDSoapAuthentication.h" #include "KDDateTime.h" #include "wsdl_DWService.h" #include "httpserver_p.h" diff --git a/unittests/encapsecurity/test_encapsecurity.cpp b/unittests/encapsecurity/test_encapsecurity.cpp index e83a4db37..c514775e1 100644 --- a/unittests/encapsecurity/test_encapsecurity.cpp +++ b/unittests/encapsecurity/test_encapsecurity.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_authstateless.h" #include "httpserver_p.h" #include diff --git a/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp b/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp index 90c56ef1c..557c05977 100644 --- a/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp +++ b/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp @@ -24,7 +24,6 @@ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapValue.h" -#include "KDSoapAuthentication.h" #include "KDDateTime.h" #include "wsdl_groupwise.h" #include "httpserver_p.h" diff --git a/unittests/import_definition/test_import_definition.cpp b/unittests/import_definition/test_import_definition.cpp index 11a8db8d4..880b22f7e 100644 --- a/unittests/import_definition/test_import_definition.cpp +++ b/unittests/import_definition/test_import_definition.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_import_definition.h" #include "httpserver_p.h" #include diff --git a/unittests/literal_true_false/test_literal.cpp b/unittests/literal_true_false/test_literal.cpp index 20d9b4a87..2779a903e 100644 --- a/unittests/literal_true_false/test_literal.cpp +++ b/unittests/literal_true_false/test_literal.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_literal.h" #include "httpserver_p.h" #include diff --git a/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp b/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp index e9b8cf2eb..c47b728ec 100644 --- a/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp +++ b/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_Services_noservice.h" #include "httpserver_p.h" #include diff --git a/unittests/msexchange_wsdl/msexchange_wsdl.cpp b/unittests/msexchange_wsdl/msexchange_wsdl.cpp index fb40cfe9c..f2deb316c 100644 --- a/unittests/msexchange_wsdl/msexchange_wsdl.cpp +++ b/unittests/msexchange_wsdl/msexchange_wsdl.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_Services.h" #include "httpserver_p.h" #include diff --git a/unittests/salesforce_wsdl/salesforce_wsdl.cpp b/unittests/salesforce_wsdl/salesforce_wsdl.cpp index 9b1ae94d2..d45f99e60 100644 --- a/unittests/salesforce_wsdl/salesforce_wsdl.cpp +++ b/unittests/salesforce_wsdl/salesforce_wsdl.cpp @@ -24,7 +24,6 @@ #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" #include "KDSoapValue.h" -#include "KDSoapAuthentication.h" #include "wsdl_salesforce-partner.h" #include "httpserver_p.h" #include diff --git a/unittests/unqualified_formdefault/test_unqualified.cpp b/unittests/unqualified_formdefault/test_unqualified.cpp index 354983613..c13aa9fb2 100644 --- a/unittests/unqualified_formdefault/test_unqualified.cpp +++ b/unittests/unqualified_formdefault/test_unqualified.cpp @@ -25,7 +25,6 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include "KDSoapAuthentication.h" #include "wsdl_unqualified.h" #include "httpserver_p.h" #include diff --git a/unittests/webcalls_wsdl/webcalls_wsdl.cpp b/unittests/webcalls_wsdl/webcalls_wsdl.cpp index 9ee8ee89d..d612d969d 100644 --- a/unittests/webcalls_wsdl/webcalls_wsdl.cpp +++ b/unittests/webcalls_wsdl/webcalls_wsdl.cpp @@ -22,8 +22,6 @@ **********************************************************************/ #include "KDSoapClientInterface.h" -//#include "KDSoapMessage.h" -//#include "KDSoapValue.h" #include "wsdl_soapresponder.h" #include "wsdl_holidays.h" #include "wsdl_BFGlobalService.h" From 1c53d38317083023425005c43aaf5a04d25ab9fa Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 3 Jan 2019 14:39:15 +0100 Subject: [PATCH 002/679] Move internal call to be private And mark calling classes as friends --- src/KDSoapClient/KDSoapAuthentication.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KDSoapClient/KDSoapAuthentication.h b/src/KDSoapClient/KDSoapAuthentication.h index e02c6c9c4..b60994113 100644 --- a/src/KDSoapClient/KDSoapAuthentication.h +++ b/src/KDSoapClient/KDSoapAuthentication.h @@ -40,6 +40,9 @@ QT_END_NAMESPACE class KDSOAP_EXPORT KDSoapAuthentication { public: + friend class KDSoapClientInterfacePrivate; + friend class KDSoapThreadTask; + /** * Constructs an empty authentication object. */ @@ -82,6 +85,7 @@ class KDSOAP_EXPORT KDSoapAuthentication */ KDSoapAuthentication &operator=(const KDSoapAuthentication &other); +private: /** * \internal */ From e70dd41224538a04d19043d15794003bdf9d3c36 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 3 Jan 2019 16:44:39 +0100 Subject: [PATCH 003/679] Add support for WS-UsernameToken Extended KDSoapAuthentication to support WS-UsernameToken. When useWSUsernameToken is set, then the WS-UsernameToken headers are included in each request. --- doc/CHANGES_1_8.txt | 1 + src/KDSoapClient/KDSoapAuthentication.cpp | 100 ++++++++++++++++- src/KDSoapClient/KDSoapAuthentication.h | 45 ++++++++ src/KDSoapClient/KDSoapClientInterface.cpp | 2 +- src/KDSoapClient/KDSoapMessageWriter.cpp | 8 +- src/KDSoapClient/KDSoapMessageWriter_p.h | 4 +- src/KDSoapClient/KDSoapNamespaceManager.cpp | 10 ++ src/KDSoapClient/KDSoapNamespaceManager.h | 2 + unittests/CMakeLists.txt | 1 + unittests/unittests.pro | 3 +- .../ws_usernametoken_support/CMakeLists.txt | 8 ++ .../ws_usernametoken_support.pro | 9 ++ .../wsusernametoken.wsdl | 61 +++++++++++ .../wsusernametokentest.cpp | 101 ++++++++++++++++++ 14 files changed, 348 insertions(+), 7 deletions(-) create mode 100644 unittests/ws_usernametoken_support/CMakeLists.txt create mode 100644 unittests/ws_usernametoken_support/ws_usernametoken_support.pro create mode 100644 unittests/ws_usernametoken_support/wsusernametoken.wsdl create mode 100644 unittests/ws_usernametoken_support/wsusernametokentest.cpp diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index a39bbdd65..705725e06 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -12,6 +12,7 @@ Client-side: * Fix error code when authentication failed * Autodeletion of jobs is now configurable (github pull #125) * Add error details in faultAsString() - and the generated lastError() - coming from the SOAP 1.2 detail element. +* Add support for WS-UsernameToken, see KDSoapAuthentication Server-side: ============ diff --git a/src/KDSoapClient/KDSoapAuthentication.cpp b/src/KDSoapClient/KDSoapAuthentication.cpp index 06e5e9274..78542a729 100644 --- a/src/KDSoapClient/KDSoapAuthentication.cpp +++ b/src/KDSoapClient/KDSoapAuthentication.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2019 Casper Meijn ** All rights reserved. ** ** This file is part of the KD Soap library. @@ -21,15 +22,26 @@ ** **********************************************************************/ #include "KDSoapAuthentication.h" -#include -#include #include +#include +#include +#include +#include +#include "KDSoapNamespacePrefixes_p.h" +#include "KDSoapNamespaceManager.h" class KDSoapAuthentication::Private { public: + Private() : + useWSUsernameToken(false) + {} + QString user; QString password; + bool useWSUsernameToken; + QDateTime overrideWSUsernameCreatedTime; + QByteArray overrideWSUsernameNonce; }; KDSoapAuthentication::KDSoapAuthentication() @@ -64,6 +76,21 @@ void KDSoapAuthentication::setPassword(const QString &password) d->password = password; } +void KDSoapAuthentication::setUseWSUsernameToken(bool useWSUsernameToken) +{ + d->useWSUsernameToken = useWSUsernameToken; +} + +void KDSoapAuthentication::setOverrideWSUsernameCreatedTime(QDateTime overrideWSUsernameCreatedTime) +{ + d->overrideWSUsernameCreatedTime = overrideWSUsernameCreatedTime; +} + +void KDSoapAuthentication::setOverrideWSUsernameNonce(QByteArray overrideWSUsernameNonce) +{ + d->overrideWSUsernameNonce = overrideWSUsernameNonce; +} + QString KDSoapAuthentication::user() const { return d->user; @@ -74,6 +101,21 @@ QString KDSoapAuthentication::password() const return d->password; } +bool KDSoapAuthentication::useWSUsernameToken() const +{ + return d->useWSUsernameToken; +} + +QDateTime KDSoapAuthentication::overrideWSUsernameCreatedTime() const +{ + return d->overrideWSUsernameCreatedTime; +} + +QByteArray KDSoapAuthentication::overrideWSUsernameNonce() const +{ + return d->overrideWSUsernameNonce; +} + bool KDSoapAuthentication::hasAuth() const { return !d->user.isEmpty() || !d->password.isEmpty(); @@ -91,3 +133,57 @@ void KDSoapAuthentication::handleAuthenticationRequired(QNetworkReply *reply, QA reply->setProperty("authAdded", true); } } + +bool KDSoapAuthentication::hasWSUsernameTokenHeader() const +{ + return hasAuth() && d->useWSUsernameToken; +} + +void KDSoapAuthentication::writeWSUsernameTokenHeader(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const QString &messageNamespace, bool forceQualified) const +{ + Q_UNUSED(namespacePrefixes); + Q_UNUSED(messageNamespace); + Q_UNUSED(forceQualified); + + if (!hasAuth()) { + return; + } + + const QString securityExtentionNS = KDSoapNamespaceManager::soapSecurityExtention(); + const QString securityUtilityNS = KDSoapNamespaceManager::soapSecurityUtility(); + + QByteArray nonce = "kdsoap" + QByteArray::number(qrand()); + if (!d->overrideWSUsernameNonce.isEmpty()) { + nonce = d->overrideWSUsernameNonce; + } + QDateTime time = QDateTime::currentDateTimeUtc(); + if (d->overrideWSUsernameCreatedTime.isValid()) { + time = d->overrideWSUsernameCreatedTime; + } + QString timestamp = time.toString(QLatin1String("yyyy-MM-ddTHH:mm:ssZ")); + QByteArray passwordConcat = nonce + timestamp.toUtf8() + d->password.toUtf8(); + QByteArray passwordHash = QCryptographicHash::hash(passwordConcat, QCryptographicHash::Sha1); + + writer.writeStartElement(securityExtentionNS, QLatin1String("Security")); + writer.writeStartElement(securityExtentionNS, QLatin1String("UsernameToken")); + + writer.writeStartElement(securityExtentionNS, QLatin1String("Nonce")); + writer.writeCharacters(QString::fromLatin1(nonce.toBase64().constData())); + writer.writeEndElement(); + + writer.writeStartElement(securityUtilityNS, QLatin1String("Created")); + writer.writeCharacters(timestamp); + writer.writeEndElement(); + + writer.writeStartElement(securityExtentionNS, QLatin1String("Password")); + writer.writeAttribute(QLatin1String("Type"), QLatin1String("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest")); + writer.writeCharacters(QString::fromLatin1(passwordHash.toBase64().constData())); + writer.writeEndElement(); + + writer.writeStartElement(securityExtentionNS, QLatin1String("Username")); + writer.writeCharacters(d->user); + writer.writeEndElement(); + + writer.writeEndElement(); + writer.writeEndElement(); +} diff --git a/src/KDSoapClient/KDSoapAuthentication.h b/src/KDSoapClient/KDSoapAuthentication.h index b60994113..14a097874 100644 --- a/src/KDSoapClient/KDSoapAuthentication.h +++ b/src/KDSoapClient/KDSoapAuthentication.h @@ -1,5 +1,6 @@ /**************************************************************************** ** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2019 Casper Meijn ** All rights reserved. ** ** This file is part of the KD Soap library. @@ -27,8 +28,11 @@ #include QT_BEGIN_NAMESPACE class QAuthenticator; +class QDateTime; class QNetworkReply; +class QXmlStreamWriter; QT_END_NAMESPACE +class KDSoapNamespacePrefixes; /** * KDSoapAuthentication provides an authentication object. @@ -40,6 +44,7 @@ QT_END_NAMESPACE class KDSOAP_EXPORT KDSoapAuthentication { public: + friend class KDSoapMessageWriter; friend class KDSoapClientInterfacePrivate; friend class KDSoapThreadTask; @@ -74,6 +79,42 @@ class KDSOAP_EXPORT KDSoapAuthentication */ QString password() const; + /** + * Sets whether WS-UsernameToken is used for authentication. When + * set, the WS-UsernameToken headers are included in each request. + * \since 1.8 + */ + void setUseWSUsernameToken(bool useWSUsernameToken); + /** + * \since 1.8 + * \return whether WS-UsernameToken is used for authentication + */ + bool useWSUsernameToken() const; + + /** + * Sets the created time used during WS-UsernameToken authentication + * This is useful for devices with an incorrect time and during testing + * \since 1.8 + */ + void setOverrideWSUsernameCreatedTime(QDateTime overrideWSUsernameCreatedTime); + /** + * \since 1.8 + * \return the created time used during WS-UsernameToken authentication + */ + QDateTime overrideWSUsernameCreatedTime() const; + + /** + * Sets the nonce used during WS-UsernameToken authentication + * This is useful during testing + * \since 1.8 + */ + void setOverrideWSUsernameNonce(QByteArray overrideWSUsernameNonce); + /** + * \since 1.8 + * \return the created time used during WS-UsernameToken authentication + */ + QByteArray overrideWSUsernameNonce() const; + /** * \return \c true if authentication was defined, or * \c false if this object is only a default-constructed KDSoapAuthentication(). @@ -91,6 +132,10 @@ class KDSOAP_EXPORT KDSoapAuthentication */ void handleAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); + bool hasWSUsernameTokenHeader() const; + + void writeWSUsernameTokenHeader(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const QString &messageNamespace, bool forceQualified) const; + private: class Private; Private *const d; diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 2b8470aab..1c6aff6fc 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -147,7 +147,7 @@ QBuffer *KDSoapClientInterfacePrivate::prepareRequestBuffer(const QString &metho KDSoapMessageWriter msgWriter; msgWriter.setMessageNamespace(m_messageNamespace); msgWriter.setVersion(m_version); - const QByteArray data = msgWriter.messageToXml(message, (m_style == KDSoapClientInterface::RPCStyle) ? method : QString(), headers, m_persistentHeaders); + const QByteArray data = msgWriter.messageToXml(message, (m_style == KDSoapClientInterface::RPCStyle) ? method : QString(), headers, m_persistentHeaders, m_authentication); QBuffer *buffer = new QBuffer; buffer->setData(data); buffer->open(QIODevice::ReadOnly); diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 59e210b64..895e78774 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -44,7 +44,8 @@ void KDSoapMessageWriter::setMessageNamespace(const QString &ns) } QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const QString &method, - const KDSoapHeaders &headers, const QMap &persistentHeaders) const + const KDSoapHeaders &headers, const QMap &persistentHeaders, + const KDSoapAuthentication &authentication) const { QByteArray data; QXmlStreamWriter writer(&data); @@ -73,7 +74,7 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const messageNamespace = message.namespaceUri(); } - if (!headers.isEmpty() || !persistentHeaders.isEmpty() || message.hasMessageAddressingProperties()) { + if (!headers.isEmpty() || !persistentHeaders.isEmpty() || message.hasMessageAddressingProperties() || authentication.hasWSUsernameTokenHeader()) { // This writeNamespace line adds the xmlns:n1 to , which looks ugly and unusual (and breaks all unittests) // However it's the best solution in case of headers, otherwise we get n1 in the header and n2 in the body, // and xsi:type attributes that refer to n1, which isn't defined in the body... @@ -88,6 +89,9 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const if (message.hasMessageAddressingProperties()) { message.messageAddressingProperties().writeMessageAddressingProperties(namespacePrefixes, writer, messageNamespace, true); } + if (authentication.hasWSUsernameTokenHeader()) { + authentication.writeWSUsernameTokenHeader(namespacePrefixes, writer, messageNamespace, true); + } writer.writeEndElement(); // Header } else { // So in the standard case (no headers) we just rely on Qt calling it n1 and insert it into the map. diff --git a/src/KDSoapClient/KDSoapMessageWriter_p.h b/src/KDSoapClient/KDSoapMessageWriter_p.h index 6bf921889..37828ce88 100644 --- a/src/KDSoapClient/KDSoapMessageWriter_p.h +++ b/src/KDSoapClient/KDSoapMessageWriter_p.h @@ -24,6 +24,7 @@ #define KDSOAPMESSAGEWRITER_P_H #include "KDSoapMessage.h" +#include "KDSoapAuthentication.h" #include "KDSoapClientInterface.h" #include #include @@ -49,7 +50,8 @@ class KDSOAP_EXPORT KDSoapMessageWriter QByteArray messageToXml(const KDSoapMessage &message, const QString &method /*empty in document style*/, const KDSoapHeaders &headers, - const QMap &persistentHeaders) const; + const QMap &persistentHeaders, + const KDSoapAuthentication &authentication = KDSoapAuthentication()) const; private: QString m_messageNamespace; diff --git a/src/KDSoapClient/KDSoapNamespaceManager.cpp b/src/KDSoapClient/KDSoapNamespaceManager.cpp index 6b8b15594..2986a3587 100644 --- a/src/KDSoapClient/KDSoapNamespaceManager.cpp +++ b/src/KDSoapClient/KDSoapNamespaceManager.cpp @@ -70,3 +70,13 @@ QString KDSoapNamespaceManager::soapMessageAddressing() { return QString::fromLatin1("http://www.w3.org/2005/08/addressing"); } + +QString KDSoapNamespaceManager::soapSecurityExtention() +{ + return QString::fromLatin1("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"); +} + +QString KDSoapNamespaceManager::soapSecurityUtility() +{ + return QString::fromLatin1("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"); +} diff --git a/src/KDSoapClient/KDSoapNamespaceManager.h b/src/KDSoapClient/KDSoapNamespaceManager.h index eb8aca17b..a0817c94f 100644 --- a/src/KDSoapClient/KDSoapNamespaceManager.h +++ b/src/KDSoapClient/KDSoapNamespaceManager.h @@ -41,6 +41,8 @@ class KDSOAP_EXPORT KDSoapNamespaceManager //krazy:exclude=dpointer static QString soapEncoding(); static QString soapEncoding200305(); static QString soapMessageAddressing(); + static QString soapSecurityExtention(); + static QString soapSecurityUtility(); private: // TODO instantiate to handle custom namespaces per clientinterface KDSoapNamespaceManager(); diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 584409874..f059a721f 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -71,6 +71,7 @@ add_subdirectory(encapsecurity) add_subdirectory(prefix_wsdl) add_subdirectory(vidyo) add_subdirectory(ws_addressing_support) +add_subdirectory(ws_usernametoken_support) add_subdirectory(empty_element_wsdl) # These need internet access diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 40c9a6a27..19eb996a7 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -45,7 +45,8 @@ SUBDIRS = \ date_example \ dv_terminalauth \ test_calc \ - ws_addressing_support + ws_addressing_support \ + ws_usernametoken_support # These need internet access SUBDIRS += webcalls webcalls_wsdl diff --git a/unittests/ws_usernametoken_support/CMakeLists.txt b/unittests/ws_usernametoken_support/CMakeLists.txt new file mode 100644 index 000000000..4eb1ba39c --- /dev/null +++ b/unittests/ws_usernametoken_support/CMakeLists.txt @@ -0,0 +1,8 @@ +project(ws_usernametoken_support) + +set(WSDL_FILES wsusernametoken.wsdl) +set(ws_usernametoken_support_SRCS wsusernametokentest.cpp ) + +set(EXTRA_LIBS ${QT_QTXML_LIBRARY}) + +add_unittest(${ws_usernametoken_support_SRCS} ) diff --git a/unittests/ws_usernametoken_support/ws_usernametoken_support.pro b/unittests/ws_usernametoken_support/ws_usernametoken_support.pro new file mode 100644 index 000000000..480de2c1b --- /dev/null +++ b/unittests/ws_usernametoken_support/ws_usernametoken_support.pro @@ -0,0 +1,9 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = wsusernametokentest.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = wsusernametoken.wsdl diff --git a/unittests/ws_usernametoken_support/wsusernametoken.wsdl b/unittests/ws_usernametoken_support/wsusernametoken.wsdl new file mode 100644 index 000000000..fbb67b5da --- /dev/null +++ b/unittests/ws_usernametoken_support/wsusernametoken.wsdl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSDL File for HelloService + + + + + + http://localhost:8081/hello + + example:Inventory + + + 123456789 + ABCDEFG + + + + + + diff --git a/unittests/ws_usernametoken_support/wsusernametokentest.cpp b/unittests/ws_usernametoken_support/wsusernametokentest.cpp new file mode 100644 index 000000000..a10e3272f --- /dev/null +++ b/unittests/ws_usernametoken_support/wsusernametokentest.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2019 Casper Meijn +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +#include "httpserver_p.h" + +#include +#include + +#include "KDSoapNamespaceManager.h" +#include "KDSoapAuthentication.h" +#include "wsdl_wsusernametoken.h" + +using namespace KDSoapUnitTestHelpers; + +class WSUsernameTokenTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void shouldWriteAProperSoapMessageWithRightUsernameToken() + { + // GIVEN + HttpServerThread server(emptyResponse(), HttpServerThread::Public); + KDSoapClientInterface client(server.endPoint(), "http://www.ecerami.com/wsdl/HelloService"); + + KDSoapAuthentication auth; + auth.setUser("admin"); + auth.setPassword("userpassword"); + auth.setUseWSUsernameToken(true); + + // Override the nonce and timestamp to make the test output consistent. + auth.setOverrideWSUsernameNonce(QByteArray::fromBase64("LKqI6G/AikKCQrN0zqZFlg==")); + auth.setOverrideWSUsernameCreatedTime(QDateTime(QDate(2010, 9, 16), QTime(7, 50, 45), Qt::UTC));//2010-09-16T07:50:45Z + + client.setAuthentication(auth); + + // make a request + KDSoapMessage message; + const QString action = QString::fromLatin1("sayHello"); + message.setUse(KDSoapMessage::EncodedUse); + message.addArgument(QString::fromLatin1("msg"), QVariant::fromValue(QString("HelloContentMessage")), KDSoapNamespaceManager::xmlSchema2001(), QString::fromLatin1("string")); + message.setNamespaceUri(QString::fromLatin1("http://www.ecerami.com/wsdl/HelloService.wsdl")); + + // WHEN + KDSoapMessage reply = client.call(QLatin1String("sayHello"), message, action); + + // THEN + QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage())); + } + +private: + static QByteArray expectedSoapMessage() + { + return QByteArray(xmlEnvBegin11()) + + " xmlns:n1=\"http://www.ecerami.com/wsdl/HelloService.wsdl\">" + " " + " " + " " + " LKqI6G/AikKCQrN0zqZFlg== " + " 2010-09-16T07:50:45Z " + " tuOSpGlFlIXsozq4HFNeeGeFLEI= " + " admin " + " " + " " + " " + " " + " HelloContentMessage " + " " + xmlEnvEnd(); + } + + static QByteArray emptyResponse() + { + return QByteArray(xmlEnvBegin11()) + ">"; + } +}; + +QTEST_MAIN(WSUsernameTokenTest) + +#include "wsusernametokentest.moc" From cd831ccb223bd421feb436c78fa7274fe80e02fb Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 12:46:26 +0100 Subject: [PATCH 004/679] Fix if a referenced type name has an extra space in it. E.g. allow the type name "xs:string " to work. For when you can't fix the source WSDL. --- kdwsdl2cpp/schema/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/schema/parser.cpp b/kdwsdl2cpp/schema/parser.cpp index 687e03580..adb32d835 100644 --- a/kdwsdl2cpp/schema/parser.cpp +++ b/kdwsdl2cpp/schema/parser.cpp @@ -487,7 +487,7 @@ Element Parser::parseElement(ParserContext *context, newElement.setNillable(stringToBoolean(element.attribute(QLatin1String("nillable")))); if (element.hasAttribute(QLatin1String("type"))) { - QName typeName(element.attribute(QLatin1String("type"))); + QName typeName(element.attribute(QLatin1String("type")).trimmed()); typeName.setNameSpace(context->namespaceManager()->uri(typeName.prefix())); if (debugParsing()) { qDebug() << "typeName=" << typeName.qname() << "namespace=" << context->namespaceManager()->uri(typeName.prefix()); From 65cf2fe9f4fd09e0bf0420b2f9227d08611d667b Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 13:04:30 +0100 Subject: [PATCH 005/679] - Add support for setting request headers for KDSoapJob - Rename "KDSoapJob::returnHeaders" to "KDSoapJob::replyHeaders" and actually provide an implementation --- kdwsdl2cpp/src/converter_clientstub.cpp | 1 + src/KDSoapClient/KDSoapClientInterface.cpp | 2 +- src/KDSoapClient/KDSoapClientInterface.h | 2 +- src/KDSoapClient/KDSoapJob.cpp | 16 ++++++++++++++++ src/KDSoapClient/KDSoapJob.h | 14 +++++++++++++- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index fb5c6803a..577d35714 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -385,6 +385,7 @@ bool Converter::convertClientService() if (hasAction) { callLine += QLatin1String(", action"); } + callLine += QLatin1String(", requestHeaders()"); callLine += QLatin1String(");"); doStartCode += callLine; diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 2b8470aab..2ede473f1 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -58,7 +58,7 @@ void KDSoapClientInterface::setSoapVersion(KDSoapClientInterface::SoapVersion ve d->m_version = static_cast(version); } -KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() +KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() const { return static_cast(d->m_version); } diff --git a/src/KDSoapClient/KDSoapClientInterface.h b/src/KDSoapClient/KDSoapClientInterface.h index 3b1039e02..d5c21803b 100644 --- a/src/KDSoapClient/KDSoapClientInterface.h +++ b/src/KDSoapClient/KDSoapClientInterface.h @@ -197,7 +197,7 @@ class KDSOAP_EXPORT KDSoapClientInterface /** * Returns the version of SOAP being used in this instance. */ - KDSoapClientInterface::SoapVersion soapVersion(); + KDSoapClientInterface::SoapVersion soapVersion() const; /** * Returns the end point of the SOAP service. diff --git a/src/KDSoapClient/KDSoapJob.cpp b/src/KDSoapClient/KDSoapJob.cpp index 87eb3b662..0793b4459 100644 --- a/src/KDSoapClient/KDSoapJob.cpp +++ b/src/KDSoapClient/KDSoapJob.cpp @@ -27,6 +27,7 @@ class KDSoapJob::Private { public: + KDSoapHeaders requestHeaders; KDSoapMessage reply; KDSoapHeaders replyHeaders; bool isAutoDelete; @@ -44,6 +45,16 @@ KDSoapJob::~KDSoapJob() delete d; } +KDSoapHeaders KDSoapJob::requestHeaders() const +{ + return d->requestHeaders; +} + +void KDSoapJob::setRequestHeaders(const KDSoapHeaders &headers) +{ + d->requestHeaders = headers; +} + void KDSoapJob::start() { QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection); @@ -69,6 +80,11 @@ KDSoapMessage KDSoapJob::reply() const return d->reply; } +KDSoapHeaders KDSoapJob::replyHeaders() const +{ + return d->replyHeaders; +} + bool KDSoapJob::isFault() const { return d->reply.isFault(); diff --git a/src/KDSoapClient/KDSoapJob.h b/src/KDSoapClient/KDSoapJob.h index d3198515f..46fdbe2a4 100644 --- a/src/KDSoapClient/KDSoapJob.h +++ b/src/KDSoapClient/KDSoapJob.h @@ -78,6 +78,18 @@ class KDSOAP_EXPORT KDSoapJob : public QObject */ ~KDSoapJob(); + /** + * Returns the reply headers received from the SOAP server once the request was completed. + * Only valid once the request is completed and finished() was emitted. + */ + KDSoapHeaders requestHeaders() const; + + /** + * Sets request headers to be sent to the SOAP server. These are sent in addition + * to the persistent headers set via the client interface. + */ + void setRequestHeaders(const KDSoapHeaders &headers); + /** * Returns whether the reply message (see reply()) represents a fault. */ @@ -98,7 +110,7 @@ class KDSOAP_EXPORT KDSoapJob : public QObject * Returns the reply headers received from the SOAP server once the request was completed. * Only valid once the request is completed and finished() was emitted. */ - KDSoapHeaders returnHeaders() const; + KDSoapHeaders replyHeaders() const; /** * Starts the job. The job will emit finished() once done. From da6979ce3fb5d60dd346ea318f498f442bcd8822 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 1 Feb 2019 13:22:35 +0100 Subject: [PATCH 006/679] Add changelog entry for last merge --- doc/CHANGES_1_8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index a39bbdd65..3c5dd7418 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -1,6 +1,7 @@ General: ======== * Fix internally-created faults lacking an XML element name (so e.g. toXml() would abort) +* KDSoapMessage::messageAddressingProperties() is now correctly filled in when receiving a message with WS-Addressing in the header Client-side: ============ From 4a76cc0898533d540770b3ea66fbb3c6227c91f8 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 14:10:15 +0100 Subject: [PATCH 007/679] - Add ability to generate both .h and .cpp file in one run of kdwsdl2cpp - Add support for namespace-mapping to control class-name generation (e.g. to generate "FOO__MyClass" instead of "TNS__MyClass") - Add endpoint() and soapVersion() accessors in generated Wsdl Service classes - Fixes to prevent generate of some bad classes --- kdwsdl2cpp/libkode/style.cpp | 3 + kdwsdl2cpp/src/compiler.cpp | 15 ++- kdwsdl2cpp/src/converter_clientstub.cpp | 20 ++++ kdwsdl2cpp/src/converter_complextype.cpp | 4 +- kdwsdl2cpp/src/creator.cpp | 51 +++++----- kdwsdl2cpp/src/creator.h | 18 +++- kdwsdl2cpp/src/main.cpp | 105 +++++++++++++++++++-- kdwsdl2cpp/src/settings.cpp | 37 ++++++-- kdwsdl2cpp/src/settings.h | 19 ++-- src/KDSoapClient/KDSoapClientInterface.cpp | 2 +- src/KDSoapClient/KDSoapClientInterface.h | 2 +- 11 files changed, 223 insertions(+), 53 deletions(-) diff --git a/kdwsdl2cpp/libkode/style.cpp b/kdwsdl2cpp/libkode/style.cpp index e981cbede..42aff14e2 100644 --- a/kdwsdl2cpp/libkode/style.cpp +++ b/kdwsdl2cpp/libkode/style.cpp @@ -83,6 +83,9 @@ QString Style::lowerFirst( const QString &str ) QString Style::makeIdentifier( const QString &str ) { + if ( str.isEmpty() ) + return str; + QString identifier = str; identifier.replace( "-", "_" ); identifier.replace( ".", "_" ); diff --git a/kdwsdl2cpp/src/compiler.cpp b/kdwsdl2cpp/src/compiler.cpp index 1076faa5e..7075b77ec 100644 --- a/kdwsdl2cpp/src/compiler.cpp +++ b/kdwsdl2cpp/src/compiler.cpp @@ -103,7 +103,6 @@ void Compiler::parse(const QDomElement &element) definitions.fixUpDefinitions(/*&context, element*/); - KODE::Code::setDefaultIndentation(4); WSDL wsdl; wsdl.setDefinitions(definitions); @@ -116,7 +115,19 @@ void Compiler::parse(const QDomElement &element) QCoreApplication::exit(4); } else { KWSDL::Creator creator; - creator.create(converter.classes()); + creator.setOutputDirectory(Settings::self()->outputDirectory()); + creator.setSourceFile(Settings::self()->wsdlFileName()); + creator.setHeaderFileName(Settings::self()->headerFileName()); + creator.setImplementationFileName(Settings::self()->implementationFileName()); + + creator.setClasses(converter.classes()); + if (Settings::self()->generateHeader()) { + creator.createHeader(); + } + if (Settings::self()->generateImplementation()) { + creator.createImplementation(); + } + QCoreApplication::exit(0); } } else { diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index fb5c6803a..86acc62b0 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -164,6 +164,16 @@ bool Converter::convertClientService() setEndPoint.setDocs(QLatin1String("Overwrite the end point defined in the .wsdl file, with another http/https URL.")); newClass.addFunction(setEndPoint); } + // endPoint() accessor + { + KODE::Function getEndPoint(QLatin1String("endPoint"), QLatin1String("QString")); + getEndPoint.setConst(true); + KODE::Code code; + code += "return d_ptr->m_endPoint;"; + getEndPoint.setBody(code); + getEndPoint.setDocs(QLatin1String("Return the end point that will be used.")); + newClass.addFunction(getEndPoint); + } //setSoapVersion() method { KODE::Function setSoapVersion(QLatin1String("setSoapVersion"), QLatin1String("void")); @@ -175,6 +185,16 @@ bool Converter::convertClientService() "version can be KDSoapClientInterface::SOAP1_1 or KDSoapClientInterface::SOAP1_2")); newClass.addFunction(setSoapVersion); } + //soapVersion() method + { + KODE::Function getSoapVersion(QLatin1String("soapVersion"), QLatin1String("KDSoapClientInterface::SoapVersion")); + getSoapVersion.setConst(true); + KODE::Code code; + code += "return clientInterface()->soapVersion();"; + getSoapVersion.setBody(code); + getSoapVersion.setDocs(QLatin1String("Return the soap version used.n")); + newClass.addFunction(getSoapVersion); + } // lastErrorCode() method { KODE::Function lastError(QLatin1String("lastErrorCode"), QLatin1String("int")); diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 97932e911..0ae9727ff 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -192,7 +192,8 @@ void Converter::convertComplexType(const XSD::ComplexType *type) typeName = mTypeMap.localType(attribute.type()); if (typeName.isEmpty()) { - qDebug() << "ERROR: attribute with unknown type:" << attribute.name() << attribute.type() << "in" << typeName; + qWarning() << "ERROR: attribute with unknown type:" << attribute.name() << attribute.type() << "in" << typeName; + continue; } inputTypeName = mTypeMap.localInputType(attribute.type(), QName()); //qDebug() << "Attribute" << attribute.name(); @@ -643,6 +644,7 @@ void Converter::createComplexTypeSerializer(KODE::Class &newClass, const XSD::Co bool first = true; Q_FOREACH (const XSD::Attribute &attribute, attributes) { const QString attrName = attribute.name(); + if (attrName.isEmpty()) { continue; } const QString variableName = QLatin1String("d_ptr->") + KODE::MemberVariable::memberVariableName(attrName); demarshalCode.addBlock(demarshalNameTest(attribute.type(), attrName, &first)); diff --git a/kdwsdl2cpp/src/creator.cpp b/kdwsdl2cpp/src/creator.cpp index 0ea3a1b43..e9b87e154 100644 --- a/kdwsdl2cpp/src/creator.cpp +++ b/kdwsdl2cpp/src/creator.cpp @@ -31,43 +31,44 @@ using namespace KWSDL; Creator::Creator() { -} - -void Creator::create(const KODE::Class::List &classes) -{ - KODE::Printer printer; - printer.setOutputDirectory(Settings::self()->outputDirectory()); + KODE::Code::setDefaultIndentation(4); // Set generated header details. - printer.setCreationWarning(true); - printer.setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); - printer.setSourceFile(Settings::self()->wsdlFileName()); + setCreationWarning(true); + setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); // Qt-like coding style - printer.setLabelsDefineIndent(false); - printer.setIndentLabels(false); + setLabelsDefineIndent(false); + setIndentLabels(false); - //qDebug() << "Create server=" << Settings::self()->generateServerCode() << "impl=" << Settings::self()->generateImplementation(); - KODE::File file; + _file.setLicense(KODE::License::GeneratedNoRestriction); +} - if (Settings::self()->generateImplementation()) { - file.setImplementationFilename(Settings::self()->outputFileName()); - file.setHeaderFilename(Settings::self()->headerFile()); - } else { - file.setHeaderFilename(Settings::self()->outputFileName()); +void Creator::setHeaderFileName(const QString &headerFileName) +{ + _file.setHeaderFilename(headerFileName); } - file.setLicense(KODE::License::GeneratedNoRestriction); +void Creator::setImplementationFileName(const QString &implementationFileName) +{ + _file.setImplementationFilename(implementationFileName); +} +void Creator::setClasses(const KODE::Class::List &list) +{ KODE::Class::List::ConstIterator it; - for (it = classes.constBegin(); it != classes.constEnd(); ++it) { - file.insertClass(*it); + for (it = list.constBegin(); it != list.constEnd(); ++it) { + _file.insertClass(*it); + } } - if (Settings::self()->generateImplementation()) { - printer.printImplementation(file); - } else { - printer.printHeader(file); +void Creator::createHeader() +{ + printHeader(_file); } + +void Creator::createImplementation() +{ + printImplementation(_file); } diff --git a/kdwsdl2cpp/src/creator.h b/kdwsdl2cpp/src/creator.h index ec891997d..b808e484e 100644 --- a/kdwsdl2cpp/src/creator.h +++ b/kdwsdl2cpp/src/creator.h @@ -21,16 +21,30 @@ #define KWSDL_CREATOR_H #include +#include +#include +#include namespace KWSDL { -class Creator +class Creator : private KODE::Printer { public: Creator(); - void create(const KODE::Class::List &list); + using KODE::Printer::setOutputDirectory; + using KODE::Printer::setSourceFile; + + void setHeaderFileName(const QString &headerFileName); + void setImplementationFileName(const QString &implementationFileName); + void setClasses(const KODE::Class::List &list); + + void createHeader(); + void createImplementation(); + +private: + KODE::File _file; }; } diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index 29b15f486..e50e51043 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -28,20 +28,32 @@ #include static const char *WSDL2CPP_DESCRIPTION = "KDAB's WSDL to C++ compiler"; -static const char *WSDL2CPP_VERSION_STR = "2.0"; +static const char *WSDL2CPP_VERSION_STR = "2.1"; static void showHelp(const char *appName) { fprintf(stderr, "%s %s\n", WSDL2CPP_DESCRIPTION, WSDL2CPP_VERSION_STR); - fprintf(stderr, "Usage: %s [options] [-impl ] \n\n" + fprintf(stderr, + "Usage:\n" + " Header file: %s [options] -o \n" + " Impl. file: %s [options] -o -impl \n" + " Both files : %s [options] -both \n" + "\n" + "Options:\n" " -h, -help display this help and exit\n" " -v, -version display version\n" " -s, -service name of the service to generate\n" - " -o generate the header file into \n" - " -impl generate the implementation file, and #include \n" + " -o output the generated file into \n" + " -impl generate the implementation(.cpp) file, and #include \n" + " -both generate both the header(.h) and the implementation(.cpp) file\n" " -server generate server-side base class, instead of client service\n" " -exportMacro set the export declaration to use for generated classes\n" " -namespace put all generated classes into the given C++ namespace\n" + " -namespaceMapping \n" + " add the uri=code mapping\n" + " if begins with '@', read from file instead\n" + " one entry per line\n" + " (affects the generated class names)\n" " -optional-element-type \n" " use as the getter return value for optional elements.\n" " can be either raw-pointer or boost-optional\n" @@ -55,7 +67,7 @@ static void showHelp(const char *appName) " use of the import-path option\n" " -help-on-missing When groups or basic types could not be found, display\n" " available types (helps with wrong namespaces)\n" - "\n", appName); + "\n", appName, appName, appName); } int main(int argc, char **argv) @@ -64,12 +76,15 @@ int main(int argc, char **argv) const char *fileName = 0; QFileInfo outputFile; + bool both = false; bool impl = false; bool server = false; + QString baseFile; QString headerFile; QString serviceName; QString exportMacro; QString nameSpace; + Settings::NSMapping nsmapping; // XML mappings from URL to short code Settings::OptionalElementType optionalElementType = Settings::ENone; bool keepUnusedTypes = false; QStringList importPathList; @@ -90,6 +105,15 @@ int main(int argc, char **argv) return 1; } headerFile = QFile::decodeName(argv[arg]); + } else if (opt == QLatin1String("-both")) { + both = true; + ++arg; + if (!argv[arg]) { + showHelp(argv[0]); + return 1; + } + baseFile = QFile::decodeName(argv[arg]); + outputFile.setFile(baseFile); } else if (opt == QLatin1String("-server")) { server = true; } else if (opt == QLatin1String("-v") || opt == QLatin1String("-version")) { @@ -123,6 +147,40 @@ int main(int argc, char **argv) return 1; } nameSpace = argv[arg]; + } else if (opt == QLatin1String("-namespaceMapping")) { + ++arg; + if (!argv[arg]) { + showHelp(argv[0]); + return 1; + } + QString mapping = argv[arg]; + if (mapping.startsWith('@')) { + QString mappingFileName = mapping.mid(1); + QFile file(mappingFileName); + if (!file.open(QIODevice::ReadOnly)) { + fprintf(stderr, "Error reading %s: %s\n", mappingFileName.toLatin1().data(), file.errorString().toLatin1().data()); + showHelp(argv[0]); + return 1; + } + + while(!file.atEnd()) { + QString mapping = file.readLine().trimmed(); + if (mapping.startsWith("#")) { continue; } + + QString uri = mapping.section("=", 0, -2); + QString target = mapping.section("=", -1, -1); + if (!uri.isEmpty() && !target.isEmpty()) { + nsmapping[uri] = target; + //fprintf(stderr, "%s = %s\n", uri.toLatin1().data(), target.toLatin1().data()); + } + } + + } else { + QString uri = mapping.section("=", 0, -2); + QString target = mapping.section("=", -1, -1); + nsmapping[uri] = target; + //fprintf(stderr, "%s = %s\n", uri.toLatin1().data(), target.toLatin1().data()); + } } else if (opt == QLatin1String("-optional-element-type")) { ++arg; if (!argv[arg]) { @@ -163,19 +221,52 @@ int main(int argc, char **argv) return 1; } + // if you're saying "just make the impl-file", you can't + // also say "make both the header and the impl" + if (both && impl) { + showHelp(argv[0]); + return 1; + } + + + if (both) { + Settings::self()->setGenerateHeader(true); + Settings::self()->setGenerateImplementation(true); + Settings::self()->setHeaderFileName(baseFile + ".h"); + Settings::self()->setImplementationFileName(baseFile + ".cpp"); + } + else if (impl) { + Settings::self()->setGenerateHeader(false); + Settings::self()->setGenerateImplementation(true); + Settings::self()->setHeaderFileName(headerFile); + Settings::self()->setImplementationFileName(outputFile.fileName()); + } + else { + Settings::self()->setGenerateHeader(true); + Settings::self()->setGenerateImplementation(false); + Settings::self()->setHeaderFileName(outputFile.fileName()); + Settings::self()->setImplementationFileName("UNUSED"); + } + + Settings::self()->setGenerateServerCode(server); - Settings::self()->setGenerateImplementation(impl, headerFile); - Settings::self()->setOutputFileName(outputFile.fileName()); Settings::self()->setOutputDirectory(outputFile.absolutePath()); Settings::self()->setWsdlFile(fileName); Settings::self()->setWantedService(serviceName); Settings::self()->setExportDeclaration(exportMacro); Settings::self()->setNameSpace(nameSpace); + Settings::self()->setNamespaceMapping(nsmapping); Settings::self()->setOptionalElementType(optionalElementType); Settings::self()->setKeepUnusedTypes(keepUnusedTypes); Settings::self()->setImportPathList(importPathList); Settings::self()->setUseLocalFilesOnly(useLocalFilesOnly); Settings::self()->setHelpOnMissing(helpOnMissing); + + //fprintf(stderr, "Output dir: %s\n", Settings::self()->outputDirectory().toLatin1().data()); + //fprintf(stderr, "HeaderFile: %s\n", Settings::self()->headerFileName().toLatin1().data()); + //fprintf(stderr, "Impl File: %s\n", Settings::self()->implementationFileName().toLatin1().data()); + //fprintf(stderr, "Generate: header? %d implementation? %d\n", Settings::self()->generateHeader(), Settings::self()->generateImplementation()); + KWSDL::Compiler compiler; // so that we have an event loop, for downloads diff --git a/kdwsdl2cpp/src/settings.cpp b/kdwsdl2cpp/src/settings.cpp index a83f3bfbc..c197bc437 100644 --- a/kdwsdl2cpp/src/settings.cpp +++ b/kdwsdl2cpp/src/settings.cpp @@ -39,7 +39,8 @@ Q_GLOBAL_STATIC(SettingsSingleton, s_settings) Settings::Settings() { mOutputDirectory = QDir::current().path(); - mOutputFileName = QString::fromLatin1("kwsdl_generated"); + mHeaderFileName = QString::fromLatin1("kwsdl_generated"); + mImplementationFileName = QString::fromLatin1("kwsdl_generated"); mImpl = false; mServer = false; mKeepUnusedTypes = false; @@ -101,11 +102,17 @@ QString Settings::wsdlFileName() const return strUrl.mid(strUrl.lastIndexOf(QLatin1Char('/')) + 1); } -void Settings::setOutputFileName(const QString &outputFileName) +void Settings::setHeaderFileName(const QString &headerFileName) { - mOutputFileName = outputFileName; + mHeaderFileName = headerFileName; } +void Settings::setImplementationFileName(const QString &implementationFileName) +{ + mImplementationFileName = implementationFileName; +} + +/* QString Settings::outputFileName() const { if (mOutputFileName.isEmpty()) { @@ -115,6 +122,7 @@ QString Settings::outputFileName() const return mOutputFileName; } +*/ void Settings::setOutputDirectory(const QString &outputDirectory) { @@ -160,10 +168,9 @@ Settings::NSMapping Settings::namespaceMapping() const return mNamespaceMapping; } -void Settings::setGenerateImplementation(bool b, const QString &headerFile) +void Settings::setGenerateImplementation(bool b) { mImpl = b; - mHeaderFile = headerFile; } bool Settings::generateImplementation() const @@ -171,11 +178,27 @@ bool Settings::generateImplementation() const return mImpl; } -QString Settings::headerFile() const +void Settings::setGenerateHeader(bool b) +{ + mHeader = b; +} + +bool Settings::generateHeader() const { - return mHeaderFile; + return mHeader; } +QString Settings::headerFileName() const +{ + return mHeaderFileName; +} + +QString Settings::implementationFileName() const +{ + return mImplementationFileName; +} + + void Settings::setWantedService(const QString &service) { mWantedService = service; diff --git a/kdwsdl2cpp/src/settings.h b/kdwsdl2cpp/src/settings.h index 1717e571e..17f6cb04e 100644 --- a/kdwsdl2cpp/src/settings.h +++ b/kdwsdl2cpp/src/settings.h @@ -35,9 +35,16 @@ class Settings static Settings *self(); - void setGenerateImplementation(bool b, const QString &headerFile); + void setImplementationFileName(const QString &implFileName); + void setHeaderFileName(const QString &implFileName); + QString headerFileName() const; + QString implementationFileName() const; + + void setGenerateImplementation(bool b); bool generateImplementation() const; - QString headerFile() const; + + void setGenerateHeader(bool b); + bool generateHeader() const; void setGenerateServerCode(bool b); bool generateServerCode() const; @@ -47,9 +54,6 @@ class Settings QString wsdlBaseUrl() const; QString wsdlFileName() const; - void setOutputFileName(const QString &outputFileName); - QString outputFileName() const; - void setOutputDirectory(const QString &outputDirectory); QString outputDirectory() const; @@ -86,14 +90,15 @@ class Settings Settings(); QUrl mWsdlUrl; - QString mOutputFileName; QString mOutputDirectory; - QString mHeaderFile; + QString mHeaderFileName; + QString mImplementationFileName; QString mWantedService; QString mExportDeclaration; QString mNameSpace; QStringList mImportPathList; NSMapping mNamespaceMapping; + bool mHeader; bool mImpl; bool mServer; OptionalElementType mOptionalElementType; diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 2b8470aab..2ede473f1 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -58,7 +58,7 @@ void KDSoapClientInterface::setSoapVersion(KDSoapClientInterface::SoapVersion ve d->m_version = static_cast(version); } -KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() +KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() const { return static_cast(d->m_version); } diff --git a/src/KDSoapClient/KDSoapClientInterface.h b/src/KDSoapClient/KDSoapClientInterface.h index 3b1039e02..d5c21803b 100644 --- a/src/KDSoapClient/KDSoapClientInterface.h +++ b/src/KDSoapClient/KDSoapClientInterface.h @@ -197,7 +197,7 @@ class KDSOAP_EXPORT KDSoapClientInterface /** * Returns the version of SOAP being used in this instance. */ - KDSoapClientInterface::SoapVersion soapVersion(); + KDSoapClientInterface::SoapVersion soapVersion() const; /** * Returns the end point of the SOAP service. From 6f7263587d614e25543b6d450d1e4feffcb4eb91 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 1 Feb 2019 14:22:48 +0100 Subject: [PATCH 008/679] Fix compilation with Qt <= 5.9 --- .../wsaddressingtest.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/unittests/ws_addressing_support/wsaddressingtest.cpp b/unittests/ws_addressing_support/wsaddressingtest.cpp index 73ca7708c..c5dc9f655 100644 --- a/unittests/ws_addressing_support/wsaddressingtest.cpp +++ b/unittests/ws_addressing_support/wsaddressingtest.cpp @@ -90,26 +90,26 @@ private Q_SLOTS: // THEN QVERIFY(reply.hasMessageAddressingProperties()); KDSoapMessageAddressingProperties map = reply.messageAddressingProperties(); - QCOMPARE(map.action(), "sayHello"); - QCOMPARE(map.destination(), "http://www.ecerami.com/wsdl/HelloService"); - QCOMPARE(map.sourceEndpointAddress(), "http://www.ecerami.com/wsdl/source"); - QCOMPARE(map.faultEndpointAddress(), "http://www.ecerami.com/wsdl/fault"); - QCOMPARE(map.messageID(), "uuid:e197db59-0982-4c9c-9702-4234d204f7f4"); - QCOMPARE(map.replyEndpointAddress(), "http://www.w3.org/2005/08/addressing/anonymous"); - QCOMPARE(map.relationships().at(0).uri, "uuid:http://www.ecerami.com/wsdl/someUniqueString"); - QCOMPARE(map.relationships().at(0).relationshipType, "http://www.w3.org/2005/08/addressing/reply"); - QCOMPARE(map.relationships().at(1).uri, "uuid:http://www.ecerami.com/wsdl/someUniqueStringBis"); - QCOMPARE(map.relationships().at(1).relationshipType, "CustomTypeReply"); - QCOMPARE(map.referenceParameters().at(0).name(), "myReferenceParameter"); - QCOMPARE(map.referenceParameters().at(0).value().toString(), "ReferencParameterContent"); - QCOMPARE(map.referenceParameters().at(1).name(), "myReferenceParameterWithChildren"); + QCOMPARE(map.action(), QString("sayHello")); + QCOMPARE(map.destination(), QString("http://www.ecerami.com/wsdl/HelloService")); + QCOMPARE(map.sourceEndpointAddress(), QString("http://www.ecerami.com/wsdl/source")); + QCOMPARE(map.faultEndpointAddress(), QString("http://www.ecerami.com/wsdl/fault")); + QCOMPARE(map.messageID(), QString("uuid:e197db59-0982-4c9c-9702-4234d204f7f4")); + QCOMPARE(map.replyEndpointAddress(), QString("http://www.w3.org/2005/08/addressing/anonymous")); + QCOMPARE(map.relationships().at(0).uri, QString("uuid:http://www.ecerami.com/wsdl/someUniqueString")); + QCOMPARE(map.relationships().at(0).relationshipType, QString("http://www.w3.org/2005/08/addressing/reply")); + QCOMPARE(map.relationships().at(1).uri, QString("uuid:http://www.ecerami.com/wsdl/someUniqueStringBis")); + QCOMPARE(map.relationships().at(1).relationshipType, QString("CustomTypeReply")); + QCOMPARE(map.referenceParameters().at(0).name(), QString("myReferenceParameter")); + QCOMPARE(map.referenceParameters().at(0).value().toString(), QString("ReferencParameterContent")); + QCOMPARE(map.referenceParameters().at(1).name(), QString("myReferenceParameterWithChildren")); QCOMPARE(map.referenceParameters().at(1).childValues().size(), 2); - QCOMPARE(map.metadata().at(0).name(), "myMetadata"); - QCOMPARE(map.metadata().at(0).value().toString(), "MetadataContent"); - QCOMPARE(map.metadata().at(1).name(), "myMetadataBis"); + QCOMPARE(map.metadata().at(0).name(), QString("myMetadata")); + QCOMPARE(map.metadata().at(0).value().toString(), QString("MetadataContent")); + QCOMPARE(map.metadata().at(1).name(), QString("myMetadataBis")); QCOMPARE(map.metadata().at(1).childValues().size(), 1); - QCOMPARE(map.metadata().at(1).childValues().first().name(), "myMetadataBisChild"); - QCOMPARE(map.metadata().at(1).childValues().first().value().toString(), "MetadataBisChildContent"); + QCOMPARE(map.metadata().at(1).childValues().first().name(), QString("myMetadataBisChild")); + QCOMPARE(map.metadata().at(1).childValues().first().value().toString(), QString("MetadataBisChildContent")); } private: From caa80ded14c1cf73380a605418b86f1e59332c68 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 14:29:49 +0100 Subject: [PATCH 009/679] - Cache downloads. Prevents redownloading the same imported file twice. --- kdwsdl2cpp/common/fileprovider.cpp | 45 +++++++++++++++++++----------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/kdwsdl2cpp/common/fileprovider.cpp b/kdwsdl2cpp/common/fileprovider.cpp index 912f2f060..d2932e757 100644 --- a/kdwsdl2cpp/common/fileprovider.cpp +++ b/kdwsdl2cpp/common/fileprovider.cpp @@ -37,6 +37,9 @@ #include #endif +QHash fileProviderCache; + + FileProvider::FileProvider() : QObject( 0 ) { @@ -94,30 +97,38 @@ bool FileProvider::get( const QUrl &url, QString &target ) mFileName = target; } - qDebug("Downloading '%s'", url.toEncoded().constData()); - - QNetworkAccessManager manager; - QNetworkRequest request(url); - QNetworkReply* job = manager.get(request); - - QEventLoop loop; - connect(job, SIGNAL(finished()), - &loop, SLOT(quit())); - loop.exec(); - - if (job->error()) { - qWarning("Error downloading '%s': %s", url.toEncoded().constData(), qPrintable(job->errorString())); - return false; + QByteArray data; + if (fileProviderCache.contains(url)) { + data = fileProviderCache[url]; + qDebug( "Using cached copy" ); + } else { + qDebug("Downloading '%s'", url.toEncoded().constData()); + + QNetworkAccessManager manager; + QNetworkRequest request(url); + QNetworkReply* job = manager.get(request); + + QEventLoop loop; + connect(job, SIGNAL(finished()), + &loop, SLOT(quit())); + loop.exec(); + + if (job->error()) { + qWarning("Error downloading '%s': %s", url.toEncoded().constData(), qPrintable(job->errorString())); + return false; + } + + qDebug( "Download successful" ); + data = job->readAll(); + fileProviderCache[url] = data; } - const QByteArray data = job->readAll(); QFile file( mFileName ); if ( !file.open( QIODevice::WriteOnly ) ) { - qDebug( "Unable to create temporary file" ); + qDebug( qPrintable("Unable to create temporary file: " + file.errorString()) ); return false; } - qDebug( "Download successful" ); file.write( data ); file.close(); From 48ed0242d66ce996aae1c9f556efc6c06c887d78 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 14:40:41 +0100 Subject: [PATCH 010/679] - Add \since for new functions --- src/KDSoapClient/KDSoapJob.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KDSoapClient/KDSoapJob.h b/src/KDSoapClient/KDSoapJob.h index 46fdbe2a4..dde6d2d91 100644 --- a/src/KDSoapClient/KDSoapJob.h +++ b/src/KDSoapClient/KDSoapJob.h @@ -87,6 +87,8 @@ class KDSOAP_EXPORT KDSoapJob : public QObject /** * Sets request headers to be sent to the SOAP server. These are sent in addition * to the persistent headers set via the client interface. + * + * \since 1.8 */ void setRequestHeaders(const KDSoapHeaders &headers); @@ -109,6 +111,8 @@ class KDSOAP_EXPORT KDSoapJob : public QObject /** * Returns the reply headers received from the SOAP server once the request was completed. * Only valid once the request is completed and finished() was emitted. + * + * \since 1.8 */ KDSoapHeaders replyHeaders() const; From d4370fc29844dad894da4a39a15fc90c9a010173 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 14:54:08 +0100 Subject: [PATCH 011/679] - Fix for coding style, as requested by David --- kdwsdl2cpp/src/converter_complextype.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 0ae9727ff..2307a55ee 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -644,7 +644,9 @@ void Converter::createComplexTypeSerializer(KODE::Class &newClass, const XSD::Co bool first = true; Q_FOREACH (const XSD::Attribute &attribute, attributes) { const QString attrName = attribute.name(); - if (attrName.isEmpty()) { continue; } + if (attrName.isEmpty()) { + continue; + } const QString variableName = QLatin1String("d_ptr->") + KODE::MemberVariable::memberVariableName(attrName); demarshalCode.addBlock(demarshalNameTest(attribute.type(), attrName, &first)); From 9c37ab6a5ccb323447629cf5090f110b5190e65d Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:05:24 +0100 Subject: [PATCH 012/679] - Remove dead code --- kdwsdl2cpp/src/settings.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/kdwsdl2cpp/src/settings.cpp b/kdwsdl2cpp/src/settings.cpp index c197bc437..dbc01ef52 100644 --- a/kdwsdl2cpp/src/settings.cpp +++ b/kdwsdl2cpp/src/settings.cpp @@ -112,18 +112,6 @@ void Settings::setImplementationFileName(const QString &implementationFileName) mImplementationFileName = implementationFileName; } -/* -QString Settings::outputFileName() const -{ - if (mOutputFileName.isEmpty()) { - QFileInfo fi(wsdlFileName()); - return QLatin1String("wsdl_") + fi.completeBaseName() + QLatin1String(mImpl ? ".cpp" : ".h"); - } - - return mOutputFileName; -} -*/ - void Settings::setOutputDirectory(const QString &outputDirectory) { mOutputDirectory = outputDirectory; From b8622a3a31e57139425c90f1bb2bff4b0c680ee0 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:13:19 +0100 Subject: [PATCH 013/679] - Add check that parameters (-o) and (-both) are not specified at the same time - Code style clean-up - Use QFile::decodeName/QFile::encodeName --- kdwsdl2cpp/src/main.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index e50e51043..0f1055f7c 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -78,6 +78,7 @@ int main(int argc, char **argv) QFileInfo outputFile; bool both = false; bool impl = false; + bool outfileGiven = false; bool server = false; QString baseFile; QString headerFile; @@ -125,6 +126,7 @@ int main(int argc, char **argv) showHelp(argv[0]); return 1; } + outfileGiven = true; outputFile.setFile(QFile::decodeName(argv[arg])); } else if (opt == QLatin1String("-s") || opt == QLatin1String("-service")) { ++arg; @@ -155,15 +157,15 @@ int main(int argc, char **argv) } QString mapping = argv[arg]; if (mapping.startsWith('@')) { - QString mappingFileName = mapping.mid(1); + QString mappingFileName = QFile::decodeName(argv[arg] + 1); // +1 to skip the '@' QFile file(mappingFileName); if (!file.open(QIODevice::ReadOnly)) { - fprintf(stderr, "Error reading %s: %s\n", mappingFileName.toLatin1().data(), file.errorString().toLatin1().data()); + fprintf(stderr, "Error reading %s: %s\n", QFile::encodeName(mappingFileName).constData(), qPrintable(file.errorString())); showHelp(argv[0]); return 1; } - while(!file.atEnd()) { + while (!file.atEnd()) { QString mapping = file.readLine().trimmed(); if (mapping.startsWith("#")) { continue; } @@ -171,7 +173,6 @@ int main(int argc, char **argv) QString target = mapping.section("=", -1, -1); if (!uri.isEmpty() && !target.isEmpty()) { nsmapping[uri] = target; - //fprintf(stderr, "%s = %s\n", uri.toLatin1().data(), target.toLatin1().data()); } } @@ -179,7 +180,6 @@ int main(int argc, char **argv) QString uri = mapping.section("=", 0, -2); QString target = mapping.section("=", -1, -1); nsmapping[uri] = target; - //fprintf(stderr, "%s = %s\n", uri.toLatin1().data(), target.toLatin1().data()); } } else if (opt == QLatin1String("-optional-element-type")) { ++arg; @@ -223,7 +223,7 @@ int main(int argc, char **argv) // if you're saying "just make the impl-file", you can't // also say "make both the header and the impl" - if (both && impl) { + if (both && (outfileGiven || impl)) { showHelp(argv[0]); return 1; } @@ -234,14 +234,12 @@ int main(int argc, char **argv) Settings::self()->setGenerateImplementation(true); Settings::self()->setHeaderFileName(baseFile + ".h"); Settings::self()->setImplementationFileName(baseFile + ".cpp"); - } - else if (impl) { + } else if (impl) { Settings::self()->setGenerateHeader(false); Settings::self()->setGenerateImplementation(true); Settings::self()->setHeaderFileName(headerFile); Settings::self()->setImplementationFileName(outputFile.fileName()); - } - else { + } else { Settings::self()->setGenerateHeader(true); Settings::self()->setGenerateImplementation(false); Settings::self()->setHeaderFileName(outputFile.fileName()); @@ -262,11 +260,6 @@ int main(int argc, char **argv) Settings::self()->setUseLocalFilesOnly(useLocalFilesOnly); Settings::self()->setHelpOnMissing(helpOnMissing); - //fprintf(stderr, "Output dir: %s\n", Settings::self()->outputDirectory().toLatin1().data()); - //fprintf(stderr, "HeaderFile: %s\n", Settings::self()->headerFileName().toLatin1().data()); - //fprintf(stderr, "Impl File: %s\n", Settings::self()->implementationFileName().toLatin1().data()); - //fprintf(stderr, "Generate: header? %d implementation? %d\n", Settings::self()->generateHeader(), Settings::self()->generateImplementation()); - KWSDL::Compiler compiler; // so that we have an event loop, for downloads From 409aa8e81fa25646dda0c7572c2068fdc9ab8ab4 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:16:11 +0100 Subject: [PATCH 014/679] - Remove "const" change from SoapClientInterface (it is added in a different branch) --- src/KDSoapClient/KDSoapClientInterface.cpp | 2 +- src/KDSoapClient/KDSoapClientInterface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 2ede473f1..2b8470aab 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -58,7 +58,7 @@ void KDSoapClientInterface::setSoapVersion(KDSoapClientInterface::SoapVersion ve d->m_version = static_cast(version); } -KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() const +KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() { return static_cast(d->m_version); } diff --git a/src/KDSoapClient/KDSoapClientInterface.h b/src/KDSoapClient/KDSoapClientInterface.h index d5c21803b..3b1039e02 100644 --- a/src/KDSoapClient/KDSoapClientInterface.h +++ b/src/KDSoapClient/KDSoapClientInterface.h @@ -197,7 +197,7 @@ class KDSOAP_EXPORT KDSoapClientInterface /** * Returns the version of SOAP being used in this instance. */ - KDSoapClientInterface::SoapVersion soapVersion() const; + KDSoapClientInterface::SoapVersion soapVersion(); /** * Returns the end point of the SOAP service. From 5eeef8628a82055660703c4b9fdb1b352418639b Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:18:15 +0100 Subject: [PATCH 015/679] - Code style change, as requested by David --- kdwsdl2cpp/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index 0f1055f7c..e5dbb881c 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -167,7 +167,9 @@ int main(int argc, char **argv) while (!file.atEnd()) { QString mapping = file.readLine().trimmed(); - if (mapping.startsWith("#")) { continue; } + if (mapping.startsWith('#')) { + continue; + } QString uri = mapping.section("=", 0, -2); QString target = mapping.section("=", -1, -1); From 5106ed0b743e3a91d2adfb7df64ce36861fe0589 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:25:56 +0100 Subject: [PATCH 016/679] - Make KODE::Printer a member variable instead of a parent class --- kdwsdl2cpp/src/creator.cpp | 29 +++++++++++++++++++---------- kdwsdl2cpp/src/creator.h | 7 ++++--- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/kdwsdl2cpp/src/creator.cpp b/kdwsdl2cpp/src/creator.cpp index e9b87e154..53f331983 100644 --- a/kdwsdl2cpp/src/creator.cpp +++ b/kdwsdl2cpp/src/creator.cpp @@ -34,21 +34,30 @@ Creator::Creator() KODE::Code::setDefaultIndentation(4); // Set generated header details. - setCreationWarning(true); - setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); + _printer.setCreationWarning(true); + _printer.setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); // Qt-like coding style - setLabelsDefineIndent(false); - setIndentLabels(false); - + _printer.setLabelsDefineIndent(false); + _printer.setIndentLabels(false); _file.setLicense(KODE::License::GeneratedNoRestriction); } +void Creator::setOutputDirectory(const QString &outputDirectory) +{ + _printer.setOutputDirectory(outputDirectory); +} + +void Creator::setSourceFile(const QString &sourceFile) +{ + _printer.setSourceFile(sourceFile); +} + void Creator::setHeaderFileName(const QString &headerFileName) { _file.setHeaderFilename(headerFileName); - } +} void Creator::setImplementationFileName(const QString &implementationFileName) { @@ -61,14 +70,14 @@ void Creator::setClasses(const KODE::Class::List &list) for (it = list.constBegin(); it != list.constEnd(); ++it) { _file.insertClass(*it); } - } +} void Creator::createHeader() { - printHeader(_file); - } + _printer.printHeader(_file); +} void Creator::createImplementation() { - printImplementation(_file); + _printer.printImplementation(_file); } diff --git a/kdwsdl2cpp/src/creator.h b/kdwsdl2cpp/src/creator.h index b808e484e..0f4a41474 100644 --- a/kdwsdl2cpp/src/creator.h +++ b/kdwsdl2cpp/src/creator.h @@ -28,13 +28,13 @@ namespace KWSDL { -class Creator : private KODE::Printer +class Creator { public: Creator(); - using KODE::Printer::setOutputDirectory; - using KODE::Printer::setSourceFile; + void setOutputDirectory(const QString &outputDirectory); + void setSourceFile(const QString &sourceFile); void setHeaderFileName(const QString &headerFileName); void setImplementationFileName(const QString &implementationFileName); @@ -45,6 +45,7 @@ class Creator : private KODE::Printer private: KODE::File _file; + KODE::Printer _printer; }; } From 5da164d24c7ae382dd9dab5900e8ff704813e152 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:42:09 +0100 Subject: [PATCH 017/679] - Tweaks to fileprovider --- kdwsdl2cpp/common/fileprovider.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kdwsdl2cpp/common/fileprovider.cpp b/kdwsdl2cpp/common/fileprovider.cpp index d2932e757..0e1bfce60 100644 --- a/kdwsdl2cpp/common/fileprovider.cpp +++ b/kdwsdl2cpp/common/fileprovider.cpp @@ -37,7 +37,7 @@ #include #endif -QHash fileProviderCache; +static QHash fileProviderCache; FileProvider::FileProvider() @@ -98,8 +98,9 @@ bool FileProvider::get( const QUrl &url, QString &target ) } QByteArray data; - if (fileProviderCache.contains(url)) { - data = fileProviderCache[url]; + const QHash::const_iterator it = fileProviderCache.constFind(url); + if (it != fileProviderCache.constEnd()) { + data = it.value(); qDebug( "Using cached copy" ); } else { qDebug("Downloading '%s'", url.toEncoded().constData()); @@ -125,7 +126,7 @@ bool FileProvider::get( const QUrl &url, QString &target ) QFile file( mFileName ); if ( !file.open( QIODevice::WriteOnly ) ) { - qDebug( qPrintable("Unable to create temporary file: " + file.errorString()) ); + qWarning() << "Unable to create" << mFileName << ":" << file.errorString(); return false; } From 87e8d82d6ec59fbb3e2579751dcaccde0614d8f4 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 16:17:37 +0100 Subject: [PATCH 018/679] - Make a sanity check into a Q_ASSERT --- kdwsdl2cpp/libkode/style.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kdwsdl2cpp/libkode/style.cpp b/kdwsdl2cpp/libkode/style.cpp index 42aff14e2..8cddf348b 100644 --- a/kdwsdl2cpp/libkode/style.cpp +++ b/kdwsdl2cpp/libkode/style.cpp @@ -83,8 +83,7 @@ QString Style::lowerFirst( const QString &str ) QString Style::makeIdentifier( const QString &str ) { - if ( str.isEmpty() ) - return str; + Q_ASSERT(!str.isEmpty()); QString identifier = str; identifier.replace( "-", "_" ); From c451cda4cc823713afa68344c2c67983f446c32b Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 17:00:08 +0100 Subject: [PATCH 019/679] - Fix memory leak --- src/KDSoapClient/KDSoapClientInterface.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 2b8470aab..d87169b43 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -192,6 +192,7 @@ void KDSoapClientInterface::callNoReply(const QString &method, const KDSoapMessa QNetworkReply *reply = d->accessManager()->post(request, buffer); d->setupReply(reply); QObject::connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater())); + QObject::connect(reply, SIGNAL(finished()), buffer, SLOT(deleteLater())); } void KDSoapClientInterfacePrivate::_kd_slotAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator) From 6f96602ee119f085379b188d4280ad07730043e5 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 17:01:38 +0100 Subject: [PATCH 020/679] - Update docs --- doc/CHANGES_1_8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index a39bbdd65..939516e0a 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -12,6 +12,7 @@ Client-side: * Fix error code when authentication failed * Autodeletion of jobs is now configurable (github pull #125) * Add error details in faultAsString() - and the generated lastError() - coming from the SOAP 1.2 detail element. +* Fix memory leak in KDSoapClientInterface::callNoReply Server-side: ============ From b280e09b5d5cb15ea9fd735fa53e6da6d6053e49 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Sat, 2 Feb 2019 16:55:33 +0100 Subject: [PATCH 021/679] KDSoapAuthentication: Added documentation link and simplified function signature --- src/KDSoapClient/KDSoapAuthentication.cpp | 6 +----- src/KDSoapClient/KDSoapAuthentication.h | 9 ++++++++- src/KDSoapClient/KDSoapMessageWriter.cpp | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/KDSoapClient/KDSoapAuthentication.cpp b/src/KDSoapClient/KDSoapAuthentication.cpp index 78542a729..3ad595c60 100644 --- a/src/KDSoapClient/KDSoapAuthentication.cpp +++ b/src/KDSoapClient/KDSoapAuthentication.cpp @@ -139,12 +139,8 @@ bool KDSoapAuthentication::hasWSUsernameTokenHeader() const return hasAuth() && d->useWSUsernameToken; } -void KDSoapAuthentication::writeWSUsernameTokenHeader(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const QString &messageNamespace, bool forceQualified) const +void KDSoapAuthentication::writeWSUsernameTokenHeader(QXmlStreamWriter &writer) const { - Q_UNUSED(namespacePrefixes); - Q_UNUSED(messageNamespace); - Q_UNUSED(forceQualified); - if (!hasAuth()) { return; } diff --git a/src/KDSoapClient/KDSoapAuthentication.h b/src/KDSoapClient/KDSoapAuthentication.h index 14a097874..0f7c29322 100644 --- a/src/KDSoapClient/KDSoapAuthentication.h +++ b/src/KDSoapClient/KDSoapAuthentication.h @@ -82,6 +82,7 @@ class KDSOAP_EXPORT KDSoapAuthentication /** * Sets whether WS-UsernameToken is used for authentication. When * set, the WS-UsernameToken headers are included in each request. + * See https://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0.pdf * \since 1.8 */ void setUseWSUsernameToken(bool useWSUsernameToken); @@ -132,9 +133,15 @@ class KDSOAP_EXPORT KDSoapAuthentication */ void handleAuthenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); + /** + * \internal + */ bool hasWSUsernameTokenHeader() const; - void writeWSUsernameTokenHeader(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const QString &messageNamespace, bool forceQualified) const; + /** + * \internal + */ + void writeWSUsernameTokenHeader(QXmlStreamWriter &writer) const; private: class Private; diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 895e78774..7d66ea0f3 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -90,7 +90,7 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const message.messageAddressingProperties().writeMessageAddressingProperties(namespacePrefixes, writer, messageNamespace, true); } if (authentication.hasWSUsernameTokenHeader()) { - authentication.writeWSUsernameTokenHeader(namespacePrefixes, writer, messageNamespace, true); + authentication.writeWSUsernameTokenHeader(writer); } writer.writeEndElement(); // Header } else { From 6132af1066e607d86cf076562a2d61a5a1517a88 Mon Sep 17 00:00:00 2001 From: anoymouserver Date: Mon, 4 Feb 2019 10:49:05 +0100 Subject: [PATCH 022/679] fix absolute path usage with -both error: Can't open 'C:/Users/User/AppData/Local/Temp//C:\Users\User\AppData\Local\Temp\QwsTestServerBase.h' for writing. cause: the header and impl filenames expect only the name without path --- kdwsdl2cpp/src/main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index e5dbb881c..4a7cbb57e 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -33,7 +33,7 @@ static const char *WSDL2CPP_VERSION_STR = "2.1"; static void showHelp(const char *appName) { fprintf(stderr, "%s %s\n", WSDL2CPP_DESCRIPTION, WSDL2CPP_VERSION_STR); - fprintf(stderr, + fprintf(stderr, "Usage:\n" " Header file: %s [options] -o \n" " Impl. file: %s [options] -o -impl \n" @@ -80,7 +80,6 @@ int main(int argc, char **argv) bool impl = false; bool outfileGiven = false; bool server = false; - QString baseFile; QString headerFile; QString serviceName; QString exportMacro; @@ -113,8 +112,7 @@ int main(int argc, char **argv) showHelp(argv[0]); return 1; } - baseFile = QFile::decodeName(argv[arg]); - outputFile.setFile(baseFile); + outputFile.setFile(QFile::decodeName(argv[arg])); } else if (opt == QLatin1String("-server")) { server = true; } else if (opt == QLatin1String("-v") || opt == QLatin1String("-version")) { @@ -177,7 +175,6 @@ int main(int argc, char **argv) nsmapping[uri] = target; } } - } else { QString uri = mapping.section("=", 0, -2); QString target = mapping.section("=", -1, -1); @@ -234,8 +231,8 @@ int main(int argc, char **argv) if (both) { Settings::self()->setGenerateHeader(true); Settings::self()->setGenerateImplementation(true); - Settings::self()->setHeaderFileName(baseFile + ".h"); - Settings::self()->setImplementationFileName(baseFile + ".cpp"); + Settings::self()->setHeaderFileName(outputFile.fileName() + ".h"); + Settings::self()->setImplementationFileName(outputFile.fileName() + ".cpp"); } else if (impl) { Settings::self()->setGenerateHeader(false); Settings::self()->setGenerateImplementation(true); From 3785b9ba94e1423dd5bb91629f84e7b0a3972b9f Mon Sep 17 00:00:00 2001 From: anoymouserver Date: Mon, 4 Feb 2019 10:31:07 +0100 Subject: [PATCH 023/679] added C++17 std::optional as possible return value for optional elements --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/src/converter_clientstub.cpp | 2 ++ kdwsdl2cpp/src/converter_complextype.cpp | 22 ++++++++++++++++++++++ kdwsdl2cpp/src/main.cpp | 4 +++- kdwsdl2cpp/src/settings.h | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 8c524a211..a5c939a81 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -29,3 +29,4 @@ WSDL parser / code generator changes, applying to both client and server side: * Fix fault elements being generated in the wrong namespace, must be SOAP-ENV:Fault (github issue #81). * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. +* Added C++17 std::optional as possible return value for optional elements. diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index 0ef15cd0e..cc1669c0e 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -106,6 +106,8 @@ bool Converter::convertClientService() newClass.addHeaderInclude(QLatin1String("KDSoapClient/KDSoapClientInterface.h")); if (Settings::self()->optionalElementType() == Settings::EBoostOptional) { newClass.addHeaderInclude(QLatin1String("boost/optional.hpp")); + } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { + newClass.addHeaderInclude(QLatin1String("optional")); } // Files included in the impl, with optional forward-declarations in the header diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 2307a55ee..cbf4a607e 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -309,6 +309,8 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString if (optional) { if (Settings::self()->optionalElementType() == Settings::EBoostOptional) { getterTypeName = "boost::optional<" + typeName + " >"; + } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { + getterTypeName = "std::optional<" + typeName + " >"; } else if (usePointer || Settings::self()->optionalElementType() == Settings::ERawPointer) { getterTypeName = "const " + typeName + QLatin1Char('*'); } @@ -328,6 +330,16 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString getterCode.indent(); getterCode += "return boost::optional<" + typeName + " >();"; getter.setBody(getterCode); + } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { + KODE::Code getterCode; + getterCode += QLatin1String("if (") + variableName + QLatin1String(")"); + getterCode.indent(); + getterCode += QLatin1String("return *") + variableName + QLatin1Char(';'); + getterCode.unindent(); + getterCode += QLatin1String("else"); + getterCode.indent(); + getterCode += "return std::nullopt;"; + getter.setBody(getterCode); } else { // Regular isn't an option here. It would crash when the value is not set! So assume ERawPointer. getter.setBody(QLatin1String("return ") + variableName + QLatin1String(".data();")); } @@ -356,6 +368,16 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString getterCode.indent(); getterCode += "return boost::optional<" + typeName + " >();"; getter.setBody(getterCode); + } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { + KODE::Code getterCode; + getterCode += QLatin1String("if (!") + variableName + QLatin1String("_nil)"); + getterCode.indent(); + getterCode += QLatin1String("return ") + variableName + QLatin1Char(';'); + getterCode.unindent(); + getterCode += QLatin1String("else"); + getterCode.indent(); + getterCode += "return std::nullopt;"; + getter.setBody(getterCode); } else { getter.setBody(QLatin1String("return ") + variableName + QLatin1Char(';')); } diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index e5dbb881c..f4f6ada87 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -56,7 +56,7 @@ static void showHelp(const char *appName) " (affects the generated class names)\n" " -optional-element-type \n" " use as the getter return value for optional elements.\n" - " can be either raw-pointer or boost-optional\n" + " can be either raw-pointer, boost-optional or std-optional\n" " -keep-unused-types keep the wsdl unused types to the cpp generation step\n" " -import-path search for files first in this path before\n" " downloading them. may be specified multiple times.\n" @@ -194,6 +194,8 @@ int main(int argc, char **argv) optionalElementType = Settings::ERawPointer; } else if (optType == QLatin1String("boost-optional")) { optionalElementType = Settings::EBoostOptional; + } else if (optType == QLatin1String("std-optional")) { + optionalElementType = Settings::EStdOptional; } } else if (opt == QLatin1String("-keep-unused-types")) { keepUnusedTypes = true; diff --git a/kdwsdl2cpp/src/settings.h b/kdwsdl2cpp/src/settings.h index 17f6cb04e..767bf7bbd 100644 --- a/kdwsdl2cpp/src/settings.h +++ b/kdwsdl2cpp/src/settings.h @@ -29,7 +29,7 @@ class Settings public: typedef QMap NSMapping; - enum OptionalElementType { ENone, ERawPointer, EBoostOptional }; + enum OptionalElementType { ENone, ERawPointer, EBoostOptional, EStdOptional }; ~Settings(); From 869e3292674f3257af19b2db93fb306fb6835938 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 16:34:11 +0100 Subject: [PATCH 024/679] - Extend KDSOAP_DEBUG functionality --- doc/CHANGES_1_8.txt | 1 + src/KDSoapClient/KDSoapClientInterface.cpp | 3 +- src/KDSoapClient/KDSoapMessageWriter.cpp | 3 - src/KDSoapClient/KDSoapPendingCall.cpp | 87 +++++++++++++++++++++- src/KDSoapClient/KDSoapPendingCall_p.h | 2 + 5 files changed, 88 insertions(+), 8 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 643da034f..4b2769f6f 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -15,6 +15,7 @@ Client-side: * Add error details in faultAsString() - and the generated lastError() - coming from the SOAP 1.2 detail element. * Fix memory leak in KDSoapClientInterface::callNoReply * Add support for WS-UsernameToken, see KDSoapAuthentication +* Extend KDSOAP_DEBUG functionality (e.g. "KDSOAP_DEBUG=http,reformat" will now print http-headers and pretty-print the xml) Server-side: ============ diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 5f18bc53d..6f42cf020 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -158,9 +158,9 @@ KDSoapPendingCall KDSoapClientInterface::asyncCall(const QString &method, const { QBuffer *buffer = d->prepareRequestBuffer(method, message, headers); QNetworkRequest request = d->prepareRequest(method, soapAction); - //qDebug() << "post()"; QNetworkReply *reply = d->accessManager()->post(request, buffer); d->setupReply(reply); + debugHelper(buffer->data(), reply->request(), reply); KDSoapPendingCall call(reply, buffer); call.d->soapVersion = d->m_version; return call; @@ -191,6 +191,7 @@ void KDSoapClientInterface::callNoReply(const QString &method, const KDSoapMessa QNetworkRequest request = d->prepareRequest(method, soapAction); QNetworkReply *reply = d->accessManager()->post(request, buffer); d->setupReply(reply); + debugHelper(buffer->data(), reply->request(), reply); QObject::connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater())); QObject::connect(reply, SIGNAL(finished()), buffer, SLOT(deleteLater())); } diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 7d66ea0f3..76d7692d0 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -126,8 +126,5 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const writer.writeEndElement(); // Envelope writer.writeEndDocument(); - if (qgetenv("KDSOAP_DEBUG").toInt()) { - qDebug() << data; - } return data; } diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 18a9eb2c0..2543cb901 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -27,6 +27,87 @@ #include #include +void debugHelper(const QByteArray &data, QList< QNetworkReply::RawHeaderPair > headerList) { + const QByteArray doDebug = qgetenv("KDSOAP_DEBUG"); + if (doDebug.trimmed().isEmpty() || doDebug == "0") { + return; + } + + const QList options = doDebug.toLower().split(','); + const bool optEscape = options.contains("escape"); + const bool optHttp = options.contains("http") || options.contains("https"); + const bool optReformat = options.contains("reformat"); + quint8 indentation = 4; + Q_FOREACH( const QByteArray &opt, options ) { + if (opt.startsWith("indent=")) { + indentation = opt.mid(7).toUShort(); + } + } + + QByteArray toOutput; + if (optHttp) { + Q_FOREACH( const QNetworkReply::RawHeaderPair &header, headerList ) { + if (!header.first.isEmpty()) { + toOutput += header.first + ": "; + } + toOutput += header.second + "\n"; + } + toOutput += "\n"; + } + + if (optReformat) { + QByteArray reformatted; + QXmlStreamReader reader(data); + QXmlStreamWriter writer(&reformatted); + writer.setAutoFormatting(true); + writer.setAutoFormattingIndent(indentation); + + while (!reader.atEnd()) { + reader.readNext(); + if (!reader.isWhitespace()) { + writer.writeCurrentToken(reader); + } + } + + toOutput += reader.hasError() ? data : reformatted; + } else { + toOutput += data; + } + + if (optEscape) { + qDebug() << toOutput; + } else { + qDebug().noquote() << toOutput; + } +} + +// Log the HTTP and XML of a response from the server. +void debugHelper(const QByteArray &data, QNetworkReply *reply) { + debugHelper(data, reply->rawHeaderPairs()); +} + +// Log the HTTP and XML of a requst. +void debugHelper(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply) { + QList headerList; + if (reply) { + QByteArray method; + switch(reply->operation()) { + default: + case QNetworkAccessManager::GetOperation: method = "GET"; break; + case QNetworkAccessManager::HeadOperation: method = "HEAD"; break; + case QNetworkAccessManager::PutOperation: method = "PUT"; break; + case QNetworkAccessManager::PostOperation: method = "POST"; break; + case QNetworkAccessManager::DeleteOperation: method = "DELETE"; break; + } + headerList << qMakePair("", method + " " + qPrintable(reply->url().toString())); + } + Q_FOREACH( const QByteArray &h, request.rawHeaderList() ) { + headerList << qMakePair(h, request.rawHeader(h)); + } + debugHelper(data, headerList); +} + + KDSoapPendingCall::Private::~Private() { if (reply) { @@ -93,7 +174,6 @@ void KDSoapPendingCall::Private::parseReply() if (parsed) { return; } - const bool doDebug = qgetenv("KDSOAP_DEBUG").toInt(); QNetworkReply *reply = this->reply.data(); #if QT_VERSION >= 0x040600 if (!reply->isFinished()) { @@ -102,11 +182,10 @@ void KDSoapPendingCall::Private::parseReply() } #endif parsed = true; + // Don't try to read from an aborted (closed) reply const QByteArray data = reply->isOpen() ? reply->readAll() : QByteArray(); - if (doDebug) { - qDebug() << data; - } + debugHelper(data, reply); if (!data.isEmpty()) { KDSoapMessageReader reader; diff --git a/src/KDSoapClient/KDSoapPendingCall_p.h b/src/KDSoapClient/KDSoapPendingCall_p.h index 24a27bdf4..6ae97d39e 100644 --- a/src/KDSoapClient/KDSoapPendingCall_p.h +++ b/src/KDSoapClient/KDSoapPendingCall_p.h @@ -33,6 +33,8 @@ class KDSoapValue; +void debugHelper(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply); + class KDSoapPendingCall::Private : public QSharedData { public: From fa894152ea851f98f2777b032afc1468b4a9d788 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 17:58:01 +0100 Subject: [PATCH 025/679] - Add "hasValue" accessor function for optional values --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/src/converter_complextype.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 643da034f..5aa3ef6d5 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -31,3 +31,4 @@ WSDL parser / code generator changes, applying to both client and server side: * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. * Added C++17 std::optional as possible return value for optional elements. +* Added "hasValue{MemberName}()" accessor function, for optional elements diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index cbf4a607e..e15683ba4 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -389,6 +389,16 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString newClass.addFunction(setter); newClass.addFunction(getter); + if (optional) { + KODE::Code checkerCode; + checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil;"); + + KODE::Function checker(QLatin1String("hasValueFor") + upperName, QLatin1String("bool"), access); + checker.setConst(true); + checker.setBody(checkerCode); + newClass.addFunction(checker); + } + return variableName; } From 1bc8eb73975ffb518277e9ae24d358f35092f2b1 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 18:02:21 +0100 Subject: [PATCH 026/679] - remove debug statement --- kdwsdl2cpp/common/fileprovider.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/kdwsdl2cpp/common/fileprovider.cpp b/kdwsdl2cpp/common/fileprovider.cpp index 0e1bfce60..675040313 100644 --- a/kdwsdl2cpp/common/fileprovider.cpp +++ b/kdwsdl2cpp/common/fileprovider.cpp @@ -101,7 +101,6 @@ bool FileProvider::get( const QUrl &url, QString &target ) const QHash::const_iterator it = fileProviderCache.constFind(url); if (it != fileProviderCache.constEnd()) { data = it.value(); - qDebug( "Using cached copy" ); } else { qDebug("Downloading '%s'", url.toEncoded().constData()); From 2b2cc853c942a16bd5f348d2db018b5e7da3bb23 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 1 Feb 2019 15:59:07 +0100 Subject: [PATCH 027/679] - Update CHANGES documentation --- doc/CHANGES_1_8.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 643da034f..c54391de1 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -15,6 +15,9 @@ Client-side: * Add error details in faultAsString() - and the generated lastError() - coming from the SOAP 1.2 detail element. * Fix memory leak in KDSoapClientInterface::callNoReply * Add support for WS-UsernameToken, see KDSoapAuthentication +* Add support for specifying requestHeaders as part of KDSoapJob via KDSoapJob::setRequestHeaders() +* Rename the missing KDSoapJob::returnHeaders() to KDSoapJob::replyHeaders(), and provide an implementation +* Make KDSoapClientInterface::soapVersion() const Server-side: ============ @@ -31,3 +34,7 @@ WSDL parser / code generator changes, applying to both client and server side: * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. * Added C++17 std::optional as possible return value for optional elements. +* Added -both to create both header(.h) and implementation(.cpp) files in one run +* Added -namespaceMapping @mapping.txt to import url=code mappings, affects C++ class name generation +* Added functionality to prevent downloading the same WSDL/XSD file twice in one run +* Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators From c7b38cc22d84865bd234b13a6faf2aefbeefdf5c Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 18:14:58 +0100 Subject: [PATCH 028/679] - Style tweaks --- src/KDSoapClient/KDSoapClientInterface.cpp | 4 ++-- src/KDSoapClient/KDSoapPendingCall.cpp | 23 ++++++++++++---------- src/KDSoapClient/KDSoapPendingCall_p.h | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 6f42cf020..0f736e867 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -160,7 +160,7 @@ KDSoapPendingCall KDSoapClientInterface::asyncCall(const QString &method, const QNetworkRequest request = d->prepareRequest(method, soapAction); QNetworkReply *reply = d->accessManager()->post(request, buffer); d->setupReply(reply); - debugHelper(buffer->data(), reply->request(), reply); + maybeDebugRequest(buffer->data(), reply->request(), reply); KDSoapPendingCall call(reply, buffer); call.d->soapVersion = d->m_version; return call; @@ -191,7 +191,7 @@ void KDSoapClientInterface::callNoReply(const QString &method, const KDSoapMessa QNetworkRequest request = d->prepareRequest(method, soapAction); QNetworkReply *reply = d->accessManager()->post(request, buffer); d->setupReply(reply); - debugHelper(buffer->data(), reply->request(), reply); + maybeDebugRequest(buffer->data(), reply->request(), reply); QObject::connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater())); QObject::connect(reply, SIGNAL(finished()), buffer, SLOT(deleteLater())); } diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 2543cb901..0e20427c0 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -27,7 +27,7 @@ #include #include -void debugHelper(const QByteArray &data, QList< QNetworkReply::RawHeaderPair > headerList) { +static void maybeDebug(const QByteArray &data, const QList &headerList) { const QByteArray doDebug = qgetenv("KDSOAP_DEBUG"); if (doDebug.trimmed().isEmpty() || doDebug == "0") { return; @@ -82,29 +82,32 @@ void debugHelper(const QByteArray &data, QList< QNetworkReply::RawHeaderPair > h } // Log the HTTP and XML of a response from the server. -void debugHelper(const QByteArray &data, QNetworkReply *reply) { - debugHelper(data, reply->rawHeaderPairs()); +static void maybeDebugResponse(const QByteArray &data, QNetworkReply *reply) { + maybeDebug(data, reply->rawHeaderPairs()); } -// Log the HTTP and XML of a requst. -void debugHelper(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply) { +// Log the HTTP and XML of a request. +// (not static, because this is used in KDSoapClientInterface) +void maybeDebugRequest(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply) { QList headerList; if (reply) { QByteArray method; - switch(reply->operation()) { - default: + switch (reply->operation()) { + default: break; // don't try to mimic the basic HTTP command case QNetworkAccessManager::GetOperation: method = "GET"; break; case QNetworkAccessManager::HeadOperation: method = "HEAD"; break; case QNetworkAccessManager::PutOperation: method = "PUT"; break; case QNetworkAccessManager::PostOperation: method = "POST"; break; case QNetworkAccessManager::DeleteOperation: method = "DELETE"; break; } - headerList << qMakePair("", method + " " + qPrintable(reply->url().toString())); + if (!method.isEmpty()) { + headerList << qMakePair("", method + " " + qPrintable(reply->url().toString())); + } } Q_FOREACH( const QByteArray &h, request.rawHeaderList() ) { headerList << qMakePair(h, request.rawHeader(h)); } - debugHelper(data, headerList); + maybeDebug(data, headerList); } @@ -185,7 +188,7 @@ void KDSoapPendingCall::Private::parseReply() // Don't try to read from an aborted (closed) reply const QByteArray data = reply->isOpen() ? reply->readAll() : QByteArray(); - debugHelper(data, reply); + maybeDebugResponse(data, reply); if (!data.isEmpty()) { KDSoapMessageReader reader; diff --git a/src/KDSoapClient/KDSoapPendingCall_p.h b/src/KDSoapClient/KDSoapPendingCall_p.h index 6ae97d39e..76506eb93 100644 --- a/src/KDSoapClient/KDSoapPendingCall_p.h +++ b/src/KDSoapClient/KDSoapPendingCall_p.h @@ -33,7 +33,7 @@ class KDSoapValue; -void debugHelper(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply); +void maybeDebugRequest(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply); class KDSoapPendingCall::Private : public QSharedData { From 64a036d58d8150f193133a13d31013c3030a272e Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 18:25:00 +0100 Subject: [PATCH 029/679] - Fix for merged docs --- doc/CHANGES_1_8.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 5aa3ef6d5..c54391de1 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -15,6 +15,9 @@ Client-side: * Add error details in faultAsString() - and the generated lastError() - coming from the SOAP 1.2 detail element. * Fix memory leak in KDSoapClientInterface::callNoReply * Add support for WS-UsernameToken, see KDSoapAuthentication +* Add support for specifying requestHeaders as part of KDSoapJob via KDSoapJob::setRequestHeaders() +* Rename the missing KDSoapJob::returnHeaders() to KDSoapJob::replyHeaders(), and provide an implementation +* Make KDSoapClientInterface::soapVersion() const Server-side: ============ @@ -31,4 +34,7 @@ WSDL parser / code generator changes, applying to both client and server side: * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. * Added C++17 std::optional as possible return value for optional elements. -* Added "hasValue{MemberName}()" accessor function, for optional elements +* Added -both to create both header(.h) and implementation(.cpp) files in one run +* Added -namespaceMapping @mapping.txt to import url=code mappings, affects C++ class name generation +* Added functionality to prevent downloading the same WSDL/XSD file twice in one run +* Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators From ab541030ceb1edceeffccef1e808f81fe15fe398 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 18:25:57 +0100 Subject: [PATCH 030/679] - Fix for incoming changes --- doc/CHANGES_1_8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index c54391de1..6a1ff7158 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -34,6 +34,7 @@ WSDL parser / code generator changes, applying to both client and server side: * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. * Added C++17 std::optional as possible return value for optional elements. +* Added "hasValue{MemberName}()" accessor function, for optional elements * Added -both to create both header(.h) and implementation(.cpp) files in one run * Added -namespaceMapping @mapping.txt to import url=code mappings, affects C++ class name generation * Added functionality to prevent downloading the same WSDL/XSD file twice in one run From 425ff10f11111bc0edeb8c74a911077b7a997d8d Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Mon, 4 Feb 2019 18:38:11 +0100 Subject: [PATCH 031/679] - Return quicker from the maybeDebug functions if not debugging --- src/KDSoapClient/KDSoapPendingCall.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 0e20427c0..9b6aea5e4 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -27,12 +27,8 @@ #include #include -static void maybeDebug(const QByteArray &data, const QList &headerList) { +static void debugHelper(const QByteArray &data, const QList &headerList) { const QByteArray doDebug = qgetenv("KDSOAP_DEBUG"); - if (doDebug.trimmed().isEmpty() || doDebug == "0") { - return; - } - const QList options = doDebug.toLower().split(','); const bool optEscape = options.contains("escape"); const bool optHttp = options.contains("http") || options.contains("https"); @@ -83,12 +79,22 @@ static void maybeDebug(const QByteArray &data, const QListrawHeaderPairs()); + const QByteArray doDebug = qgetenv("KDSOAP_DEBUG"); + if (doDebug.trimmed().isEmpty() || doDebug == "0") { + return; + } + + debugHelper(data, reply->rawHeaderPairs()); } // Log the HTTP and XML of a request. // (not static, because this is used in KDSoapClientInterface) void maybeDebugRequest(const QByteArray &data, const QNetworkRequest &request, QNetworkReply *reply) { + const QByteArray doDebug = qgetenv("KDSOAP_DEBUG"); + if (doDebug.trimmed().isEmpty() || doDebug == "0") { + return; + } + QList headerList; if (reply) { QByteArray method; @@ -107,7 +113,7 @@ void maybeDebugRequest(const QByteArray &data, const QNetworkRequest &request, Q Q_FOREACH( const QByteArray &h, request.rawHeaderList() ) { headerList << qMakePair(h, request.rawHeader(h)); } - maybeDebug(data, headerList); + debugHelper(data, headerList); } From 77dc76c949254b756eb9c2999aa36a8ef58a6d6d Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 4 Feb 2019 20:40:44 +0100 Subject: [PATCH 032/679] Try to make servertest's testTimeout more robust (failed on Qt5.8-msvc2013-windows) --- unittests/servertest/servertest.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unittests/servertest/servertest.cpp b/unittests/servertest/servertest.cpp index 75e82b769..93830899c 100644 --- a/unittests/servertest/servertest.cpp +++ b/unittests/servertest/servertest.cpp @@ -1342,8 +1342,12 @@ private Q_SLOTS: KDSoapClientInterface client(server->endPoint(), countryMessageNamespace()); client.setTimeout(10); KDSoapPendingCall pendingCall = client.asyncCall(QLatin1String("getEmployeeCountry"), countryMessage(true)); // the server object sleeps for 100ms +#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) + QTRY_VERIFY(pendingCall.isFinished()); +#else QTest::qWait(50); QVERIFY(pendingCall.isFinished()); +#endif QVERIFY(pendingCall.returnMessage().isFault()); QCOMPARE(pendingCall.returnMessage().faultAsString(), QString::fromLatin1("Fault code 4: Operation timed out")); } From b1ba5e2e61a3a227323b39cb3890d2e41ebf3c44 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 4 Feb 2019 20:57:25 +0100 Subject: [PATCH 033/679] KDSoapServer::endPoint: fix data race detected by tsan --- src/KDSoapServer/KDSoapServer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KDSoapServer/KDSoapServer.cpp b/src/KDSoapServer/KDSoapServer.cpp index 9043e64a3..28c3154c1 100644 --- a/src/KDSoapServer/KDSoapServer.cpp +++ b/src/KDSoapServer/KDSoapServer.cpp @@ -154,6 +154,7 @@ KDSoapThreadPool *KDSoapServer::threadPool() const QString KDSoapServer::endPoint() const { + QMutexLocker lock(&d->m_serverDataMutex); const QHostAddress address = serverAddress(); if (address == QHostAddress::Null) { return QString(); @@ -356,11 +357,13 @@ int KDSoapServer::maxConnections() const void KDSoapServer::setFeatures(Features features) { + QMutexLocker lock(&d->m_serverDataMutex); d->m_features = features; } KDSoapServer::Features KDSoapServer::features() const { + QMutexLocker lock(&d->m_serverDataMutex); return d->m_features; } From 94f1d731547bec3c491c73ae6691dbb57226a688 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Tue, 5 Feb 2019 13:20:38 +0100 Subject: [PATCH 034/679] - Add unittests --- kdwsdl2cpp/src/converter_complextype.cpp | 2 +- unittests/optionaltype_boost_optional/testboostapi.cpp | 2 ++ unittests/optionaltype_pointer/testpointerapi.cpp | 4 ++++ unittests/optionaltype_regular/testregularapi.cpp | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index e15683ba4..6e28390ae 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -391,7 +391,7 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString if (optional) { KODE::Code checkerCode; - checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil;"); + checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil == false;"); KODE::Function checker(QLatin1String("hasValueFor") + upperName, QLatin1String("bool"), access); checker.setConst(true); diff --git a/unittests/optionaltype_boost_optional/testboostapi.cpp b/unittests/optionaltype_boost_optional/testboostapi.cpp index 17335bb1b..e0c39d457 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.cpp +++ b/unittests/optionaltype_boost_optional/testboostapi.cpp @@ -34,9 +34,11 @@ void TestBoostApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), boost::optional()); + QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(*resp.out(), newVal); + QCOMPARE(resp.hasValueForOut(), true); } QTEST_MAIN(TestBoostApi) diff --git a/unittests/optionaltype_pointer/testpointerapi.cpp b/unittests/optionaltype_pointer/testpointerapi.cpp index 82051e0e2..dcc448d1e 100644 --- a/unittests/optionaltype_pointer/testpointerapi.cpp +++ b/unittests/optionaltype_pointer/testpointerapi.cpp @@ -35,15 +35,18 @@ void TestPointerApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), (QString *)0); + QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(*resp.out(), newVal); + QCOMPARE(resp.hasValueForOut(), true); } void TestPointerApi::testOptionalArray() { TNS__TestOperationResponse1 resp; QVERIFY(!resp.outOptionalArray()); + QVERIFY(!resp.hasValueForOutOptionalArray()); const QList valIn(QList() << 1 << 2 << 3); resp.setOutOptionalArray(valIn); @@ -52,6 +55,7 @@ void TestPointerApi::testOptionalArray() QVERIFY(resp2.outOptionalArray()); QCOMPARE(valIn, *resp2.outOptionalArray()); + QVERIFY(resp.hasValueForOutOptionalArray()); } QTEST_MAIN(TestPointerApi) diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index b0598505b..2d25d7f60 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -34,9 +34,11 @@ void TestRegularApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), QString()); + QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(resp.out(), newVal); + QCOMPARE(resp.hasValueForOut(), true); } QTEST_MAIN(TestRegularApi) From 707013aa091ab63518c10586e109272a6a938a5e Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 6 Feb 2019 11:41:09 +0100 Subject: [PATCH 035/679] Revert hasValueFor, it currently breaks compilation --- doc/CHANGES_1_8.txt | 1 - kdwsdl2cpp/src/converter_complextype.cpp | 10 ---------- src/KDSoapClient/KDSoapPendingCall.cpp | 4 ---- unittests/optionaltype_boost_optional/testboostapi.cpp | 2 -- unittests/optionaltype_pointer/testpointerapi.cpp | 4 ---- unittests/optionaltype_regular/testregularapi.cpp | 2 -- 6 files changed, 23 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 00b5c2e39..6fbc8b057 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -35,7 +35,6 @@ WSDL parser / code generator changes, applying to both client and server side: * Added import-path argument for setting the local path to get (otherwise downloaded) files from. * Added -help-on-missing option to kdwsdl2cpp to display extra help on missing types. * Added C++17 std::optional as possible return value for optional elements. -* Added "hasValue{MemberName}()" accessor function, for optional elements * Added -both to create both header(.h) and implementation(.cpp) files in one run * Added -namespaceMapping @mapping.txt to import url=code mappings, affects C++ class name generation * Added functionality to prevent downloading the same WSDL/XSD file twice in one run diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 6e28390ae..cbf4a607e 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -389,16 +389,6 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString newClass.addFunction(setter); newClass.addFunction(getter); - if (optional) { - KODE::Code checkerCode; - checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil == false;"); - - KODE::Function checker(QLatin1String("hasValueFor") + upperName, QLatin1String("bool"), access); - checker.setConst(true); - checker.setBody(checkerCode); - newClass.addFunction(checker); - } - return variableName; } diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 9b6aea5e4..27318e363 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -150,11 +150,7 @@ KDSoapPendingCall &KDSoapPendingCall::operator=(const KDSoapPendingCall &other) bool KDSoapPendingCall::isFinished() const { -#if QT_VERSION >= 0x040600 return d->reply.data()->isFinished(); -#else - return false; -#endif } KDSoapMessage KDSoapPendingCall::returnMessage() const diff --git a/unittests/optionaltype_boost_optional/testboostapi.cpp b/unittests/optionaltype_boost_optional/testboostapi.cpp index e0c39d457..17335bb1b 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.cpp +++ b/unittests/optionaltype_boost_optional/testboostapi.cpp @@ -34,11 +34,9 @@ void TestBoostApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), boost::optional()); - QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(*resp.out(), newVal); - QCOMPARE(resp.hasValueForOut(), true); } QTEST_MAIN(TestBoostApi) diff --git a/unittests/optionaltype_pointer/testpointerapi.cpp b/unittests/optionaltype_pointer/testpointerapi.cpp index dcc448d1e..82051e0e2 100644 --- a/unittests/optionaltype_pointer/testpointerapi.cpp +++ b/unittests/optionaltype_pointer/testpointerapi.cpp @@ -35,18 +35,15 @@ void TestPointerApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), (QString *)0); - QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(*resp.out(), newVal); - QCOMPARE(resp.hasValueForOut(), true); } void TestPointerApi::testOptionalArray() { TNS__TestOperationResponse1 resp; QVERIFY(!resp.outOptionalArray()); - QVERIFY(!resp.hasValueForOutOptionalArray()); const QList valIn(QList() << 1 << 2 << 3); resp.setOutOptionalArray(valIn); @@ -55,7 +52,6 @@ void TestPointerApi::testOptionalArray() QVERIFY(resp2.outOptionalArray()); QCOMPARE(valIn, *resp2.outOptionalArray()); - QVERIFY(resp.hasValueForOutOptionalArray()); } QTEST_MAIN(TestPointerApi) diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index 2d25d7f60..b0598505b 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -34,11 +34,9 @@ void TestRegularApi::test() { TNS__TestOperationResponse1 resp; QCOMPARE(resp.out(), QString()); - QCOMPARE(resp.hasValueForOut(), false); QString newVal("newval"); resp.setOut(newVal); QCOMPARE(resp.out(), newVal); - QCOMPARE(resp.hasValueForOut(), true); } QTEST_MAIN(TestRegularApi) From 7cb5feea66d660310bea2a0caca4c11a73787638 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Thu, 7 Feb 2019 13:57:29 +0100 Subject: [PATCH 036/679] - Fix for default tabs in generated code - Fix for hasValueFor{name} when "usePointer" - Change default parameter name for settings function to: "arg_" + name (fixes problems in MSVC-2017 for items named "timezone" and "daylight") --- kdwsdl2cpp/src/compiler.cpp | 1 + kdwsdl2cpp/src/converter_complextype.cpp | 8 ++++++-- kdwsdl2cpp/src/creator.cpp | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kdwsdl2cpp/src/compiler.cpp b/kdwsdl2cpp/src/compiler.cpp index 7075b77ec..d310cccc0 100644 --- a/kdwsdl2cpp/src/compiler.cpp +++ b/kdwsdl2cpp/src/compiler.cpp @@ -108,6 +108,7 @@ void Compiler::parse(const QDomElement &element) wsdl.setDefinitions(definitions); wsdl.setNamespaceManager(namespaceManager); + KODE::Code::setDefaultIndentation(4); KWSDL::Converter converter; converter.setWSDL(wsdl); diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 6e28390ae..b416ee7fd 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -285,7 +285,7 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString } // setter method - const QString argName = '_' + memberName; + const QString argName = "arg_" + memberName; KODE::Function setter(QLatin1String("set") + upperName, QLatin1String("void"), access); setter.addArgument(inputTypeName + QLatin1Char(' ') + argName); KODE::Code code; @@ -391,7 +391,11 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString if (optional) { KODE::Code checkerCode; - checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil == false;"); + if (usePointer) { + checkerCode += QLatin1String("return ") + variableName + QLatin1String(".isNull() == false;"); + } else { + checkerCode += QLatin1String("return ") + variableName + QLatin1String("_nil == false;"); + } KODE::Function checker(QLatin1String("hasValueFor") + upperName, QLatin1String("bool"), access); checker.setConst(true); diff --git a/kdwsdl2cpp/src/creator.cpp b/kdwsdl2cpp/src/creator.cpp index 53f331983..661a33165 100644 --- a/kdwsdl2cpp/src/creator.cpp +++ b/kdwsdl2cpp/src/creator.cpp @@ -31,8 +31,6 @@ using namespace KWSDL; Creator::Creator() { - KODE::Code::setDefaultIndentation(4); - // Set generated header details. _printer.setCreationWarning(true); _printer.setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); From b4eeb03afb94ce822cd85a090c96763e40a67698 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Thu, 7 Feb 2019 15:48:34 +0100 Subject: [PATCH 037/679] - Update tests for polymorphic tests --- unittests/optionaltype_regular/test.wsdl | 17 ++++++++++++++ .../optionaltype_regular/testregularapi.cpp | 22 +++++++++++++++++++ .../optionaltype_regular/testregularapi.h | 1 + 3 files changed, 40 insertions(+) diff --git a/unittests/optionaltype_regular/test.wsdl b/unittests/optionaltype_regular/test.wsdl index 77d89ca10..4e8471b43 100644 --- a/unittests/optionaltype_regular/test.wsdl +++ b/unittests/optionaltype_regular/test.wsdl @@ -8,6 +8,22 @@ + + + + + + + + + + + + + + + + @@ -19,6 +35,7 @@ + diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index 2d25d7f60..05a0b9c29 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -41,4 +41,26 @@ void TestRegularApi::test() QCOMPARE(resp.hasValueForOut(), true); } +void TestRegularApi::testPolymorphic() +{ + TNS__TestOperationResponse1 resp; + QCOMPARE(resp.out2(), (TNS__PolymorphicClass*)0); + QCOMPARE(resp.hasValueForOut2(), false); + TNS__PolymorphicClass value; + value.setValue(QString("newvalue")); + resp.setOut2(value); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("newvalue")); + QCOMPARE(resp.hasValueForOut2(), true); + + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut2(derivedValue); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("derived")); + QCOMPARE(dynamic_cast(resp.out2())->value2(), QString("derived")); +} + QTEST_MAIN(TestRegularApi) diff --git a/unittests/optionaltype_regular/testregularapi.h b/unittests/optionaltype_regular/testregularapi.h index 3246eb214..3324a801a 100644 --- a/unittests/optionaltype_regular/testregularapi.h +++ b/unittests/optionaltype_regular/testregularapi.h @@ -36,6 +36,7 @@ class TestRegularApi : public QObject private slots: void test(); + void testPolymorphic(); private: }; From e71d24fb661b49037214fbb087e2c01dbf2693f3 Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Thu, 7 Feb 2019 16:06:45 +0100 Subject: [PATCH 038/679] - fix for changes in wsdl --- unittests/optionaltype_regular/test.wsdl | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/unittests/optionaltype_regular/test.wsdl b/unittests/optionaltype_regular/test.wsdl index 4e8471b43..7e2beb232 100644 --- a/unittests/optionaltype_regular/test.wsdl +++ b/unittests/optionaltype_regular/test.wsdl @@ -9,20 +9,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + From b665ef8e816a5ba5918cdbcca519a8b6dd4a77e6 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 7 Feb 2019 16:22:28 +0100 Subject: [PATCH 039/679] Fix build with Qt4 --- src/KDSoapClient/KDSoapPendingCall.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 27318e363..83398a565 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -71,9 +71,14 @@ static void debugHelper(const QByteArray &data, const QList= QT_VERSION_CHECK(5, 4, 0) qDebug().noquote() << toOutput; +#else + qDebug() << toOutput; +#endif } } From d838c5f8bc12d90a3aa39038eda1c868abb04845 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 7 Feb 2019 16:24:24 +0100 Subject: [PATCH 040/679] Re-add changelog entry for hasValueForX --- doc/CHANGES_1_8.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 6fbc8b057..ef895f295 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -38,4 +38,5 @@ WSDL parser / code generator changes, applying to both client and server side: * Added -both to create both header(.h) and implementation(.cpp) files in one run * Added -namespaceMapping @mapping.txt to import url=code mappings, affects C++ class name generation * Added functionality to prevent downloading the same WSDL/XSD file twice in one run +* Added "hasValueFor{MemberName}()" accessor function, for optional elements * Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators From b135371cfa04b7159a64daeaec45684a5ee5399a Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Wed, 13 Feb 2019 12:30:26 +0100 Subject: [PATCH 041/679] Allow generating message without service or bindings Added support for generating messages for WSDL files without services or bindings. Mainly to support WS-Discovery WSDL. --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/wsdl/definitions.cpp | 52 ++-- unittests/CMakeLists.txt | 1 + unittests/ws_discovery_wsdl/CMakeLists.txt | 9 + .../schemas.xmlsoap.org/ws/2004/08/addressing | 149 ++++++++++ .../ws/2005/04/discovery/ws-discovery.xsd | 272 ++++++++++++++++++ .../test_ws_discovery_wsdl.cpp | 142 +++++++++ .../ws_discovery_wsdl/ws_discovery200504.wsdl | 140 +++++++++ .../ws_discovery_wsdl/ws_discovery_wsdl.pro | 9 + 9 files changed, 759 insertions(+), 16 deletions(-) create mode 100644 unittests/ws_discovery_wsdl/CMakeLists.txt create mode 100644 unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2004/08/addressing create mode 100644 unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd create mode 100644 unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp create mode 100644 unittests/ws_discovery_wsdl/ws_discovery200504.wsdl create mode 100644 unittests/ws_discovery_wsdl/ws_discovery_wsdl.pro diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index ef895f295..120126bb6 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -40,3 +40,4 @@ WSDL parser / code generator changes, applying to both client and server side: * Added functionality to prevent downloading the same WSDL/XSD file twice in one run * Added "hasValueFor{MemberName}()" accessor function, for optional elements * Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators +* Added support for generating messages for WSDL files without services or bindings diff --git a/kdwsdl2cpp/wsdl/definitions.cpp b/kdwsdl2cpp/wsdl/definitions.cpp index c414c3eb4..dc4212e33 100644 --- a/kdwsdl2cpp/wsdl/definitions.cpp +++ b/kdwsdl2cpp/wsdl/definitions.cpp @@ -189,22 +189,42 @@ bool Definitions::loadXML(ParserContext *context, const QDomElement &element) void Definitions::fixUpDefinitions(/*ParserContext *context, const QDomElement &element */) { if (mServices.isEmpty()) { - Q_ASSERT(!mBindings.isEmpty()); - qDebug() << "No service tag found in the wsdl file, generating one service per binding"; - Q_FOREACH (const Binding &bind, mBindings) { - Service service(mTargetNamespace); - service.setName(bind.name() + "Service"); - - Port port(mTargetNamespace); - port.setName(bind.name() + "Port"); - QName bindingName(bind.portTypeName().prefix() + ":" + bind.name()); - bindingName.setNameSpace(bind.nameSpace()); - port.setBindingName(bindingName); - - Port::List portList; - portList.append(port); - service.setPorts(portList); - mServices.append(service); + if (!mBindings.isEmpty()) { + qDebug() << "No service tag found in the wsdl file, generating one service per binding"; + Q_FOREACH (const Binding &bind, mBindings) { + Service service(mTargetNamespace); + service.setName(bind.name() + "Service"); + + Port port(mTargetNamespace); + port.setName(bind.name() + "Port"); + QName bindingName(bind.portTypeName().prefix() + ":" + bind.name()); + bindingName.setNameSpace(bind.nameSpace()); + port.setBindingName(bindingName); + + Port::List portList; + portList.append(port); + service.setPorts(portList); + mServices.append(service); + } + } else { + Q_ASSERT(!mPortTypes.isEmpty()); + qDebug() << "No service or binding tag found in the wsdl file, generating only messages"; + Q_FOREACH (const PortType &portType, mPortTypes) { + Binding binding(mTargetNamespace); + binding.setName(portType.name() + "Binding"); + binding.setPortTypeName(QName(portType.nameSpace(), portType.name())); + binding.setType(Binding::UnknownBinding); + mBindings.append(binding); + + Port port(mTargetNamespace); + port.setName(portType.name()); + port.setBindingName(QName(binding.nameSpace(), binding.name())); + + Service service(mTargetNamespace); + service.setName(portType.name() + "Service"); + service.setPorts(Port::List() << port); + mServices.append(service); + } } } } diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index f059a721f..933c05e54 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -73,6 +73,7 @@ add_subdirectory(vidyo) add_subdirectory(ws_addressing_support) add_subdirectory(ws_usernametoken_support) add_subdirectory(empty_element_wsdl) +add_subdirectory(ws_discovery_wsdl) # These need internet access add_subdirectory(webcalls) diff --git a/unittests/ws_discovery_wsdl/CMakeLists.txt b/unittests/ws_discovery_wsdl/CMakeLists.txt new file mode 100644 index 000000000..82c6882bc --- /dev/null +++ b/unittests/ws_discovery_wsdl/CMakeLists.txt @@ -0,0 +1,9 @@ +project(ws_discovery_wsdl) + +set(KSWSDL2CPP_OPTION -use-local-files-only) +set(WSDL_FILES ws_discovery200504.wsdl) +set(ws_discovery_wsdl_SRCS test_ws_discovery_wsdl.cpp wsdl_ws_discovery200504.cpp) + +set(EXTRA_LIBS ${QT_QTXML_LIBRARY}) + +add_unittest(${ws_discovery_wsdl_SRCS} ) diff --git a/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2004/08/addressing b/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2004/08/addressing new file mode 100644 index 000000000..8a668e2d3 --- /dev/null +++ b/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2004/08/addressing @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must appear first (before any extensibility elements). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd b/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd new file mode 100644 index 000000000..37d2635b5 --- /dev/null +++ b/unittests/ws_discovery_wsdl/schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.xsd @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp new file mode 100644 index 000000000..d3001a0b6 --- /dev/null +++ b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp @@ -0,0 +1,142 @@ +/**************************************************************************** +** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +#include "wsdl_ws_discovery200504.h" +#include "httpserver_p.h" +#include "KDSoapMessageReader_p.h" +#include + +// Apperently the original file is not available anymore: http://schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.wsdl +// However it is available via: https://web.archive.org/web/20070225062601/http://schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.wsdl + +using namespace KDSoapUnitTestHelpers; + +class WSDiscoveryTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void testGeneratingProbe() + { + // Types + QStringList typeList; + typeList << "i:PrintBasic"; //namespace: http://printer.example.org/2003/imaging + TNS__QNameListType types; + types.setEntries(typeList); + + // Scopes + QStringList uriStringList; + uriStringList << "ldap:///ou=engineering,o=examplecom,c=us"; + TNS__UriListType uriList; + uriList.setEntries(uriStringList); + TNS__ScopesType scopes; + scopes.setValue(uriList); + scopes.setMatchBy("http://schemas.xmlsoap.org/ws/2005/04/discovery/ldap"); + + // Probe + TNS__ProbeType probe; + probe.setTypes(types); + probe.setScopes(scopes); + + // Check what we sent + QByteArray expectedRequestXml = + QByteArray("" + "" + "i:PrintBasic" + "" + "ldap:///ou=engineering,o=examplecom,c=us" + "" + ""); + + KDSoapValue value = probe.serialize("Probe"); + value.setNamespaceUri("http://schemas.xmlsoap.org/ws/2005/04/discovery"); + QVERIFY(xmlBufferCompare(value.toXml(), expectedRequestXml)); + } + + void testReceivingProbe() + { + QByteArray incommingXmlData = QByteArray( + "" + "" + "" + "" + "" + "" + "" + "uuid:98190dc2-0890-4ef8-ac9a-5940995e6119" + "" + "" + "i:PrintBasic i:PrintAdvanced" + "" + "ldap:///ou=engineering,o=examplecom,c=us " + "ldap:///ou=floor1,ou=b42,ou=anytown,o=examplecom,c=us " + "http://itdept/imaging/deployment/2004-12-04" + "" + "http://prn-example/PRN42/b42-1668-a" + "75965" + "" + "" + "" + ""); + + KDSoapMessage replyMessage; + KDSoapHeaders replyHeaders; + + KDSoapMessageReader reader; + reader.xmlToMessage(incommingXmlData, &replyMessage, 0, &replyHeaders, KDSoap::SOAP1_2); + + TNS__ProbeMatchesType probeMatches; + probeMatches.deserialize(replyMessage); + + const QList< TNS__ProbeMatchType >& probeMatchList = probeMatches.probeMatch(); + QCOMPARE(probeMatchList.size(), 1); + const TNS__ProbeMatchType& probeMatch = probeMatchList.value(0); + QCOMPARE(probeMatch.endpointReference().address(), QString("uuid:98190dc2-0890-4ef8-ac9a-5940995e6119")); + const QStringList& typeList = probeMatch.types().entries(); + QCOMPARE(typeList.size(), 2); + QCOMPARE(typeList.value(0), QString("i:PrintBasic")); + QCOMPARE(typeList.value(1), QString("i:PrintAdvanced")); + const QStringList& scopeList = probeMatch.scopes().value().entries(); + QCOMPARE(scopeList.size(), 3); + QCOMPARE(scopeList.value(0), QString("ldap:///ou=engineering,o=examplecom,c=us")); + QCOMPARE(scopeList.value(1), QString("ldap:///ou=floor1,ou=b42,ou=anytown,o=examplecom,c=us")); + QCOMPARE(scopeList.value(2), QString("http://itdept/imaging/deployment/2004-12-04")); + const QStringList& xaddrList = probeMatch.xAddrs().entries(); + QCOMPARE(xaddrList.size(), 1); + QCOMPARE(xaddrList.value(0), QString("http://prn-example/PRN42/b42-1668-a")); + QCOMPARE(probeMatch.metadataVersion(), 75965); + } +}; + +QTEST_MAIN(WSDiscoveryTest) + +#include "test_ws_discovery_wsdl.moc" diff --git a/unittests/ws_discovery_wsdl/ws_discovery200504.wsdl b/unittests/ws_discovery_wsdl/ws_discovery200504.wsdl new file mode 100644 index 000000000..924e09014 --- /dev/null +++ b/unittests/ws_discovery_wsdl/ws_discovery200504.wsdl @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/ws_discovery_wsdl/ws_discovery_wsdl.pro b/unittests/ws_discovery_wsdl/ws_discovery_wsdl.pro new file mode 100644 index 000000000..3bd977aac --- /dev/null +++ b/unittests/ws_discovery_wsdl/ws_discovery_wsdl.pro @@ -0,0 +1,9 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = test_ws_discovery_wsdl.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = ws_discovery200504.wsdl From 507c3e25a7f59ec9606aa76a91319deec243ec79 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 13 Feb 2019 19:20:46 +0100 Subject: [PATCH 042/679] Fix compilation with Qt4 --- unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp index d3001a0b6..9fb17fd76 100644 --- a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp +++ b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp @@ -120,7 +120,7 @@ private Q_SLOTS: const QList< TNS__ProbeMatchType >& probeMatchList = probeMatches.probeMatch(); QCOMPARE(probeMatchList.size(), 1); const TNS__ProbeMatchType& probeMatch = probeMatchList.value(0); - QCOMPARE(probeMatch.endpointReference().address(), QString("uuid:98190dc2-0890-4ef8-ac9a-5940995e6119")); + QCOMPARE(QString(probeMatch.endpointReference().address()), QString("uuid:98190dc2-0890-4ef8-ac9a-5940995e6119")); const QStringList& typeList = probeMatch.types().entries(); QCOMPARE(typeList.size(), 2); QCOMPARE(typeList.value(0), QString("i:PrintBasic")); @@ -133,7 +133,7 @@ private Q_SLOTS: const QStringList& xaddrList = probeMatch.xAddrs().entries(); QCOMPARE(xaddrList.size(), 1); QCOMPARE(xaddrList.value(0), QString("http://prn-example/PRN42/b42-1668-a")); - QCOMPARE(probeMatch.metadataVersion(), 75965); + QCOMPARE(int(probeMatch.metadataVersion()), 75965); } }; From 29cf9afcf42eea9c0189f22ad84c5cee05a6612a Mon Sep 17 00:00:00 2001 From: ryanenzo <36889109+ryanenzo@users.noreply.github.com> Date: Fri, 22 Feb 2019 11:31:30 +0100 Subject: [PATCH 043/679] - Fix for debugHelper if there is an error parsing the data (e.g. empty document) (#162) --- src/KDSoapClient/KDSoapPendingCall.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 83398a565..b62f8a07f 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -60,7 +60,7 @@ static void debugHelper(const QByteArray &data, const QList Date: Mon, 25 Feb 2019 10:37:27 +0100 Subject: [PATCH 044/679] Support xsd:qname (#146) * Pass KDSoapValue further into the deserialize process * Store the namespace declarations with KDSoapValue * Use KDQName to represent a XML QName * Pass KDSoapValue further into the serialize process * Pass KDSoapValue further into the serialize process of builtin types * Write the namespace of qname into the message * Fix includes for Qt4 * KDSoapValue: Small performance improvements * QName: use the combined environment and local namespace declarations * use KDQName for test WS-Discovery * Updated changelog for QName --- doc/CHANGES_1_8.txt | 10 ++ kdwsdl2cpp/src/converter_clientstub.cpp | 8 +- kdwsdl2cpp/src/converter_complextype.cpp | 16 +-- kdwsdl2cpp/src/converter_simpletype.cpp | 48 ++++--- kdwsdl2cpp/src/elementargumentserializer.cpp | 8 +- kdwsdl2cpp/src/typemap.cpp | 43 +++--- kdwsdl2cpp/src/typemap.h | 2 +- src/KDSoapClient/CMakeLists.txt | 3 + src/KDSoapClient/KDQName.cpp | 136 ++++++++++++++++++ src/KDSoapClient/KDQName.h | 86 +++++++++++ src/KDSoapClient/KDSoapMessageReader.cpp | 7 +- src/KDSoapClient/KDSoapValue.cpp | 45 ++++++ src/KDSoapClient/KDSoapValue.h | 38 +++++ unittests/empty_list_wsdl/empty_list_wsdl.cpp | 12 +- unittests/enum_escape/test_enum.cpp | 4 +- .../test_ws_discovery_wsdl.cpp | 19 ++- .../wsdl_document/test_wsdl_document.cpp | 2 +- 17 files changed, 412 insertions(+), 75 deletions(-) create mode 100644 src/KDSoapClient/KDQName.cpp create mode 100644 src/KDSoapClient/KDQName.h diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 120126bb6..0b6579e43 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -30,6 +30,14 @@ Server-side: WSDL parser / code generator changes, applying to both client and server side: ================================================================ +* Source incompatible change: all deserialize() functions now require a KDSoapValue instead of a + QVariant. If you use a deserialize(QVariant) function, you need to port your code to use + KDSoapValue::setValue(QVariant) before deserialize() +* Source incompatible change: all serialize() functions now return a KDSoapValue instead of a + QVariant. If you use a QVariant serialize() function, you need to port your code to use + QVariant KDSoapValue::value() after serialize() +* Source incompatible change: xs:QName is now respresented by KDQName instead of QString, which + allows the namespace to be extracted. The old behaviour is available via KDQName::qname(). * Fix double-handling of empty elements * Fix fault elements being generated in the wrong namespace, must be SOAP-ENV:Fault (github issue #81). * Added import-path argument for setting the local path to get (otherwise downloaded) files from. @@ -41,3 +49,5 @@ WSDL parser / code generator changes, applying to both client and server side: * Added "hasValueFor{MemberName}()" accessor function, for optional elements * Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators * Added support for generating messages for WSDL files without services or bindings +* KDSoapValue now stores the namespace declarations during parsing of a message and writes + namespace declarations during sending of a message diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index cc1669c0e..0c6a4aec8 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -611,13 +611,13 @@ KODE::Code Converter::deserializeRetVal(const KWSDL::Part &part, const QString & const bool isComplex = mTypeMap.isComplexType(part.type(), part.element()); const bool isPolymorphic = mTypeMap.isPolymorphic(part.type(), part.element()); if (isBuiltin) { - code += varName + QLatin1String(" = ") + mTypeMap.deserializeBuiltin(part.type(), part.element(), replyMsgName + QLatin1String(".value()"), qtRetType) + QLatin1String(";") + COMMENT; + code += varName + QLatin1String(" = ") + mTypeMap.deserializeBuiltin(part.type(), part.element(), replyMsgName, qtRetType) + QLatin1String(";") + COMMENT; } else if (isComplex) { const QString op = isPolymorphic ? "->" : "."; code += varName + op + QLatin1String("deserialize(") + replyMsgName + QLatin1String(");") + COMMENT; } else { // testcase: MyWsdlDocument::sendTelegram - code += varName + QLatin1String(".deserialize(") + replyMsgName + QLatin1String(".value());") + COMMENT; + code += varName + QLatin1String(".deserialize(") + replyMsgName + QLatin1String(");") + COMMENT; } return code; } @@ -822,10 +822,6 @@ void Converter::convertClientOutputMessage(const Operation &operation, partNames << value + QLatin1String(".value().value<") + partType + QLatin1String(">()"); } else { slotCode += partType + QLatin1String(" ret;"); // local var. TODO ret1/ret2 etc. if more than one. - const bool isComplex = mTypeMap.isComplexType(part.type(), part.element()); - if (!isComplex) { - value += QLatin1String(".value()"); - } slotCode += QLatin1String("ret.deserialize(") + value + QLatin1String(");") + COMMENT; partNames << QLatin1String("ret"); } diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index b416ee7fd..18dff6966 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -426,11 +426,11 @@ KODE::Code Converter::demarshalVarHelper(const QName &type, const QName &element if (mTypeMap.isTypeAny(type)) { code += variableName + QLatin1String(" = ") + soapValueVarName + QLatin1String(";") + COMMENT; } else if (mTypeMap.isBuiltinType(type, elementType)) { - code += variableName + QLatin1String(" = ") + mTypeMap.deserializeBuiltin(type, elementType, soapValueVarName + QLatin1String(".value()"), qtTypeName) + QLatin1String(";") + COMMENT; + code += variableName + QLatin1String(" = ") + mTypeMap.deserializeBuiltin(type, elementType, soapValueVarName, qtTypeName) + QLatin1String(";") + COMMENT; } else if (mTypeMap.isComplexType(type, elementType)) { code += variableName + QLatin1String(".deserialize(") + soapValueVarName + QLatin1String(");") + COMMENT; } else { - code += variableName + QLatin1String(".deserialize(") + soapValueVarName + QLatin1String(".value());") + COMMENT; + code += variableName + QLatin1String(".deserialize(") + soapValueVarName + QLatin1String(");") + COMMENT; } if (optional) { code += variableName + QLatin1String("_nil = false;") + COMMENT; @@ -516,22 +516,16 @@ void Converter::createComplexTypeSerializer(KODE::Class &newClass, const XSD::Co const QString variableName = QLatin1String("d_ptr->") + variable.name(); if (mTypeMap.isComplexType(baseName)) { - //marshalCode += QLatin1String("KDSoapValue mainValue = ") + variableName + QLatin1String(".serialize(valueName);") + COMMENT; - //marshalCode += QLatin1String("mainValue.setType(") + typeArgs + QLatin1String(");"); marshalCode += QLatin1String("KDSoapValue mainValue = ") + typeName + QLatin1String("::serialize(valueName);") + COMMENT; marshalCode += QLatin1String("mainValue.setType(") + typeArgs + QLatin1String(");"); - //demarshalCode += demarshalVar( baseName, QName(), variableName, typeName, QLatin1String("mainValue") ); - demarshalCode += typeName + "::deserialize(mainValue);"; - //demarshalCode += demarshalVar( baseName, QName(), variableName, typeName, QLatin1String("mainValue") ); } else { - QString value; if (mTypeMap.isBuiltinType(baseName)) { - value = mTypeMap.serializeBuiltin(baseName, QName(), variableName, typeName); + marshalCode += QLatin1String("KDSoapValue mainValue = ") + mTypeMap.serializeBuiltin(baseName, QName(), variableName, "valueName", type->nameSpace(), type->name()) + QLatin1String(";") + COMMENT; } else { - value += variableName + QLatin1String(".serialize()"); + marshalCode += QLatin1String("KDSoapValue mainValue = ") + variableName + QLatin1String(".serialize(valueName);") + COMMENT; + marshalCode += QLatin1String("mainValue.setType(") + typeArgs + QLatin1String(");"); } - marshalCode += QLatin1String("KDSoapValue mainValue(valueName, ") + value + QLatin1String(", ") + typeArgs + QLatin1String(");") + COMMENT; demarshalCode += demarshalVar(baseName, QName(), variableName, typeName, QLatin1String("mainValue"), false, false); } diff --git a/kdwsdl2cpp/src/converter_simpletype.cpp b/kdwsdl2cpp/src/converter_simpletype.cpp index ec7bece3f..6a6827183 100644 --- a/kdwsdl2cpp/src/converter_simpletype.cpp +++ b/kdwsdl2cpp/src/converter_simpletype.cpp @@ -278,11 +278,12 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim { const QString typeName = mTypeMap.localType(type->qualifiedName()); - KODE::Function serializeFunc("serialize", "QVariant"); + KODE::Function serializeFunc(QLatin1String("serialize"), QLatin1String("KDSoapValue")); + serializeFunc.addArgument(QLatin1String("const QString& valueName")); serializeFunc.setConst(true); KODE::Function deserializeFunc("deserialize", "void"); - deserializeFunc.addArgument("const QVariant& value"); + deserializeFunc.addArgument("const KDSoapValue& mainValue"); switch (type->subType()) { case XSD::SimpleType::TypeRestriction: @@ -304,7 +305,7 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim for (int i = 0; i < enums.count(); ++i) { code += "case " + typeName + "::" + escapedEnums[ i ] + ':'; code.indent(); - code += "return QString::fromLatin1(\"" + enums[ i ] + "\");"; + code += "return KDSoapValue(valueName, \"" + enums[i] + "\", " + namespaceString(type->nameSpace()) + ", QString::fromLatin1(\"" + type->name() + "\"));"; code.unindent(); /* add a hack for msvc because that one cannot parse switch statements longer than a certain length, so start a new switch statement */ @@ -326,7 +327,7 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim code.unindent(); code += '}'; code.newLine(); - code += "return QVariant();"; + code += "return KDSoapValue();"; serializeFunc.setBody(code); } { @@ -336,7 +337,7 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim code += "{ \"" + enums[ i ] + "\", " + typeName + "::" + escapedEnums[ i ] + " }" + (i < enums.count() - 1 ? "," : ""); } code += "};"; - code += "const QString str = value.toString();"; + code += "const QString str = mainValue.value().toString();"; code += "for ( int i = 0; i < " + QString::number(enums.count()) + "; ++i ) {"; code.indent(); code += "if (str == QLatin1String(s_values[i].name)) {"; @@ -366,11 +367,13 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim //const QName mostBasicTypeName = simpleTypeList.mostBasicType( baseType ); //Q_UNUSED(mostBasicTypeName); if (mTypeMap.isBuiltinType(baseType)) { // serialize from QString, int, etc. - serializeFunc.addBodyLine("return " + mTypeMap.serializeBuiltin(baseType, QName(), variableName, baseTypeName) + ";" + COMMENT); - deserializeFunc.addBodyLine(variableName + " = " + mTypeMap.deserializeBuiltin(baseType, QName(), "value", baseTypeName) + ";" + COMMENT); + serializeFunc.addBodyLine("return " + mTypeMap.serializeBuiltin(baseType, QName(), variableName, "valueName", type->nameSpace(), type->name()) + ";" + COMMENT); + deserializeFunc.addBodyLine(variableName + " = " + mTypeMap.deserializeBuiltin(baseType, QName(), "mainValue", baseTypeName) + ";" + COMMENT); } else { // inherits another simple type, need to call its serialize/deserialize method - serializeFunc.addBodyLine("return " + variableName + ".serialize();" + COMMENT); - deserializeFunc.addBodyLine(variableName + ".deserialize( value );" + COMMENT); + serializeFunc.addBodyLine("KDSoapValue value = mValue.serialize(valueName);"); + serializeFunc.addBodyLine("value.setType(" + namespaceString(type->nameSpace()) + ", QString::fromLatin1(\"" + type->name() + "\"));"); + serializeFunc.addBodyLine("return value;" + COMMENT); + deserializeFunc.addBodyLine(variableName + ".deserialize( mainValue );" + COMMENT); } } @@ -382,6 +385,7 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim { KODE::Code code; code += "QString str;"; + code += "QXmlStreamNamespaceDeclarations decls;"; code += "for ( int i = 0; i < " + variableName + ".count(); ++i ) {"; code.indent(); code += "if (!str.isEmpty())"; @@ -390,28 +394,34 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim code.unindent(); if (itemTypeName == "QString") { // special but common case, no conversion needed code += "str += " + variableName + ".at(i);"; - } else if (mTypeMap.isBuiltinType(baseName)) { // serialize from int, float, bool, etc. - code += "str += QVariant(" + variableName + ".at(i)).toString();"; } else { - code += "str += " + variableName + ".at(i).serialize().toString();"; + if (mTypeMap.isBuiltinType(baseName)) { // serialize from int, float, bool, etc. + code += "KDSoapValue subValue = " + mTypeMap.serializeBuiltin(baseName, QName(), variableName + ".at(i)", "QString()", QString(), QString()) + ";"; + } else { + code += "KDSoapValue subValue = " + variableName + ".at(i).serialize(QString());"; + } + code += "str += subValue.value().toString();"; + code += "decls += subValue.namespaceDeclarations();"; } code.unindent(); code += "}"; - code += "return str;"; + code += "KDSoapValue value(valueName, str, " + namespaceString(type->nameSpace()) + ", QString::fromLatin1(\"" + type->name() + "\"));"; + code += "value.setNamespaceDeclarations(decls);"; + code += "return value;"; serializeFunc.setBody(code); } { newClass.addHeaderInclude("QtCore/QStringList"); KODE::Code code; - code += "if (value.toString().trimmed().isEmpty()) return;"; - code += "const QStringList list = value.toString().split(QLatin1Char(' '));"; + code += "if (mainValue.value().toString().trimmed().isEmpty()) return;"; + code += "const KDSoapValueList list = mainValue.split();"; code += "for (int i = 0; i < list.count(); ++i) {"; code.indent(); QString val = QString::fromLatin1("list.at(i)"); if (itemTypeName == "QString") - /*nothing to do*/; + val = val + ".value().toString()"; else if (mTypeMap.isBuiltinType(baseName)) { // deserialize to int, float, bool, etc. - val = "QVariant(" + val + ").value<" + itemTypeName + ">()"; + val = mTypeMap.deserializeBuiltin(baseName, QName(), val, itemTypeName); } else { code += itemTypeName + " tmp;"; code += "tmp.deserialize(" + val + ");"; @@ -428,12 +438,12 @@ void Converter::createSimpleTypeSerializer(KODE::Class &newClass, const XSD::Sim const QString variableName = KODE::MemberVariable::memberVariableName("value"); { KODE::Code code; - code += "return " + variableName + ";" + COMMENT; + code += "return KDSoapValue(valueName, " + variableName + ", " + namespaceString(type->nameSpace()) + ", QString::fromLatin1(\"" + type->name() + "\"));"; serializeFunc.setBody(code); } { KODE::Code code; - code += variableName + " = value;" + COMMENT; + code += variableName + " = mainValue.value();" + COMMENT; deserializeFunc.setBody(code); } break; diff --git a/kdwsdl2cpp/src/elementargumentserializer.cpp b/kdwsdl2cpp/src/elementargumentserializer.cpp index b71a9570a..dc9733f81 100644 --- a/kdwsdl2cpp/src/elementargumentserializer.cpp +++ b/kdwsdl2cpp/src/elementargumentserializer.cpp @@ -102,12 +102,10 @@ KODE::Code ElementArgumentSerializer::generate() const block += QLatin1String("KDSoapValue ") + mValueVarName + QLatin1Char('(') + mLocalVarName + op + QLatin1String("serialize(") + mNameArg + QLatin1String("));") + COMMENT; } else { if (mTypeMap.isBuiltinType(mType, mElementType)) { - const QString qtTypeName = mTypeMap.localType(mType, mElementType); - const QString value = mTypeMap.serializeBuiltin(mType, mElementType, mLocalVarName, qtTypeName); - - block += QLatin1String("KDSoapValue ") + mValueVarName + QLatin1String("(") + mNameArg + QLatin1String(", ") + value + QLatin1String(", ") + typeArgs + QLatin1String(");") + COMMENT; + const QString value = mTypeMap.serializeBuiltin(mType, mElementType, mLocalVarName, mNameArg, actualType.nameSpace(), actualType.localName()); + block += QLatin1String("KDSoapValue ") + mValueVarName + QLatin1String(" = ") + value + QLatin1String(";") + COMMENT; } else { - block += QLatin1String("KDSoapValue ") + mValueVarName + QLatin1String("(") + mNameArg + QLatin1String(", ") + mLocalVarName + QLatin1String(".serialize(), ") + typeArgs + QLatin1String(");") + COMMENT; + block += QLatin1String("KDSoapValue ") + mValueVarName + QLatin1String(" = ") + mLocalVarName + QLatin1String(".serialize(") + mNameArg + QLatin1String(");") + COMMENT; } } if (!mNameNamespace.isEmpty()) { diff --git a/kdwsdl2cpp/src/typemap.cpp b/kdwsdl2cpp/src/typemap.cpp index ba8af370e..4a9ca33c7 100644 --- a/kdwsdl2cpp/src/typemap.cpp +++ b/kdwsdl2cpp/src/typemap.cpp @@ -23,6 +23,7 @@ #include #include "typemap.h" +#include "converter.h" using namespace KWSDL; @@ -92,7 +93,7 @@ TypeMap::TypeMap() addBuiltinType("nonPositiveInteger", "qint64"); // unbounded (-inf to 0) addBuiltinType("normalizedString", "QString"); addBuiltinType("positiveInteger", "quint64"); // unbounded (1 to inf) - addBuiltinType("QName", "QString"); + addBuiltinType("QName", "KDQName"); addBuiltinType("short", "int"); // 16 bits. But QVariant doesn't support short. addBuiltinType("string", "QString"); addBuiltinType("time", "QTime"); @@ -572,34 +573,40 @@ QString KWSDL::TypeMap::deserializeBuiltin(const QName &typeName, const QName &e { const QName type = typeName.isEmpty() ? baseTypeForElement(elementName) : typeName; if (type.nameSpace() == XMLSchemaURI && type.localName() == "hexBinary") { - return "QByteArray::fromHex(" + var + ".toString().toLatin1())"; + return "QByteArray::fromHex(" + var + ".value().toString().toLatin1())"; } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "base64Binary") { - return "QByteArray::fromBase64(" + var + ".toString().toLatin1())"; + return "QByteArray::fromBase64(" + var + ".value().toString().toLatin1())"; } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "dateTime") { Q_ASSERT(qtTypeName == QLatin1String("KDDateTime")); - return "KDDateTime::fromDateString(" + var + ".toString())"; + return "KDDateTime::fromDateString(" + var + ".value().toString())"; + } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "QName") { + Q_ASSERT(qtTypeName == QLatin1String("KDQName")); + return "KDQName::fromSoapValue(" + var + ")"; } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "anySimpleType") { - return var; + return var + ".value()"; } else { - return var + ".value<" + qtTypeName + ">()"; + return var + ".value().value<" + qtTypeName + ">()"; } } -QString KWSDL::TypeMap::serializeBuiltin(const QName &typeName, const QName &elementName, const QString &var, const QString &qtTypeName) const +QString KWSDL::TypeMap::serializeBuiltin(const QName &baseTypeName, const QName &elementName, const QString &var, const QString &name, const QString &typeNameSpace, const QString &typeName) const { - Q_UNUSED(qtTypeName); - const QName type = typeName.isEmpty() ? baseTypeForElement(elementName) : typeName; + QString value; + const QName baseType = baseTypeName.isEmpty() ? baseTypeForElement(elementName) : baseTypeName; // variantToTextValue also has support for calling toHex/toBase64 at runtime, but this fails // when the type derives from hexBinary and is named differently, see Telegram testcase. - if (type.nameSpace() == XMLSchemaURI && type.localName() == "hexBinary") { - return "QString::fromLatin1(" + var + ".toHex().constData())"; - } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "base64Binary") { - return "QString::fromLatin1(" + var + ".toBase64().constData())"; - } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "dateTime") { - return var + ".toDateString()"; - } else if (type.nameSpace() == XMLSchemaURI && type.localName() == "anySimpleType") { - return var; + if (baseType.nameSpace() == XMLSchemaURI && baseType.localName() == "hexBinary") { + value = "QString::fromLatin1(" + var + ".toHex().constData())"; + } else if (baseType.nameSpace() == XMLSchemaURI && baseType.localName() == "base64Binary") { + value = "QString::fromLatin1(" + var + ".toBase64().constData())"; + } else if (baseType.nameSpace() == XMLSchemaURI && baseType.localName() == "dateTime") { + value = var + ".toDateString()"; + } else if (baseType.nameSpace() == XMLSchemaURI && baseType.localName() == "QName") { + return var + ".toSoapValue(" + name + ", " + namespaceString(typeNameSpace) + ", QString::fromLatin1(\"" + typeName + "\"))"; + } else if (baseType.nameSpace() == XMLSchemaURI && baseType.localName() == "anySimpleType") { + value = var; } else { - return "QVariant::fromValue(" + var + ")"; + value = "QVariant::fromValue(" + var + ")"; } + return "KDSoapValue(" + name + ", " + value + ", " + namespaceString(typeNameSpace) + ", QString::fromLatin1(\"" + typeName + "\"))"; } diff --git a/kdwsdl2cpp/src/typemap.h b/kdwsdl2cpp/src/typemap.h index 2721b38ce..b381cb66c 100644 --- a/kdwsdl2cpp/src/typemap.h +++ b/kdwsdl2cpp/src/typemap.h @@ -108,7 +108,7 @@ class TypeMap * Return C++ code for converting the variant in "var" into the right type. */ QString deserializeBuiltin(const QName &typeName, const QName &elementName, const QString &var, const QString &qtTypeName) const; - QString serializeBuiltin(const QName &typeName, const QName &elementName, const QString &var, const QString &qtTypeName) const; + QString serializeBuiltin(const QName &baseTypeName, const QName &elementName, const QString &var, const QString &name, const QString &typeNameSpace, const QString &typeName) const; QString localTypeForAttribute(const QName &typeName) const; QStringList headersForAttribute(const QName &typeName) const; diff --git a/src/KDSoapClient/CMakeLists.txt b/src/KDSoapClient/CMakeLists.txt index 1758ca385..dd4776840 100644 --- a/src/KDSoapClient/CMakeLists.txt +++ b/src/KDSoapClient/CMakeLists.txt @@ -28,6 +28,7 @@ set(SOURCES KDSoapFaultException.cpp KDSoapMessageAddressingProperties.cpp KDSoapEndpointReference.cpp + KDQName.cpp ) add_library(kdsoap ${KDSoap_LIBRARY_MODE} ${SOURCES}) @@ -67,6 +68,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapEndpointReference KDSoapPendingCall KDSoapAuthentication + KDQName COMMON_HEADER KDSoapClient ) @@ -88,6 +90,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapFaultException.h KDSoapMessageAddressingProperties.h KDSoapEndpointReference.h + KDQName.h DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient ) diff --git a/src/KDSoapClient/KDQName.cpp b/src/KDSoapClient/KDQName.cpp new file mode 100644 index 000000000..793de80a7 --- /dev/null +++ b/src/KDSoapClient/KDQName.cpp @@ -0,0 +1,136 @@ +/* + This file is part of KDE Schema Parser + + Copyright (c) 2005 Tobias Koenig + based on wsdlpull parser by Vivek Krishna + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#include "KDQName.h" +#include + +#include + +KDQName::KDQName() +{ +} + +KDQName::KDQName( const QString &name ) +{ + parse( name ); +} + +KDQName::KDQName( const QString &nameSpace, const QString &localName ) + : mNameSpace( nameSpace ), mLocalName( localName ) +{ + Q_ASSERT(!localName.contains(QLatin1Char(':'))); +} + +void KDQName::operator=( const QString &name ) +{ + parse( name ); +} + +QString KDQName::localName() const +{ + return mLocalName; +} + +QString KDQName::prefix() const +{ + return mPrefix; +} + +QString KDQName::qname() const +{ + if ( mPrefix.isEmpty() ) + return mLocalName; + else + return mPrefix + QLatin1Char(':') + mLocalName; +} + +void KDQName::setNameSpace( const QString &nameSpace ) +{ + mNameSpace = nameSpace; +} + +QString KDQName::nameSpace() const +{ + return mNameSpace; +} + +bool KDQName::operator==( const KDQName &qname ) const +{ + return (qname.nameSpace() == mNameSpace && qname.localName() == mLocalName); +} + +bool KDQName::operator!=( const KDQName &qname ) const +{ + return !operator==( qname ); +} + +bool KDQName::isEmpty() const +{ + return (mNameSpace.isEmpty() && mLocalName.isEmpty()); +} + +KDQName KDQName::fromSoapValue(const KDSoapValue &value) +{ + KDQName qname; + qname.parse(value.value().toString()); + + QXmlStreamNamespaceDeclarations decls = value.environmentNamespaceDeclarations(); + for (int i = 0; i < decls.count(); ++i) { + const QXmlStreamNamespaceDeclaration &decl = decls.at(i); + if (decl.prefix() == qname.prefix()) { + qname.setNameSpace(decl.namespaceUri().toString()); + } + } + + return qname; +} + +KDSoapValue KDQName::toSoapValue(const QString &name, const QString &typeNameSpace, const QString &typeName) const +{ + KDSoapValue value = KDSoapValue(name, qname(), typeNameSpace, typeName); + if ( !mPrefix.isEmpty() && !mNameSpace.isEmpty() ) { + QXmlStreamNamespaceDeclaration decl(mPrefix, mNameSpace); + value.addNamespaceDeclaration(decl); + } + return value; +} + +void KDQName::parse( const QString &str ) +{ + int pos = str.indexOf( QLatin1Char(':') ); + if ( pos != -1 ) { + mPrefix = str.left( pos ); + mLocalName = str.mid( pos + 1 ); + } else { + mLocalName = str; + } + Q_ASSERT(!mLocalName.contains(QLatin1Char(':'))); +} + +QDebug operator <<(QDebug dbg, const KDQName &qn) +{ + if (!qn.nameSpace().isEmpty()) + dbg << "(" << qn.nameSpace() << "," << qn.localName() << ")"; + else + dbg << qn.qname(); + return dbg; +} diff --git a/src/KDSoapClient/KDQName.h b/src/KDSoapClient/KDQName.h new file mode 100644 index 000000000..21046d50b --- /dev/null +++ b/src/KDSoapClient/KDQName.h @@ -0,0 +1,86 @@ +/* + This file is part of KDE. + + Copyright (c) 2005 Tobias Koenig + based on wsdlpull parser by Vivek Krishna + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ + +#ifndef KDQNAME_H +#define KDQNAME_H + +#include +#include +#include +#include + +class KDSoapValue; + +#include "KDSoapGlobal.h" + +class KDSOAP_EXPORT KDQName +{ + public: + typedef QList List; + + KDQName(); + + // Create a KDQName with prefix+localname + explicit KDQName( const QString &name ); + + // Create a KDQName with namespace+localname + KDQName( const QString &nameSpace, const QString &localName ); + + void operator=( const QString &name ); + + QString localName() const; + QString prefix() const; + QString qname() const; + + void setNameSpace( const QString &nameSpace ); + QString nameSpace() const; + + bool operator==( const KDQName& ) const; + bool operator!=( const KDQName& ) const; + + bool isEmpty() const; + + /** + * Creates a KDQName from a KDSoapValue. + */ + static KDQName fromSoapValue(const KDSoapValue &value); + + /** + * Returns a KDSoapValue representation. + */ + KDSoapValue toSoapValue(const QString &name, const QString &typeNameSpace = QString(), const QString &typeName = QString()) const; + + private: + void parse( const QString& ); + + QString mNameSpace; + QString mLocalName; + QString mPrefix; +}; + +Q_DECLARE_METATYPE(KDQName) + +inline uint qHash(const KDQName& qn) { return qHash(qn.nameSpace())^qHash(qn.localName()); } + +QDebug operator<<(QDebug dbg, const KDQName &qn); + +#endif diff --git a/src/KDSoapClient/KDSoapMessageReader.cpp b/src/KDSoapClient/KDSoapMessageReader.cpp index 645b06dc0..50a953260 100644 --- a/src/KDSoapClient/KDSoapMessageReader.cpp +++ b/src/KDSoapClient/KDSoapMessageReader.cpp @@ -92,9 +92,12 @@ static int xmlTypeToMetaType(const QString &xmlType) static KDSoapValue parseElement(QXmlStreamReader &reader, const QXmlStreamNamespaceDeclarations &envNsDecls) { + const QXmlStreamNamespaceDeclarations combinedNamespaceDeclarations = envNsDecls + reader.namespaceDeclarations(); const QString name = reader.name().toString(); KDSoapValue val(name, QVariant()); val.setNamespaceUri(reader.namespaceUri().toString()); + val.setNamespaceDeclarations(reader.namespaceDeclarations()); + val.setEnvironmentNamespaceDeclarations(combinedNamespaceDeclarations); //qDebug() << "parsing" << name; QVariant::Type metaTypeId = QVariant::Invalid; @@ -112,7 +115,7 @@ static KDSoapValue parseElement(QXmlStreamReader &reader, const QXmlStreamNamesp const QString type = attrValue.toString(); const int pos = type.indexOf(QLatin1Char(':')); const QString dataType = type.mid(pos + 1); - val.setType(namespaceForPrefix(envNsDecls, type.left(pos)).toString(), dataType); + val.setType(namespaceForPrefix(combinedNamespaceDeclarations, type.left(pos)).toString(), dataType); metaTypeId = static_cast(xmlTypeToMetaType(dataType)); } continue; @@ -132,7 +135,7 @@ static KDSoapValue parseElement(QXmlStreamReader &reader, const QXmlStreamNamesp text = reader.text().toString(); //qDebug() << "text=" << text; } else if (reader.isStartElement()) { - const KDSoapValue subVal = parseElement(reader, envNsDecls); // recurse + const KDSoapValue subVal = parseElement(reader, combinedNamespaceDeclarations); // recurse val.childValues().append(subVal); } } diff --git a/src/KDSoapClient/KDSoapValue.cpp b/src/KDSoapClient/KDSoapValue.cpp index 6c46a40b8..fd2987882 100644 --- a/src/KDSoapClient/KDSoapValue.cpp +++ b/src/KDSoapClient/KDSoapValue.cpp @@ -27,6 +27,7 @@ #include #include #include +#include class KDSoapValue::Private : public QSharedData { @@ -43,6 +44,8 @@ class KDSoapValue::Private : public QSharedData KDSoapValueList m_childValues; bool m_qualified; bool m_nillable; + QXmlStreamNamespaceDeclarations m_environmentNamespaceDeclarations; + QXmlStreamNamespaceDeclarations m_localNamespaceDeclarations; }; uint qHash(const KDSoapValue &value) @@ -120,6 +123,31 @@ void KDSoapValue::setQualified(bool qualified) d->m_qualified = qualified; } +void KDSoapValue::setNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &namespaceDeclarations) +{ + d->m_localNamespaceDeclarations = namespaceDeclarations; +} + +void KDSoapValue::addNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &namespaceDeclaration) +{ + d->m_localNamespaceDeclarations.append(namespaceDeclaration); +} + +QXmlStreamNamespaceDeclarations KDSoapValue::namespaceDeclarations() const +{ + return d->m_localNamespaceDeclarations; +} + +void KDSoapValue::setEnvironmentNamespaceDeclarations(const QXmlStreamNamespaceDeclarations &environmentNamespaceDeclarations) +{ + d->m_environmentNamespaceDeclarations = environmentNamespaceDeclarations; +} + +QXmlStreamNamespaceDeclarations KDSoapValue::environmentNamespaceDeclarations() const +{ + return d->m_environmentNamespaceDeclarations; +} + KDSoapValueList &KDSoapValue::childValues() const { // I want to fool the QSharedDataPointer mechanism here... @@ -274,6 +302,10 @@ void KDSoapValue::writeElementContents(KDSoapNamespacePrefixes &namespacePrefixe { const QVariant value = this->value(); + foreach (const QXmlStreamNamespaceDeclaration& decl, d->m_localNamespaceDeclarations) { + writer.writeNamespace(decl.namespaceUri().toString(), decl.prefix().toString()); + } + if (isNil() && d->m_nillable) { writer.writeAttribute(KDSoapNamespaceManager::xmlSchemaInstance2001(), QLatin1String("nil"), QLatin1String("true")); } @@ -367,6 +399,19 @@ QString KDSoapValue::type() const return d->m_typeName; } +KDSoapValueList KDSoapValue::split() const +{ + KDSoapValueList valueList; + const QStringList list = value().toString().split(QLatin1Char(' '), QString::SkipEmptyParts); + valueList.reserve(list.count()); + for (int i = 0; i < list.count(); ++i) { + KDSoapValue value(*this); + value.setValue(list.at(i)); + valueList << value; + } + return valueList; +} + KDSoapValue KDSoapValueList::child(const QString &name) const { const_iterator it = begin(); diff --git a/src/KDSoapClient/KDSoapValue.h b/src/KDSoapClient/KDSoapValue.h index a5a3f8e03..5c960273a 100644 --- a/src/KDSoapClient/KDSoapValue.h +++ b/src/KDSoapClient/KDSoapValue.h @@ -30,6 +30,7 @@ #include #include #include +#include #include "KDSoapGlobal.h" #ifndef QT_NO_STL @@ -240,6 +241,43 @@ class KDSOAP_EXPORT KDSoapValue */ QString type() const; + /** + * Sets the \p namespaceDeclarations of this value. + * \since 1.8 + */ + void setNamespaceDeclarations(const QXmlStreamNamespaceDeclarations& namespaceDeclarations); + + /** + * Adds a \p namespaceDeclaration to the existing list of namespaceDeclarations. + * \since 1.8 + */ + void addNamespaceDeclaration(const QXmlStreamNamespaceDeclaration& namespaceDeclaration); + + /** + * Returns the namespaceDeclarations of this value as it was during parsing of the message + * \since 1.8 + */ + QXmlStreamNamespaceDeclarations namespaceDeclarations() const; + + /** + * Sets the \p environmentNamespaceDeclarations of this value. + * \since 1.8 + */ + void setEnvironmentNamespaceDeclarations(const QXmlStreamNamespaceDeclarations& environmentNamespaceDeclarations); + + /** + * Returns the namespaceDeclarations of this value and its parents combined as it was during parsing of the message + * \since 1.8 + */ + QXmlStreamNamespaceDeclarations environmentNamespaceDeclarations() const; + + /** + * Returns the list of split values. + * The data is split on spaces and the properties are copied. + * \since 1.8 + */ + KDSoapValueList split() const; + /** * Defines the way the message should be serialized. * See the "use" attribute for soap:body, in the WSDL file. diff --git a/unittests/empty_list_wsdl/empty_list_wsdl.cpp b/unittests/empty_list_wsdl/empty_list_wsdl.cpp index a11bec752..dfbcae20a 100644 --- a/unittests/empty_list_wsdl/empty_list_wsdl.cpp +++ b/unittests/empty_list_wsdl/empty_list_wsdl.cpp @@ -35,7 +35,9 @@ private Q_SLOTS: void testMustReturnEmptyListWhenXmlValueIsEmpty() { NS2__Orientation list; - list.deserialize(QVariant::fromValue(QString(""))); + KDSoapValue soapValue; + soapValue.setValue(QVariant::fromValue(QString(""))); + list.deserialize(soapValue); QVERIFY(list.entries().empty()); } @@ -43,14 +45,18 @@ private Q_SLOTS: { NS2__Orientation list; QVariant null; - list.deserialize(null); + KDSoapValue soapValue; + soapValue.setValue(null); + list.deserialize(soapValue); QVERIFY(list.entries().empty()); } void testMustReturnEmptyListWhenXmlContainsOnlySpaces() { NS2__Orientation list; - list.deserialize(QVariant::fromValue(QString(" \t \t"))); + KDSoapValue soapValue; + soapValue.setValue(QVariant::fromValue(QString(" \t \t"))); + list.deserialize(soapValue); QVERIFY(list.entries().empty()); } }; diff --git a/unittests/enum_escape/test_enum.cpp b/unittests/enum_escape/test_enum.cpp index 2f3d06e17..a3ab9bec7 100644 --- a/unittests/enum_escape/test_enum.cpp +++ b/unittests/enum_escape/test_enum.cpp @@ -51,8 +51,8 @@ void TestEnum::test() ar.setType(TNS__AudienceRating::Http___f_q_d_n_ext_enum2); ar.setType(TNS__AudienceRating::_6Bis); - QVariant var = ar.serialize(); - ar.deserialize(var); + KDSoapValue soapValue = ar.serialize(QString()); + ar.deserialize(soapValue); QCOMPARE(ar.type(), TNS__AudienceRating::_6Bis); } diff --git a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp index 9fb17fd76..d7783a709 100644 --- a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp +++ b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp @@ -1,5 +1,6 @@ /**************************************************************************** ** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2019 Casper Meijn ** All rights reserved. ** ** This file is part of the KD Soap library. @@ -39,10 +40,10 @@ private Q_SLOTS: void testGeneratingProbe() { // Types - QStringList typeList; - typeList << "i:PrintBasic"; //namespace: http://printer.example.org/2003/imaging + KDQName type(QString("i:PrintBasic")); + type.setNameSpace(QString("http://printer.example.org/2003/imaging")); TNS__QNameListType types; - types.setEntries(typeList); + types.setEntries(QList() << type); // Scopes QStringList uriStringList; @@ -67,7 +68,7 @@ private Q_SLOTS: " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" " xmlns:soap-enc=\"http://schemas.xmlsoap.org/soap/encoding/\"" " xmlns:n1=\"http://schemas.xmlsoap.org/ws/2005/04/discovery\">" - "i:PrintBasic" + "i:PrintBasic" "" "ldap:///ou=engineering,o=examplecom,c=us" "" @@ -121,10 +122,14 @@ private Q_SLOTS: QCOMPARE(probeMatchList.size(), 1); const TNS__ProbeMatchType& probeMatch = probeMatchList.value(0); QCOMPARE(QString(probeMatch.endpointReference().address()), QString("uuid:98190dc2-0890-4ef8-ac9a-5940995e6119")); - const QStringList& typeList = probeMatch.types().entries(); + const QList& typeList = probeMatch.types().entries(); QCOMPARE(typeList.size(), 2); - QCOMPARE(typeList.value(0), QString("i:PrintBasic")); - QCOMPARE(typeList.value(1), QString("i:PrintAdvanced")); + QCOMPARE(typeList.value(0).localName(), QString("PrintBasic")); + QCOMPARE(typeList.value(0).prefix(), QString("i")); + QCOMPARE(typeList.value(0).nameSpace(), QString("http://printer.example.org/2003/imaging")); + QCOMPARE(typeList.value(1).localName(), QString("PrintAdvanced")); + QCOMPARE(typeList.value(1).prefix(), QString("i")); + QCOMPARE(typeList.value(1).nameSpace(), QString("http://printer.example.org/2003/imaging")); const QStringList& scopeList = probeMatch.scopes().value().entries(); QCOMPARE(scopeList.size(), 3); QCOMPARE(scopeList.value(0), QString("ldap:///ou=engineering,o=examplecom,c=us")); diff --git a/unittests/wsdl_document/test_wsdl_document.cpp b/unittests/wsdl_document/test_wsdl_document.cpp index 1956ba3a3..8bc1075fb 100644 --- a/unittests/wsdl_document/test_wsdl_document.cpp +++ b/unittests/wsdl_document/test_wsdl_document.cpp @@ -1060,7 +1060,7 @@ void WsdlDocumentTest::testSendTelegram() // Check the request as received by the server. const QByteArray expectedRequestXml = - QByteArray(xmlBegin) + "" + QByteArray(xmlBegin) + "" "48656c6c6f" "SGVsbG8=" ""; From 467d5e4e851ebc7d953595e50db2fd36c9b8d185 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 25 Feb 2019 10:52:15 +0100 Subject: [PATCH 045/679] Fix qmake build; fix typo in changelog --- doc/CHANGES_1_8.txt | 2 +- src/KDSoapClient/KDQName.cpp | 2 +- src/KDSoapClient/KDSoapClient.pro | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 0b6579e43..e5ec22f9a 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -36,7 +36,7 @@ WSDL parser / code generator changes, applying to both client and server side: * Source incompatible change: all serialize() functions now return a KDSoapValue instead of a QVariant. If you use a QVariant serialize() function, you need to port your code to use QVariant KDSoapValue::value() after serialize() -* Source incompatible change: xs:QName is now respresented by KDQName instead of QString, which +* Source incompatible change: xs:QName is now represented by KDQName instead of QString, which allows the namespace to be extracted. The old behaviour is available via KDQName::qname(). * Fix double-handling of empty elements * Fix fault elements being generated in the wrong namespace, must be SOAP-ENV:Fault (github issue #81). diff --git a/src/KDSoapClient/KDQName.cpp b/src/KDSoapClient/KDQName.cpp index 793de80a7..d6bad0fe8 100644 --- a/src/KDSoapClient/KDQName.cpp +++ b/src/KDSoapClient/KDQName.cpp @@ -23,7 +23,7 @@ #include "KDQName.h" #include -#include +#include KDQName::KDQName() { diff --git a/src/KDSoapClient/KDSoapClient.pro b/src/KDSoapClient/KDSoapClient.pro index 672f52d16..0cd24fff0 100644 --- a/src/KDSoapClient/KDSoapClient.pro +++ b/src/KDSoapClient/KDSoapClient.pro @@ -54,7 +54,10 @@ SOURCES = KDSoapMessage.cpp \ KDSoapReplySslHandler.cpp \ KDSoapFaultException.cpp \ KDSoapMessageAddressingProperties.cpp \ - KDSoapEndpointReference.cpp + KDSoapEndpointReference.cpp \ + KDQName.cpp \ + + DEFINES += KDSOAP_BUILD_KDSOAP_LIB # installation targets: From 9ed9f3451a81f15496abc721263a13aadb2edaaf Mon Sep 17 00:00:00 2001 From: Ryan van der Bijl Date: Fri, 8 Mar 2019 12:53:43 +0100 Subject: [PATCH 046/679] - Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/src/converter_complextype.cpp | 14 ++++--- .../optionaltype_boost_optional/test.wsdl | 18 +++++++++ .../testboostapi.cpp | 38 +++++++++++++++++++ .../testboostapi.h | 2 + unittests/optionaltype_pointer/test.wsdl | 20 +++++++++- .../optionaltype_pointer/testpointerapi.cpp | 38 +++++++++++++++++++ .../optionaltype_pointer/testpointerapi.h | 2 + unittests/optionaltype_regular/test.wsdl | 1 + .../optionaltype_regular/testregularapi.cpp | 16 ++++++++ .../optionaltype_regular/testregularapi.h | 1 + 11 files changed, 145 insertions(+), 6 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index e5ec22f9a..c579708ce 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -51,3 +51,4 @@ WSDL parser / code generator changes, applying to both client and server side: * Added support for generating messages for WSDL files without services or bindings * KDSoapValue now stores the namespace declarations during parsing of a message and writes namespace declarations during sending of a message +* Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 18dff6966..ad0fdc3f3 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -253,10 +253,18 @@ void Converter::convertComplexType(const XSD::ComplexType *type) // Called for each element and for each attribute of a complex type, as well as for the base class "value". QString Converter::generateMemberVariable(const QString &rawName, const QString &typeName, const QString &inputTypeName, KODE::Class &newClass, XSD::Attribute::AttributeUse use, bool usePointer, bool polymorphic) { + const bool optional = (use == XSD::Attribute::Optional); + const bool prohibited = (use == XSD::Attribute::Prohibited); + const KODE::Function::AccessSpecifier access = (prohibited) ? KODE::Function::Private : KODE::Function::Public; + // member variable const QString storageType = usePointer ? pointerStorageType(typeName) : typeName; KODE::MemberVariable variable(rawName, storageType); - addVariableInitializer(variable); + if (usePointer && !optional) { + variable.setInitializer("new " + typeName); + } else { + addVariableInitializer(variable); + } newClass.addMemberVariable(variable); const QString variableName = QLatin1String("d_ptr->") + variable.name(); @@ -264,10 +272,6 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString const QString lowerName = lowerlize(rawName); const QString memberName = mNameMapper.escape(lowerName); - bool optional = (use == XSD::Attribute::Optional); - bool prohibited = (use == XSD::Attribute::Prohibited); - const KODE::Function::AccessSpecifier access = (prohibited) ? KODE::Function::Private : KODE::Function::Public; - if (usePointer) { newClass.addInclude("QSharedPointer"); diff --git a/unittests/optionaltype_boost_optional/test.wsdl b/unittests/optionaltype_boost_optional/test.wsdl index 77d89ca10..eb71d2765 100644 --- a/unittests/optionaltype_boost_optional/test.wsdl +++ b/unittests/optionaltype_boost_optional/test.wsdl @@ -8,6 +8,22 @@ + + + + + + + + + + + + + + + + @@ -19,6 +35,8 @@ + + diff --git a/unittests/optionaltype_boost_optional/testboostapi.cpp b/unittests/optionaltype_boost_optional/testboostapi.cpp index 17335bb1b..ae555d6c3 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.cpp +++ b/unittests/optionaltype_boost_optional/testboostapi.cpp @@ -39,4 +39,42 @@ void TestBoostApi::test() QCOMPARE(*resp.out(), newVal); } +void TestBoostApi::testPolymorphic() +{ + TNS__TestOperationResponse1 resp; + QCOMPARE(resp.out2(), (TNS__PolymorphicClass*)0); + QCOMPARE(resp.hasValueForOut2(), false); + TNS__PolymorphicClass value; + value.setValue(QString("newvalue")); + resp.setOut2(value); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("newvalue")); + QCOMPARE(resp.hasValueForOut2(), true); + + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut2(derivedValue); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("derived")); + QCOMPARE(dynamic_cast(resp.out2())->value2(), QString("derived")); +} + +void TestBoostApi::testSerialize() +{ + // TNS__TestOperationResponse1 has "out3" which is polymorphic AND non-optional + // If "out3" is not initialized, then trying to serialize causes a crash. + // Verify it doesn't crash. + TNS__TestOperationResponse1 resp; + resp.serialize("Test"); + QCOMPARE(resp.out3().value(), QString()); + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut3(derivedValue); + QCOMPARE(resp.out3().value(), QString("derived")); +} + QTEST_MAIN(TestBoostApi) diff --git a/unittests/optionaltype_boost_optional/testboostapi.h b/unittests/optionaltype_boost_optional/testboostapi.h index 957720a3a..fd8b10498 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.h +++ b/unittests/optionaltype_boost_optional/testboostapi.h @@ -36,6 +36,8 @@ class TestBoostApi : public QObject private slots: void test(); + void testPolymorphic(); + void testSerialize(); private: }; diff --git a/unittests/optionaltype_pointer/test.wsdl b/unittests/optionaltype_pointer/test.wsdl index 3f9ea1347..19a90a57c 100644 --- a/unittests/optionaltype_pointer/test.wsdl +++ b/unittests/optionaltype_pointer/test.wsdl @@ -8,6 +8,22 @@ + + + + + + + + + + + + + + + + @@ -19,7 +35,9 @@ - + + + diff --git a/unittests/optionaltype_pointer/testpointerapi.cpp b/unittests/optionaltype_pointer/testpointerapi.cpp index 82051e0e2..afd38b3fc 100644 --- a/unittests/optionaltype_pointer/testpointerapi.cpp +++ b/unittests/optionaltype_pointer/testpointerapi.cpp @@ -54,4 +54,42 @@ void TestPointerApi::testOptionalArray() QCOMPARE(valIn, *resp2.outOptionalArray()); } +void TestPointerApi::testPolymorphic() +{ + TNS__TestOperationResponse1 resp; + QCOMPARE(resp.out2(), (TNS__PolymorphicClass*)0); + QCOMPARE(resp.hasValueForOut2(), false); + TNS__PolymorphicClass value; + value.setValue(QString("newvalue")); + resp.setOut2(value); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("newvalue")); + QCOMPARE(resp.hasValueForOut2(), true); + + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut2(derivedValue); + QVERIFY(resp.out2()); + QCOMPARE(resp.out2()->value(), QString("derived")); + QCOMPARE(dynamic_cast(resp.out2())->value2(), QString("derived")); +} + +void TestPointerApi::testSerialize() +{ + // TNS__TestOperationResponse1 has "out3" which is polymorphic AND non-optional + // If "out3" is not initialized, then trying to serialize causes a crash. + // Verify it doesn't crash. + TNS__TestOperationResponse1 resp; + resp.serialize("Test"); + QCOMPARE(resp.out3().value(), QString()); + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut3(derivedValue); + QCOMPARE(resp.out3().value(), QString("derived")); +} + QTEST_MAIN(TestPointerApi) diff --git a/unittests/optionaltype_pointer/testpointerapi.h b/unittests/optionaltype_pointer/testpointerapi.h index 190fb321f..f11845d72 100644 --- a/unittests/optionaltype_pointer/testpointerapi.h +++ b/unittests/optionaltype_pointer/testpointerapi.h @@ -37,6 +37,8 @@ class TestPointerApi : public QObject private slots: void test(); void testOptionalArray(); + void testPolymorphic(); + void testSerialize(); private: }; diff --git a/unittests/optionaltype_regular/test.wsdl b/unittests/optionaltype_regular/test.wsdl index 7e2beb232..eb71d2765 100644 --- a/unittests/optionaltype_regular/test.wsdl +++ b/unittests/optionaltype_regular/test.wsdl @@ -36,6 +36,7 @@ + diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index 685f72dfb..17add4792 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -61,4 +61,20 @@ void TestRegularApi::testPolymorphic() QCOMPARE(dynamic_cast(resp.out2())->value2(), QString("derived")); } +void TestRegularApi::testSerialize() +{ + // TNS__TestOperationResponse1 has "out3" which is polymorphic AND non-optional + // If "out3" is not initialized, then trying to serialize causes a crash. + // Verify it doesn't crash. + TNS__TestOperationResponse1 resp; + resp.serialize("Test"); + QCOMPARE(resp.out3().value(), QString()); + + TNS__DerivedClass derivedValue; + derivedValue.setValue("derived"); + derivedValue.setValue2("derived"); + resp.setOut3(derivedValue); + QCOMPARE(resp.out3().value(), QString("derived")); +} + QTEST_MAIN(TestRegularApi) diff --git a/unittests/optionaltype_regular/testregularapi.h b/unittests/optionaltype_regular/testregularapi.h index 3324a801a..b5d9273cc 100644 --- a/unittests/optionaltype_regular/testregularapi.h +++ b/unittests/optionaltype_regular/testregularapi.h @@ -37,6 +37,7 @@ class TestRegularApi : public QObject private slots: void test(); void testPolymorphic(); + void testSerialize(); private: }; From da7449ec8fb6d6f29eea18f4cb4d52fc20fcd718 Mon Sep 17 00:00:00 2001 From: postrstk Date: Mon, 11 Mar 2019 15:10:39 +0300 Subject: [PATCH 047/679] Fix generated code for restriction to base class (#164) * fix range check code for SimpleType as base * replaced literal to SubType::TypeList * fix code style; delete commented code; add test to cmake * add deleted tests * fix code style; replaced duplicate code with a function * fix if-else code format * deleted changes in CmakeList --- kdwsdl2cpp/CMakeLists.txt | 11 +- kdwsdl2cpp/src/converter_simpletype.cpp | 24 +- unittests/CMakeLists.txt | 4 +- unittests/list_restriction/CMakeLists.txt | 5 + .../test_list_restriction.cpp | 273 ++++++++++++++++++ unittests/unittests.pro | 3 +- 6 files changed, 308 insertions(+), 12 deletions(-) create mode 100644 unittests/list_restriction/CMakeLists.txt create mode 100644 unittests/list_restriction/test_list_restriction.cpp diff --git a/kdwsdl2cpp/CMakeLists.txt b/kdwsdl2cpp/CMakeLists.txt index 0d4508a80..6cee36701 100644 --- a/kdwsdl2cpp/CMakeLists.txt +++ b/kdwsdl2cpp/CMakeLists.txt @@ -5,7 +5,7 @@ include(${QT_USE_FILE}) remove_definitions(-DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(SOURCES +set(SOURCES_LIB common/fileprovider.cpp common/messagehandler.cpp common/nsmanager.cpp @@ -59,14 +59,17 @@ set(SOURCES src/converter_simpletype.cpp src/creator.cpp src/elementargumentserializer.cpp - src/main.cpp src/namemapper.cpp src/settings.cpp src/typemap.cpp ) -add_executable(kdwsdl2cpp ${SOURCES}) -target_link_libraries(kdwsdl2cpp ${QT_LIBRARIES}) +set(SOURCES_EXE src/main.cpp) + +add_library(kdwsdl2cpp_lib STATIC ${SOURCES_LIB}) +add_executable(kdwsdl2cpp ${SOURCES_EXE}) + +target_link_libraries(kdwsdl2cpp kdwsdl2cpp_lib ${QT_LIBRARIES}) install(TARGETS kdwsdl2cpp EXPORT "KDSoapTargets" RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR} diff --git a/kdwsdl2cpp/src/converter_simpletype.cpp b/kdwsdl2cpp/src/converter_simpletype.cpp index 6a6827183..13fd70b03 100644 --- a/kdwsdl2cpp/src/converter_simpletype.cpp +++ b/kdwsdl2cpp/src/converter_simpletype.cpp @@ -7,7 +7,7 @@ using namespace KWSDL; static QString escapeEnum(const QString &); -static KODE::Code createRangeCheckCode(const XSD::SimpleType *, const QString &baseTypeName, const QString &, KODE::Class &); +static KODE::Code createRangeCheckCode(const XSD::SimpleType *, const QString &baseTypeName, const QString &, KODE::Class &, const XSD::SimpleType &); void Converter::addVariableInitializer(KODE::MemberVariable &variable) const { @@ -150,7 +150,8 @@ void Converter::convertSimpleType(const XSD::SimpleType *type, const XSD::Simple setter.addArgument(inputType + " value"); KODE::Code setterBody; if (type->facetType() != XSD::SimpleType::NONE) { - setterBody += createRangeCheckCode(type, baseTypeName, "value", newClass); + const XSD::SimpleType baseSimpleType = simpleTypeList.simpleType(baseName); + setterBody += createRangeCheckCode(type, baseTypeName, "value", newClass, baseSimpleType); setterBody.newLine(); setterBody += "if (!rangeOk)"; setterBody.indent(); @@ -228,6 +229,7 @@ void Converter::convertSimpleType(const XSD::SimpleType *type, const XSD::Simple newClass.addFunction(setter); newClass.addFunction(getter); + } break; case XSD::SimpleType::TypeUnion: @@ -466,8 +468,18 @@ static QString escapeRegExp(const QString &str) return reg; } -static KODE::Code createRangeCheckCode(const XSD::SimpleType *type, const QString &baseTypeName, const QString &variableName, KODE::Class &parentClass) +static KODE::Code createRangeCheckCode(const XSD::SimpleType *type, const QString &baseTypeName, const QString &variableName, KODE::Class &parentClass, const XSD::SimpleType &baseSimpleType) { + QString extendedVariableName = variableName; + + if (!baseSimpleType.isNull()) { + if (baseSimpleType.subType() == XSD::SimpleType::SubType::TypeList) { + extendedVariableName += ".entries()"; + } else { + extendedVariableName += ".value()"; + } + } + KODE::Code code; code += "bool rangeOk = true;"; code.newLine(); @@ -496,13 +508,13 @@ static KODE::Code createRangeCheckCode(const XSD::SimpleType *type, const QStrin } if (type->facetType() & XSD::SimpleType::LENGTH) { - code += "rangeOk = rangeOk && (" + variableName + ".length() == " + QString::number(type->facetLength()) + ");"; + code += "rangeOk = rangeOk && (" + extendedVariableName + ".length() == " + QString::number(type->facetLength()) + ");"; } if (type->facetType() & XSD::SimpleType::MINLEN) { - code += "rangeOk = rangeOk && (" + variableName + ".length() >= " + QString::number(type->facetMinimumLength()) + ");"; + code += "rangeOk = rangeOk && (" + extendedVariableName + ".length() >= " + QString::number(type->facetMinimumLength()) + ");"; } if (type->facetType() & XSD::SimpleType::MAXLEN) { - code += "rangeOk = rangeOk && (" + variableName + ".length() <= " + QString::number(type->facetMaximumLength()) + ");"; + code += "rangeOk = rangeOk && (" + extendedVariableName + ".length() <= " + QString::number(type->facetMaximumLength()) + ");"; } if (type->facetType() & XSD::SimpleType::PATTERN) { if (baseTypeName == "QString") { diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 933c05e54..6d70bf674 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -5,7 +5,7 @@ set(QT_USE_QTTEST TRUE) include(${QT_USE_FILE}) -include_directories(../src/ ../src/KDSoapClient/ ../src/KDSoapServer/ ../testtools/) +include_directories(../src/ ../src/KDSoapClient/ ../src/KDSoapServer/ ../testtools/ ../kdwsdl2cpp/ ../kdwsdl2cpp/src/ ../kdwsdl2cpp/libkode/ ../kdwsdl2cpp/common/ ../kdwsdl2cpp/schema/ ../kdwsdl2cpp/wsdl/) include(../KDSoapMacros.cmake) remove_definitions(-DQT_NO_CAST_FROM_ASCII) @@ -89,3 +89,5 @@ add_subdirectory(enzo) add_subdirectory(fault_namespace) add_subdirectory(onvif_org_event) add_subdirectory(empty_list_wsdl) +add_subdirectory(list_restriction) + diff --git a/unittests/list_restriction/CMakeLists.txt b/unittests/list_restriction/CMakeLists.txt new file mode 100644 index 000000000..37046e6e9 --- /dev/null +++ b/unittests/list_restriction/CMakeLists.txt @@ -0,0 +1,5 @@ +project(list_restriction) + +set(list_restriction_SRCS test_list_restriction.cpp) +set(EXTRA_LIBS kdwsdl2cpp_lib) +add_unittest(${list_restriction_SRCS}) diff --git a/unittests/list_restriction/test_list_restriction.cpp b/unittests/list_restriction/test_list_restriction.cpp new file mode 100644 index 000000000..e59b03b2c --- /dev/null +++ b/unittests/list_restriction/test_list_restriction.cpp @@ -0,0 +1,273 @@ +#include + +#include +#include + +#include +#include +#include + +#include +#include "httpserver_p.h" + +#include + + +using namespace KDSoapUnitTestHelpers; + +class ListRestrictionTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void getFunctionCodeBody(const QByteArray & srcXml, QString & generatedStr) + { + generatedStr = ""; + QStringList generatedFunctionBody; + + QXmlInputSource source; + source.setData(srcXml); + QXmlSimpleReader reader; + reader.setFeature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"), true); + + QString errorMsg; + int errorLine, errorCol; + QDomDocument doc; + QVERIFY(doc.setContent(&source, &reader, &errorMsg, &errorLine, &errorCol)); + + QDomElement element = doc.documentElement(); + NSManager namespaceManager; + namespaceManager.setPrefix(QLatin1String("xml"), NSManager::xmlNamespace()); + + MessageHandler messageHandler; + ParserContext context; + context.setNamespaceManager(&namespaceManager); + context.setMessageHandler(&messageHandler); + + KWSDL::Definitions definitions; + QVERIFY(definitions.loadXML(&context, element)); + definitions.fixUpDefinitions(); + KODE::Code::setDefaultIndentation(4); + + KWSDL::WSDL wsdl; + wsdl.setDefinitions(definitions); + wsdl.setNamespaceManager(namespaceManager); + + KWSDL::Converter converter; + converter.setWSDL(wsdl); + converter.convert(); + + foreach (auto elem, converter.classes()) { + if (elem.name() == QString("TEST__D3ArrayType")) { + foreach (auto e_f, elem.functions()) { + if (e_f.name() == QString("setValue")) { + generatedFunctionBody = e_f.body().split("\n"); + generatedStr = generatedFunctionBody.at(2); + } + } + } + } + } + + void testGenerateCodeWithRestriction() + { + QString generatedCodeString; + QString expectedSrcListRestriction = "rangeOk = rangeOk && (value.entries().length() == 3);"; + QString expectedSrcStringRestriction = "rangeOk = rangeOk && (value.value().length() == 3);"; + QString expectedSrcXSDListRestriction = "rangeOk = rangeOk && (value.length() == 3);"; + + const QByteArray srcXmlListRestriction = QByteArray("" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " WSDL File for HelloService" + " " + " " + " " + " " + ""); + + const QByteArray srcXmlStringRestriction = QByteArray("" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " WSDL File for HelloService" + " " + " " + " " + " " + ""); + + const QByteArray srcXmlXSDListRestriction = QByteArray("" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " WSDL File for HelloService" + " " + " " + " " + " " + ""); + + getFunctionCodeBody(srcXmlListRestriction, generatedCodeString); + QCOMPARE(expectedSrcListRestriction, generatedCodeString); + + getFunctionCodeBody(srcXmlStringRestriction, generatedCodeString); + QCOMPARE(expectedSrcStringRestriction, generatedCodeString); + + getFunctionCodeBody(srcXmlXSDListRestriction, generatedCodeString); + QCOMPARE(expectedSrcXSDListRestriction, generatedCodeString); + } +}; + +QTEST_MAIN(ListRestrictionTest) + +#include "test_list_restriction.moc" diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 19eb996a7..de82775a0 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -46,7 +46,8 @@ SUBDIRS = \ dv_terminalauth \ test_calc \ ws_addressing_support \ - ws_usernametoken_support + ws_usernametoken_support \ + list_restriction # These need internet access SUBDIRS += webcalls webcalls_wsdl From a8380c3640c816feb02284cf1e302adaeacd9ea7 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 11 Mar 2019 14:47:32 +0100 Subject: [PATCH 048/679] Add changelog entry for previous commit --- doc/CHANGES_1_8.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index c579708ce..42c66347b 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -52,3 +52,5 @@ WSDL parser / code generator changes, applying to both client and server side: * KDSoapValue now stores the namespace declarations during parsing of a message and writes namespace declarations during sending of a message * Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided +* Fix generated code for restriction to base class (it wouldn't compile) + From 3a58e95fb96621f96734f0bd972bf229eb08f069 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 11 Mar 2019 16:20:39 +0100 Subject: [PATCH 049/679] Fix compilation on Qt5 Linux, the static lib requires -fPIC, which Qt5::Core brings --- kdwsdl2cpp/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kdwsdl2cpp/CMakeLists.txt b/kdwsdl2cpp/CMakeLists.txt index 6cee36701..82418be37 100644 --- a/kdwsdl2cpp/CMakeLists.txt +++ b/kdwsdl2cpp/CMakeLists.txt @@ -67,8 +67,9 @@ set(SOURCES_LIB set(SOURCES_EXE src/main.cpp) add_library(kdwsdl2cpp_lib STATIC ${SOURCES_LIB}) -add_executable(kdwsdl2cpp ${SOURCES_EXE}) +target_link_libraries(kdwsdl2cpp_lib ${QT_LIBRARIES}) +add_executable(kdwsdl2cpp ${SOURCES_EXE}) target_link_libraries(kdwsdl2cpp kdwsdl2cpp_lib ${QT_LIBRARIES}) install(TARGETS kdwsdl2cpp EXPORT "KDSoapTargets" From dbe448175862c395c85753c75279b67f3b8eacc5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 11 Mar 2019 16:59:30 +0100 Subject: [PATCH 050/679] Cleanup includes: don't include , which contains all of QtCore. --- unittests/basic/basic.cpp | 2 +- unittests/builtinhttp/builtinhttp.cpp | 2 +- unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp | 2 +- .../test_dwservice_combined_wsdl.cpp | 2 +- unittests/dwservice_wsdl/test_dwservice_wsdl.cpp | 2 +- unittests/element_ns_wsdl/testcall.cpp | 2 +- unittests/empty_response_wsdl/test_issue1.cpp | 2 +- unittests/encapsecurity/test_encapsecurity.cpp | 2 +- unittests/enum_escape/test_enum.cpp | 2 +- unittests/groupwise_wsdl/test_groupwise_wsdl.cpp | 2 +- unittests/ihc_wsdl/test_ihc.cpp | 2 +- unittests/import_definition/test_import_definition.cpp | 2 +- unittests/keep_unused_types/keep_unused_types.cpp | 2 +- unittests/literal_true_false/test_literal.cpp | 2 +- unittests/logbook_wsdl/test_logbook_wsdl.cpp | 2 +- unittests/messagereader/messagereader.cpp | 3 ++- .../msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp | 2 +- unittests/msexchange_wsdl/msexchange_wsdl.cpp | 2 +- unittests/optionaltype_boost_optional/testboostapi.cpp | 2 +- unittests/optionaltype_pointer/testpointerapi.cpp | 2 +- unittests/optionaltype_regular/testregularapi.cpp | 2 +- unittests/salesforce_wsdl/salesforce_wsdl.cpp | 2 +- unittests/servertest/servertest.cpp | 5 ++++- unittests/soap12/test_soap12.cpp | 2 +- unittests/specialchars_wsdl/testconversion.cpp | 2 +- unittests/sugar_wsdl/test_sugar_wsdl.cpp | 3 ++- unittests/tech3356_wsdl/test_tech3356.cpp | 2 +- unittests/uitapi/test_uitapi.cpp | 2 +- unittests/unqualified_formdefault/test_unqualified.cpp | 2 +- unittests/webcalls/webcalls.cpp | 3 ++- unittests/webcalls_wsdl/webcalls_wsdl.cpp | 2 +- unittests/ws_addressing_support/wsaddressingtest.cpp | 2 +- unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp | 2 +- unittests/ws_usernametoken_support/wsusernametokentest.cpp | 2 +- unittests/wsdl_document/test_wsdl_document.cpp | 6 +++++- unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp | 3 ++- unittests/wsdl_rpc/test_wsdl_rpc.cpp | 2 +- 37 files changed, 48 insertions(+), 37 deletions(-) diff --git a/unittests/basic/basic.cpp b/unittests/basic/basic.cpp index cb3172922..39b9eaecd 100644 --- a/unittests/basic/basic.cpp +++ b/unittests/basic/basic.cpp @@ -23,7 +23,7 @@ #include "KDSoapValue.h" #include "KDDateTime.h" -#include +#include class Basic : public QObject { diff --git a/unittests/builtinhttp/builtinhttp.cpp b/unittests/builtinhttp/builtinhttp.cpp index cc061380b..914a9452f 100644 --- a/unittests/builtinhttp/builtinhttp.cpp +++ b/unittests/builtinhttp/builtinhttp.cpp @@ -31,7 +31,7 @@ #include "KDSoapServerObjectInterface.h" #include "httpserver_p.h" -#include +#include #include #include #include diff --git a/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp b/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp index a16dfecb9..dfab8ae9e 100644 --- a/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp +++ b/unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp @@ -27,7 +27,7 @@ #include "KDDateTime.h" #include "wsdl_DWService_12.h" #include "httpserver_p.h" -#include +#include #include using namespace KDSoapUnitTestHelpers; diff --git a/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp b/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp index 4a38b8343..e8cb55e4c 100644 --- a/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp +++ b/unittests/dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp @@ -26,7 +26,7 @@ #include "KDSoapValue.h" #include "KDDateTime.h" #include "httpserver_p.h" -#include +#include #include // Testcase for multiple services defined in one .wsdl file diff --git a/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp b/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp index a68170a54..c9110b15e 100644 --- a/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp +++ b/unittests/dwservice_wsdl/test_dwservice_wsdl.cpp @@ -27,7 +27,7 @@ #include "KDDateTime.h" #include "wsdl_DWService.h" #include "httpserver_p.h" -#include +#include #include using namespace KDSoapUnitTestHelpers; diff --git a/unittests/element_ns_wsdl/testcall.cpp b/unittests/element_ns_wsdl/testcall.cpp index 1ff598405..609e21dbd 100644 --- a/unittests/element_ns_wsdl/testcall.cpp +++ b/unittests/element_ns_wsdl/testcall.cpp @@ -22,7 +22,7 @@ #include "testcall.h" #include "httpserver_p.h" -#include +#include #include using namespace KDSoapUnitTestHelpers; diff --git a/unittests/empty_response_wsdl/test_issue1.cpp b/unittests/empty_response_wsdl/test_issue1.cpp index c461bb0fa..19267954b 100644 --- a/unittests/empty_response_wsdl/test_issue1.cpp +++ b/unittests/empty_response_wsdl/test_issue1.cpp @@ -21,7 +21,7 @@ **********************************************************************/ #include "httpserver_p.h" -#include +#include #include #include "wsdl_test.h" diff --git a/unittests/encapsecurity/test_encapsecurity.cpp b/unittests/encapsecurity/test_encapsecurity.cpp index c514775e1..ea78aebed 100644 --- a/unittests/encapsecurity/test_encapsecurity.cpp +++ b/unittests/encapsecurity/test_encapsecurity.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_authstateless.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/enum_escape/test_enum.cpp b/unittests/enum_escape/test_enum.cpp index a3ab9bec7..2a270318a 100644 --- a/unittests/enum_escape/test_enum.cpp +++ b/unittests/enum_escape/test_enum.cpp @@ -21,7 +21,7 @@ **********************************************************************/ #include "httpserver_p.h" -#include +#include #include "wsdl_test_enum.h" class TestEnum : public QObject diff --git a/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp b/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp index 557c05977..57e74209b 100644 --- a/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp +++ b/unittests/groupwise_wsdl/test_groupwise_wsdl.cpp @@ -27,7 +27,7 @@ #include "KDDateTime.h" #include "wsdl_groupwise.h" #include "httpserver_p.h" -#include +#include #include using namespace KDSoapUnitTestHelpers; diff --git a/unittests/ihc_wsdl/test_ihc.cpp b/unittests/ihc_wsdl/test_ihc.cpp index 7be4f21bb..ce90ba960 100644 --- a/unittests/ihc_wsdl/test_ihc.cpp +++ b/unittests/ihc_wsdl/test_ihc.cpp @@ -24,7 +24,7 @@ #include "wsdl_resourceinteraction.h" #include "httpserver_p.h" -#include +#include #include #include #include diff --git a/unittests/import_definition/test_import_definition.cpp b/unittests/import_definition/test_import_definition.cpp index 880b22f7e..b1f616caa 100644 --- a/unittests/import_definition/test_import_definition.cpp +++ b/unittests/import_definition/test_import_definition.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_import_definition.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/keep_unused_types/keep_unused_types.cpp b/unittests/keep_unused_types/keep_unused_types.cpp index f2987a8c0..a3da9e220 100644 --- a/unittests/keep_unused_types/keep_unused_types.cpp +++ b/unittests/keep_unused_types/keep_unused_types.cpp @@ -24,7 +24,7 @@ #include "KDSoapClientInterface.h" #include "wsdl_keep_unused_types.h" -#include +#include #include class KeepUnusedTypesArgumentKDWSDL2CPP: public QObject diff --git a/unittests/literal_true_false/test_literal.cpp b/unittests/literal_true_false/test_literal.cpp index 2779a903e..6023b4e7b 100644 --- a/unittests/literal_true_false/test_literal.cpp +++ b/unittests/literal_true_false/test_literal.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_literal.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/logbook_wsdl/test_logbook_wsdl.cpp b/unittests/logbook_wsdl/test_logbook_wsdl.cpp index c3526e14e..f0a2fef4b 100644 --- a/unittests/logbook_wsdl/test_logbook_wsdl.cpp +++ b/unittests/logbook_wsdl/test_logbook_wsdl.cpp @@ -26,7 +26,7 @@ #include "KDSoapValue.h" #include "wsdl_logbookifv3.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/messagereader/messagereader.cpp b/unittests/messagereader/messagereader.cpp index 0c6a304a9..0a51e2e5e 100644 --- a/unittests/messagereader/messagereader.cpp +++ b/unittests/messagereader/messagereader.cpp @@ -23,7 +23,8 @@ #include "KDSoapMessage.h" #include "KDSoapMessageReader_p.h" -#include +#include +#include class TestMessageReader : public QObject { diff --git a/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp b/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp index c47b728ec..4eeafd3a5 100644 --- a/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp +++ b/unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_Services_noservice.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/msexchange_wsdl/msexchange_wsdl.cpp b/unittests/msexchange_wsdl/msexchange_wsdl.cpp index f2deb316c..37c32dc86 100644 --- a/unittests/msexchange_wsdl/msexchange_wsdl.cpp +++ b/unittests/msexchange_wsdl/msexchange_wsdl.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_Services.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/optionaltype_boost_optional/testboostapi.cpp b/unittests/optionaltype_boost_optional/testboostapi.cpp index ae555d6c3..82fcb6b83 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.cpp +++ b/unittests/optionaltype_boost_optional/testboostapi.cpp @@ -23,7 +23,7 @@ **********************************************************************/ #include "testboostapi.h" -#include +#include #include TestBoostApi::TestBoostApi() diff --git a/unittests/optionaltype_pointer/testpointerapi.cpp b/unittests/optionaltype_pointer/testpointerapi.cpp index afd38b3fc..70afb58d7 100644 --- a/unittests/optionaltype_pointer/testpointerapi.cpp +++ b/unittests/optionaltype_pointer/testpointerapi.cpp @@ -23,7 +23,7 @@ **********************************************************************/ #include "testpointerapi.h" -#include +#include #include #include diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index 17add4792..f85afd27b 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -23,7 +23,7 @@ **********************************************************************/ #include "testregularapi.h" -#include +#include #include TestRegularApi::TestRegularApi() diff --git a/unittests/salesforce_wsdl/salesforce_wsdl.cpp b/unittests/salesforce_wsdl/salesforce_wsdl.cpp index d45f99e60..de847d361 100644 --- a/unittests/salesforce_wsdl/salesforce_wsdl.cpp +++ b/unittests/salesforce_wsdl/salesforce_wsdl.cpp @@ -26,7 +26,7 @@ #include "KDSoapValue.h" #include "wsdl_salesforce-partner.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/servertest/servertest.cpp b/unittests/servertest/servertest.cpp index 93830899c..1a9ff3dc5 100644 --- a/unittests/servertest/servertest.cpp +++ b/unittests/servertest/servertest.cpp @@ -34,14 +34,17 @@ #include "KDSoapServerRawXMLInterface.h" #include "KDSoapServerCustomVerbRequestInterface.h" #include "httpserver_p.h" // KDSoapUnitTestHelpers -#include +#include #include +#include #include #include #include #ifndef QT_NO_OPENSSL #include #endif +#include +#include using namespace KDSoapUnitTestHelpers; Q_DECLARE_METATYPE(QFile::Permissions) diff --git a/unittests/soap12/test_soap12.cpp b/unittests/soap12/test_soap12.cpp index a92f31e9c..3a0058359 100644 --- a/unittests/soap12/test_soap12.cpp +++ b/unittests/soap12/test_soap12.cpp @@ -21,7 +21,7 @@ **********************************************************************/ #include "httpserver_p.h" -#include +#include #include #include "wsdl_soap12.h" diff --git a/unittests/specialchars_wsdl/testconversion.cpp b/unittests/specialchars_wsdl/testconversion.cpp index bb9ed8028..681fc085a 100644 --- a/unittests/specialchars_wsdl/testconversion.cpp +++ b/unittests/specialchars_wsdl/testconversion.cpp @@ -21,7 +21,7 @@ ** **********************************************************************/ -#include +#include #include #include "wsdl_test.h" diff --git a/unittests/sugar_wsdl/test_sugar_wsdl.cpp b/unittests/sugar_wsdl/test_sugar_wsdl.cpp index 56f8b4165..70529f050 100644 --- a/unittests/sugar_wsdl/test_sugar_wsdl.cpp +++ b/unittests/sugar_wsdl/test_sugar_wsdl.cpp @@ -26,9 +26,10 @@ #include "KDSoapValue.h" #include "wsdl_sugarcrm.h" #include "httpserver_p.h" -#include +#include #include #include +#include Q_DECLARE_METATYPE(TNS__Set_entry_result) diff --git a/unittests/tech3356_wsdl/test_tech3356.cpp b/unittests/tech3356_wsdl/test_tech3356.cpp index 9e82d1f6f..a3691763e 100644 --- a/unittests/tech3356_wsdl/test_tech3356.cpp +++ b/unittests/tech3356_wsdl/test_tech3356.cpp @@ -24,7 +24,7 @@ #include "wsdl_transformMedia-V1_0_7.h" #include "httpserver_p.h" -#include +#include #include #include #include diff --git a/unittests/uitapi/test_uitapi.cpp b/unittests/uitapi/test_uitapi.cpp index af5e8c79e..419a93342 100644 --- a/unittests/uitapi/test_uitapi.cpp +++ b/unittests/uitapi/test_uitapi.cpp @@ -23,7 +23,7 @@ #include "wsdl_uitapi.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/unqualified_formdefault/test_unqualified.cpp b/unittests/unqualified_formdefault/test_unqualified.cpp index c13aa9fb2..299166f8a 100644 --- a/unittests/unqualified_formdefault/test_unqualified.cpp +++ b/unittests/unqualified_formdefault/test_unqualified.cpp @@ -27,7 +27,7 @@ #include "KDSoapPendingCallWatcher.h" #include "wsdl_unqualified.h" #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/webcalls/webcalls.cpp b/unittests/webcalls/webcalls.cpp index 3ed70bf4b..eab1f1f1d 100644 --- a/unittests/webcalls/webcalls.cpp +++ b/unittests/webcalls/webcalls.cpp @@ -25,9 +25,10 @@ #include "KDSoapMessage.h" #include "KDSoapValue.h" #include "KDSoapPendingCallWatcher.h" -#include +#include #include #include +#include class WebCalls : public QObject { diff --git a/unittests/webcalls_wsdl/webcalls_wsdl.cpp b/unittests/webcalls_wsdl/webcalls_wsdl.cpp index d612d969d..89c94b95d 100644 --- a/unittests/webcalls_wsdl/webcalls_wsdl.cpp +++ b/unittests/webcalls_wsdl/webcalls_wsdl.cpp @@ -26,7 +26,7 @@ #include "wsdl_holidays.h" #include "wsdl_BFGlobalService.h" #include "wsdl_OrteLookup.h" -#include +#include #include #include diff --git a/unittests/ws_addressing_support/wsaddressingtest.cpp b/unittests/ws_addressing_support/wsaddressingtest.cpp index c5dc9f655..00129a794 100644 --- a/unittests/ws_addressing_support/wsaddressingtest.cpp +++ b/unittests/ws_addressing_support/wsaddressingtest.cpp @@ -23,7 +23,7 @@ #include "httpserver_p.h" -#include +#include #include #include diff --git a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp index d7783a709..eaaf49d2a 100644 --- a/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp +++ b/unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp @@ -25,7 +25,7 @@ #include "wsdl_ws_discovery200504.h" #include "httpserver_p.h" #include "KDSoapMessageReader_p.h" -#include +#include // Apperently the original file is not available anymore: http://schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.wsdl // However it is available via: https://web.archive.org/web/20070225062601/http://schemas.xmlsoap.org/ws/2005/04/discovery/ws-discovery.wsdl diff --git a/unittests/ws_usernametoken_support/wsusernametokentest.cpp b/unittests/ws_usernametoken_support/wsusernametokentest.cpp index a10e3272f..61a154d71 100644 --- a/unittests/ws_usernametoken_support/wsusernametokentest.cpp +++ b/unittests/ws_usernametoken_support/wsusernametokentest.cpp @@ -24,7 +24,7 @@ #include "httpserver_p.h" -#include +#include #include #include "KDSoapNamespaceManager.h" diff --git a/unittests/wsdl_document/test_wsdl_document.cpp b/unittests/wsdl_document/test_wsdl_document.cpp index 8bc1075fb..1b46bb675 100644 --- a/unittests/wsdl_document/test_wsdl_document.cpp +++ b/unittests/wsdl_document/test_wsdl_document.cpp @@ -24,7 +24,7 @@ #include "wsdl_mywsdl_document.h" #include "wsdl_thomas-bayer.h" #include "httpserver_p.h" -#include +#include #include #include #include @@ -34,6 +34,7 @@ #include #include #include + #ifndef QT_NO_OPENSSL #include #include @@ -43,6 +44,9 @@ class KDSoapSslHandler { }; Q_DECLARE_METATYPE(KDSoapSslHandler *) #endif +#include +#include + using namespace KDSoapUnitTestHelpers; static const char *xmlBegin = ""; diff --git a/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp b/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp index acafaf030..4eeacd480 100644 --- a/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp +++ b/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp @@ -25,7 +25,7 @@ #include "wsdl_sayhello.h" #include "httpserver_p.h" -#include +#include #include #include #include @@ -37,6 +37,7 @@ #include #include #include +#include using namespace KDSoapUnitTestHelpers; diff --git a/unittests/wsdl_rpc/test_wsdl_rpc.cpp b/unittests/wsdl_rpc/test_wsdl_rpc.cpp index 7d286898d..74880f373 100644 --- a/unittests/wsdl_rpc/test_wsdl_rpc.cpp +++ b/unittests/wsdl_rpc/test_wsdl_rpc.cpp @@ -23,7 +23,7 @@ #include "wsdl_mywsdl_rpc.h" #include "httpserver_p.h" -#include +#include #include #include From b8eb6ba68e3cd89bff5e2f63e31dd385c3c435bb Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 11 Mar 2019 18:26:12 +0100 Subject: [PATCH 051/679] Add lastFaultCode() for error handling after sync calls. Same as lastErrorCode() but it returns a QString rather than an int. github issue #166 --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/src/converter_clientstub.cpp | 16 +++++++++++- .../wsdl_document/test_wsdl_document.cpp | 25 +++++++++++++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 42c66347b..4c523c170 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -19,6 +19,7 @@ Client-side: * Add support for specifying requestHeaders as part of KDSoapJob via KDSoapJob::setRequestHeaders() * Rename the missing KDSoapJob::returnHeaders() to KDSoapJob::replyHeaders(), and provide an implementation * Make KDSoapClientInterface::soapVersion() const +* Add lastFaultCode() for error handling after sync calls. Same as lastErrorCode() but it returns a QString rather than an int. Server-side: ============ diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index 0c6a4aec8..54cf93655 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -197,7 +197,7 @@ bool Converter::convertClientService() getSoapVersion.setDocs(QLatin1String("Return the soap version used.n")); newClass.addFunction(getSoapVersion); } - // lastErrorCode() method + // lastErrorCode() method (which mistakenly returns an int, see github issue #166) { KODE::Function lastError(QLatin1String("lastErrorCode"), QLatin1String("int")); lastError.setConst(true); @@ -211,6 +211,20 @@ bool Converter::convertClientService() lastError.setDocs(QLatin1String("Return the fault code from the last blocking call.\nEmpty if no error.")); newClass.addFunction(lastError); } + // lastFaultCode() method + { + KODE::Function lastFault(QLatin1String("lastFaultCode"), QLatin1String("QString")); + lastFault.setConst(true); + KODE::Code code; + code += "if (d_ptr->m_lastReply.isFault())"; + code.indent(); + code += "return d_ptr->m_lastReply.childValues().child(QLatin1String(\"faultcode\")).value().toString();"; + code.unindent(); + code += "return QString();"; + lastFault.setBody(code); + lastFault.setDocs(QLatin1String("Return the fault code from the last blocking call.\nEmpty if no error.")); + newClass.addFunction(lastFault); + } // lastError() method { KODE::Function lastError(QLatin1String("lastError"), QLatin1String("QString")); diff --git a/unittests/wsdl_document/test_wsdl_document.cpp b/unittests/wsdl_document/test_wsdl_document.cpp index 1b46bb675..cf3c41a33 100644 --- a/unittests/wsdl_document/test_wsdl_document.cpp +++ b/unittests/wsdl_document/test_wsdl_document.cpp @@ -345,6 +345,7 @@ private Q_SLOTS: QByteArray ret = service.addEmployee(addEmployeeParameters()); QVERIFY(ret.isEmpty()); QCOMPARE(service.lastErrorCode(), static_cast(QNetworkReply::SslHandshakeFailedError)); + QCOMPARE(service.lastFaultCode(), QString::number(QNetworkReply::SslHandshakeFailedError)); QVERIFY2(service.lastError().contains(QLatin1String("SSL handshake failed")), qPrintable(service.lastError())); // Disable SSL so that termination can happen normally (do it asap, in case of failure below) server.disableSsl(); @@ -635,7 +636,8 @@ private Q_SLOTS: void testServerAddEmployeeJob(); void testServerPostByHand(); void testServerEmptyArgs(); - void testServerFault(); + void testServerFaultSync(); + void testServerFaultAsync(); void testSendTelegram(); void testSendHugeTelegram(); void testServerDelayedCall(); @@ -1025,7 +1027,26 @@ void WsdlDocumentTest::testServerEmptyArgs() QCOMPARE(service.lastError(), QString()); } -void WsdlDocumentTest::testServerFault() // test the error signals emitted on error, in async calls +void WsdlDocumentTest::testServerFaultSync() // test the error signals emitted on error, in sync calls +{ + TestServerThread serverThread; + DocServer *server = serverThread.startThread(); + + MyWsdlDocument service; + service.setEndPoint(server->endPoint()); + QSignalSpy addEmployeeErrorSpy(&service, SIGNAL(addEmployeeError(KDSoapMessage))); + QSignalSpy soapErrorSpy(&service, SIGNAL(soapError(QString,KDSoapMessage))); + service.addEmployee(KDAB__AddEmployee()); + + QCOMPARE(service.lastFaultCode(), QString::fromLatin1("Client.Data")); + QCOMPARE(service.lastError(), QString::fromLatin1("Fault code Client.Data: Empty employee name (DocServerObject). Error detail: Employee name must not be empty")); + + // Sync call doesn't emit signals + QCOMPARE(soapErrorSpy.count(), 0); + QCOMPARE(addEmployeeErrorSpy.count(), 0); +} + +void WsdlDocumentTest::testServerFaultAsync() // test the error signals emitted on error, in async calls { TestServerThread serverThread; DocServer *server = serverThread.startThread(); From 9b32e66e59020b50b082d7a2a0dd04744e6f8377 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 11 Mar 2019 18:54:25 +0100 Subject: [PATCH 052/679] Repair compilation with qmake: extract static lib from kdwsdl2cpp --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 41 +++++++++++++++ kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 44 ++++++++++++++++ kdwsdl2cpp/src/src.pro | 52 ++----------------- .../list_restriction/list_restriction.pro | 12 +++++ unittests/unittests.pri | 8 ++- 5 files changed, 106 insertions(+), 51 deletions(-) create mode 100644 kdwsdl2cpp/src/kdwsdl2cpp.pro create mode 100644 kdwsdl2cpp/src/kdwsdl2cpp_lib.pro create mode 100755 unittests/list_restriction/list_restriction.pro diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro new file mode 100644 index 000000000..1a70c783d --- /dev/null +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -0,0 +1,41 @@ +TEMPLATE = app +TARGET = kdwsdl2cpp +SOURCES = main.cpp +INCLUDEPATH += $${TOP_SOURCE_DIR}/kdwsdl2cpp +QT -= gui +QT += xml + +CONFIG += console +macx:CONFIG -= app_bundle +static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } + +# Relink when a static lib changed +unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ + $${TOP_BUILD_DIR}/lib/libwsdl.a \ + $${TOP_BUILD_DIR}/lib/libxmlschema.a \ + $${TOP_BUILD_DIR}/lib/libxmlcommon.a \ + $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.a + +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ + $${TOP_BUILD_DIR}/lib/wsdl.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon.lib \ + $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.lib + +LIBS += -L$${TOP_BUILD_DIR}/lib \ + -lkdwsdl2cpp_lib \ + -lkode \ + -lwsdl \ + -lxmlschema \ + -lxmlcommon + +include($${TOP_SOURCE_DIR}/variables.pri) +DEFINES -= QT_NO_CAST_TO_ASCII \ + QBA_NO_CAST_TO_VOID \ + QBA_NO_CAST_TO_ASCII \ + QT_NO_CAST_FROM_ASCII + +#installation targets +target.path = $$INSTALL_PREFIX/bin + +INSTALLS += target diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro new file mode 100644 index 000000000..e14af458a --- /dev/null +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -0,0 +1,44 @@ +TEMPLATE = lib +TARGET = kdwsdl2cpp_lib +SOURCES = compiler.cpp \ + converter.cpp \ + converter_clientstub.cpp \ + converter_complextype.cpp \ + converter_serverstub.cpp \ + converter_simpletype.cpp \ + creator.cpp \ + namemapper.cpp \ + settings.cpp \ + typemap.cpp \ + elementargumentserializer.cpp +HEADERS = compiler.h \ + converter.h \ + elementargumentserializer.h +INCLUDEPATH += $${TOP_SOURCE_DIR}/kdwsdl2cpp +QT -= gui +QT += xml + +CONFIG += staticlib + +CONFIG += console +static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } + +# Relink when a static lib changed +unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ + $${TOP_BUILD_DIR}/lib/libwsdl.a \ + $${TOP_BUILD_DIR}/lib/libxmlschema.a \ + $${TOP_BUILD_DIR}/lib/libxmlcommon.a +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ + $${TOP_BUILD_DIR}/lib/wsdl.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon.lib +LIBS += -L$${TOP_BUILD_DIR}/lib \ + -lkode \ + -lwsdl \ + -lxmlschema \ + -lxmlcommon +include($${TOP_SOURCE_DIR}/variables.pri) +DEFINES -= QT_NO_CAST_TO_ASCII \ + QBA_NO_CAST_TO_VOID \ + QBA_NO_CAST_TO_ASCII \ + QT_NO_CAST_FROM_ASCII diff --git a/kdwsdl2cpp/src/src.pro b/kdwsdl2cpp/src/src.pro index 5dd541a0d..46059f3d4 100644 --- a/kdwsdl2cpp/src/src.pro +++ b/kdwsdl2cpp/src/src.pro @@ -1,49 +1,3 @@ -TEMPLATE = app -TARGET = kdwsdl2cpp -SOURCES = compiler.cpp \ - converter.cpp \ - converter_clientstub.cpp \ - converter_complextype.cpp \ - converter_serverstub.cpp \ - converter_simpletype.cpp \ - creator.cpp \ - main.cpp \ - namemapper.cpp \ - settings.cpp \ - typemap.cpp \ - elementargumentserializer.cpp -HEADERS = compiler.h \ - converter.h \ - elementargumentserializer.h -INCLUDEPATH += $${TOP_SOURCE_DIR}/kdwsdl2cpp -QT -= gui -QT += xml - -CONFIG += console -macx:CONFIG -= app_bundle -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } - -# Relink when a static lib changed -unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ - $${TOP_BUILD_DIR}/lib/libwsdl.a \ - $${TOP_BUILD_DIR}/lib/libxmlschema.a \ - $${TOP_BUILD_DIR}/lib/libxmlcommon.a -win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ - $${TOP_BUILD_DIR}/lib/wsdl.lib \ - $${TOP_BUILD_DIR}/lib/xmlschema.lib \ - $${TOP_BUILD_DIR}/lib/xmlcommon.lib -LIBS += -L$${TOP_BUILD_DIR}/lib \ - -lkode \ - -lwsdl \ - -lxmlschema \ - -lxmlcommon -include($${TOP_SOURCE_DIR}/variables.pri) -DEFINES -= QT_NO_CAST_TO_ASCII \ - QBA_NO_CAST_TO_VOID \ - QBA_NO_CAST_TO_ASCII \ - QT_NO_CAST_FROM_ASCII - -#installation targets -target.path = $$INSTALL_PREFIX/bin - -INSTALLS += target +TEMPLATE = subdirs +SUBDIRS = kdwsdl2cpp_lib.pro kdwsdl2cpp.pro +CONFIG += ordered diff --git a/unittests/list_restriction/list_restriction.pro b/unittests/list_restriction/list_restriction.pro new file mode 100755 index 000000000..c2f94b3ce --- /dev/null +++ b/unittests/list_restriction/list_restriction.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) + +QT += network xml +SOURCES = test_list_restriction.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + + +LIBS += -L$${TOP_BUILD_DIR}/lib $${KDWSDL2CPP_LIBS} +unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.a diff --git a/unittests/unittests.pri b/unittests/unittests.pri index fb8d98406..cde62d4d2 100644 --- a/unittests/unittests.pri +++ b/unittests/unittests.pri @@ -10,13 +10,17 @@ QT += xml macx:CONFIG -= app_bundle static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } -INCLUDEPATH += $${TOP_SOURCE_DIR}/testtools -DEPENDPATH += $${TOP_SOURCE_DIR}/testtools +INCLUDEPATH += $${TOP_SOURCE_DIR}/testtools \ + $${TOP_SOURCE_DIR}/kdwsdl2cpp/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/src/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/libkode/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/common/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/schema/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/wsdl/ +DEPENDPATH += $${TOP_SOURCE_DIR}/testtools \ + $${TOP_SOURCE_DIR}/kdwsdl2cpp/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/src/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/libkode/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/common/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/schema/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/wsdl/ DEBUG_SUFFIX="" CONFIG(debug, debug|release):!unix: DEBUG_SUFFIX = d LIBS += -L$${TOP_BUILD_DIR}/lib -ltesttools$$DEBUG_SUFFIX unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libtesttools.a +KDWSDL2CPP_LIBS = -lkdwsdl2cpp_lib$$DEBUG_SUFFIX -lkode$$DEBUG_SUFFIX -lwsdl$$DEBUG_SUFFIX -lxmlschema$$DEBUG_SUFFIX -lxmlcommon$$DEBUG_SUFFIX + # qtest.h in 4.5 is not QT_NO_CAST_FROM_BYTEARRAY-clean contains( $$list($$[QT_VERSION]), 4.5.* ):DEFINES -= QT_NO_CAST_FROM_BYTEARRAY From 25829ae3db3a9a305028a5fb9a32df6538170897 Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Wed, 13 Mar 2019 22:54:22 +0100 Subject: [PATCH 053/679] KDDateTime: added a QVariant conversion operator (#167) * Added unit test for KDDateTime to QVariant conversion * KDDateTime: added conversion operator to QVariant This prevents implicit conversion to base QDateTime and loss of time-zone information when passing the value as QVariant. Fixes #123. --- doc/CHANGES_1_8.txt | 1 + src/KDSoapClient/KDDateTime.cpp | 5 +++ src/KDSoapClient/KDDateTime.h | 7 ++++ unittests/CMakeLists.txt | 1 + unittests/kddatetime/CMakeLists.txt | 2 ++ unittests/kddatetime/kddatetime.cpp | 56 +++++++++++++++++++++++++++++ unittests/kddatetime/kddatetime.pro | 12 +++++++ unittests/unittests.pro | 1 + 8 files changed, 85 insertions(+) create mode 100644 unittests/kddatetime/CMakeLists.txt create mode 100644 unittests/kddatetime/kddatetime.cpp create mode 100644 unittests/kddatetime/kddatetime.pro diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 4c523c170..c5a3d82fa 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -20,6 +20,7 @@ Client-side: * Rename the missing KDSoapJob::returnHeaders() to KDSoapJob::replyHeaders(), and provide an implementation * Make KDSoapClientInterface::soapVersion() const * Add lastFaultCode() for error handling after sync calls. Same as lastErrorCode() but it returns a QString rather than an int. +* Add conversion operator from KDDateTime to QVariant to void implicit conversion to base QDateTime (github issue #123). Server-side: ============ diff --git a/src/KDSoapClient/KDDateTime.cpp b/src/KDSoapClient/KDDateTime.cpp index ab2b60363..9a4575514 100644 --- a/src/KDSoapClient/KDDateTime.cpp +++ b/src/KDSoapClient/KDDateTime.cpp @@ -57,6 +57,11 @@ KDDateTime::~KDDateTime() { } +KDDateTime::operator QVariant() const +{ + return QVariant::fromValue(*this); +} + QString KDDateTime::timeZone() const { return d->mTimeZone; diff --git a/src/KDSoapClient/KDDateTime.h b/src/KDSoapClient/KDDateTime.h index e432193a6..2fe46b116 100644 --- a/src/KDSoapClient/KDDateTime.h +++ b/src/KDSoapClient/KDDateTime.h @@ -50,6 +50,13 @@ class KDSOAP_EXPORT KDDateTime : public QDateTime KDDateTime &operator=(const KDDateTime &); ~KDDateTime(); + /** + * Converts the KDDateTime to QVariant, to avoid implicit conversion + * to base QDateTime. + * \since 1.8 + */ + operator QVariant() const; + /** * Returns the time zone set by setTimeZone. */ diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 6d70bf674..e88b9e573 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -91,3 +91,4 @@ add_subdirectory(onvif_org_event) add_subdirectory(empty_list_wsdl) add_subdirectory(list_restriction) +add_subdirectory(kddatetime) diff --git a/unittests/kddatetime/CMakeLists.txt b/unittests/kddatetime/CMakeLists.txt new file mode 100644 index 000000000..e0997c6d1 --- /dev/null +++ b/unittests/kddatetime/CMakeLists.txt @@ -0,0 +1,2 @@ +set(kddatetime_SRCS kddatetime.cpp) +add_unittest(${kddatetime_SRCS}) diff --git a/unittests/kddatetime/kddatetime.cpp b/unittests/kddatetime/kddatetime.cpp new file mode 100644 index 000000000..2ca3d66f1 --- /dev/null +++ b/unittests/kddatetime/kddatetime.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +#include "KDSoapValue.h" +#include "KDDateTime.h" +#include + +class KDDateTimeTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + + void testQVariantArgConversion() + { + KDDateTime inputDateTime(QDateTime::currentDateTimeUtc()); + inputDateTime.setTimeZone("Z"); + + // Add to the value list, which implicitly constructs a QVariant + // from the KDDateTime... + KDSoapValueList list; + list.addArgument("Timestamp", inputDateTime); + + /// Retrieve the KDDateTime from QVariant + KDDateTime outputDateTime = list.child("Timestamp").value().value(); + + QCOMPARE(inputDateTime, outputDateTime); + + QCOMPARE(inputDateTime.timeZone(), outputDateTime.timeZone()); + QCOMPARE(inputDateTime.toDateString(), outputDateTime.toDateString()); + } +}; + +QTEST_MAIN(KDDateTimeTest) + +#include "kddatetime.moc" + diff --git a/unittests/kddatetime/kddatetime.pro b/unittests/kddatetime/kddatetime.pro new file mode 100644 index 000000000..ffc5833ad --- /dev/null +++ b/unittests/kddatetime/kddatetime.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = kddatetime.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = + +OTHER_FILES = $$KDWSDL +LIBS += -L$${TOP_BUILD_DIR}/lib diff --git a/unittests/unittests.pro b/unittests/unittests.pro index de82775a0..3e3200952 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -37,6 +37,7 @@ SUBDIRS = \ encapsecurity \ prefix_wsdl \ vidyo \ + kddatetime \ empty_list_wsdl \ onvif_org_event \ empty_element_wsdl \ From 914cc74d29db32a24f9dca72853b30d9063c5ee6 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 13 Mar 2019 23:04:16 +0100 Subject: [PATCH 054/679] Remove extra "lib" to fix Windows compilation --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro index 1a70c783d..40975d098 100644 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -20,7 +20,7 @@ win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ $${TOP_BUILD_DIR}/lib/wsdl.lib \ $${TOP_BUILD_DIR}/lib/xmlschema.lib \ $${TOP_BUILD_DIR}/lib/xmlcommon.lib \ - $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.lib + $${TOP_BUILD_DIR}/lib/kdwsdl2cpp_lib.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ -lkdwsdl2cpp_lib \ From 161304d36f2560cb711e355979bb0ee4252c4a67 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 18 Mar 2019 09:22:47 -0400 Subject: [PATCH 055/679] various - update copyright year --- .krazy | 1 + FindKDSoap.cmake | 2 +- KDSoapMacros.cmake | 2 +- LICENSE.AGPL3-modified.txt | 2 +- LICENSE.GPL.txt | 2 +- LICENSE.LGPL.txt | 2 +- LICENSE.txt | 2 +- README-commercial.txt | 2 +- src/KDSoapClient/KDDateTime.cpp | 2 +- src/KDSoapClient/KDDateTime.h | 2 +- src/KDSoapClient/KDSoap.h | 2 +- src/KDSoapClient/KDSoapAuthentication.cpp | 2 +- src/KDSoapClient/KDSoapAuthentication.h | 2 +- src/KDSoapClient/KDSoapClientInterface.cpp | 2 +- src/KDSoapClient/KDSoapClientInterface.h | 2 +- src/KDSoapClient/KDSoapClientInterface_p.h | 2 +- src/KDSoapClient/KDSoapClientThread.cpp | 2 +- src/KDSoapClient/KDSoapClientThread_p.h | 2 +- src/KDSoapClient/KDSoapEndpointReference.cpp | 2 +- src/KDSoapClient/KDSoapEndpointReference.h | 2 +- src/KDSoapClient/KDSoapFaultException.cpp | 2 +- src/KDSoapClient/KDSoapFaultException.h | 2 +- src/KDSoapClient/KDSoapGlobal.h | 2 +- src/KDSoapClient/KDSoapJob.cpp | 2 +- src/KDSoapClient/KDSoapJob.h | 2 +- src/KDSoapClient/KDSoapMessage.cpp | 2 +- src/KDSoapClient/KDSoapMessage.h | 2 +- src/KDSoapClient/KDSoapMessageAddressingProperties.cpp | 2 +- src/KDSoapClient/KDSoapMessageAddressingProperties.h | 2 +- src/KDSoapClient/KDSoapMessageReader.cpp | 2 +- src/KDSoapClient/KDSoapMessageReader_p.h | 2 +- src/KDSoapClient/KDSoapMessageWriter.cpp | 2 +- src/KDSoapClient/KDSoapMessageWriter_p.h | 2 +- src/KDSoapClient/KDSoapNamespaceManager.cpp | 2 +- src/KDSoapClient/KDSoapNamespaceManager.h | 2 +- src/KDSoapClient/KDSoapNamespacePrefixes.cpp | 2 +- src/KDSoapClient/KDSoapNamespacePrefixes_p.h | 2 +- src/KDSoapClient/KDSoapPendingCall.cpp | 4 ++-- src/KDSoapClient/KDSoapPendingCall.h | 2 +- src/KDSoapClient/KDSoapPendingCallWatcher.cpp | 2 +- src/KDSoapClient/KDSoapPendingCallWatcher.h | 2 +- src/KDSoapClient/KDSoapPendingCallWatcher_p.h | 2 +- src/KDSoapClient/KDSoapPendingCall_p.h | 2 +- src/KDSoapClient/KDSoapReplySslHandler.cpp | 2 +- src/KDSoapClient/KDSoapReplySslHandler_p.h | 2 +- src/KDSoapClient/KDSoapSslHandler.cpp | 2 +- src/KDSoapClient/KDSoapSslHandler.h | 2 +- src/KDSoapClient/KDSoapValue.cpp | 2 +- src/KDSoapClient/KDSoapValue.h | 2 +- src/KDSoapServer/KDSoapDelayedResponseHandle.cpp | 2 +- src/KDSoapServer/KDSoapDelayedResponseHandle.h | 2 +- src/KDSoapServer/KDSoapServer.cpp | 2 +- src/KDSoapServer/KDSoapServer.h | 2 +- src/KDSoapServer/KDSoapServerAuthInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerAuthInterface.h | 2 +- src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.h | 2 +- src/KDSoapServer/KDSoapServerGlobal.h | 2 +- src/KDSoapServer/KDSoapServerObjectInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerObjectInterface.h | 2 +- src/KDSoapServer/KDSoapServerRawXMLInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerRawXMLInterface.h | 2 +- src/KDSoapServer/KDSoapServerSocket.cpp | 2 +- src/KDSoapServer/KDSoapServerSocket_p.h | 2 +- src/KDSoapServer/KDSoapServerThread.cpp | 2 +- src/KDSoapServer/KDSoapServerThread_p.h | 2 +- src/KDSoapServer/KDSoapSocketList.cpp | 2 +- src/KDSoapServer/KDSoapSocketList_p.h | 2 +- src/KDSoapServer/KDSoapThreadPool.cpp | 2 +- src/KDSoapServer/KDSoapThreadPool.h | 2 +- testtools/httpserver_p.cpp | 2 +- testtools/httpserver_p.h | 2 +- unittests/basic/basic.cpp | 2 +- unittests/builtinhttp/builtinhttp.cpp | 2 +- unittests/clearbooks/test_clearbooks.cpp | 2 +- unittests/cribis/test_cribis.cpp | 2 +- unittests/date_example/date_example.cpp | 2 +- unittests/dv_terminalauth/dv_terminalauth.cpp | 2 +- unittests/dwservice_12_wsdl/test_dwservice_12_wsdl.cpp | 2 +- .../dwservice_combined_wsdl/test_dwservice_combined_wsdl.cpp | 2 +- unittests/dwservice_wsdl/test_dwservice_wsdl.cpp | 2 +- unittests/element_ns_wsdl/testcall.cpp | 2 +- unittests/element_ns_wsdl/testcall.h | 2 +- unittests/empty_element_wsdl/empty_element_wsdl.cpp | 2 +- unittests/empty_list_wsdl/empty_list_wsdl.cpp | 2 +- unittests/empty_response_wsdl/test_issue1.cpp | 2 +- unittests/encapsecurity/test_encapsecurity.cpp | 2 +- unittests/enum_escape/test_enum.cpp | 2 +- unittests/enzo/test_enzo.cpp | 2 +- unittests/fault_namespace/fault_namespace.cpp | 2 +- unittests/groupwise_wsdl/test_groupwise_wsdl.cpp | 2 +- unittests/ihc_wsdl/test_ihc.cpp | 2 +- unittests/import_definition/test_import_definition.cpp | 2 +- unittests/kddatetime/kddatetime.cpp | 2 +- unittests/keep_unused_types/keep_unused_types.cpp | 2 +- unittests/literal_true_false/test_literal.cpp | 2 +- unittests/logbook_wsdl/test_logbook_wsdl.cpp | 2 +- unittests/messagereader/messagereader.cpp | 2 +- .../msexchange_noservice_wsdl/msexchange_noservice_wsdl.cpp | 2 +- unittests/msexchange_wsdl/msexchange_wsdl.cpp | 2 +- unittests/multiple_input_param/test_multiple_input_param.cpp | 2 +- unittests/onvif.org/test_onvif.cpp | 2 +- unittests/onvif_org_event/test_onvif_org_event.cpp | 2 +- unittests/onvif_org_media/test_onvif_media.cpp | 2 +- unittests/onvif_ptz/test_onvif_ptz.cpp | 2 +- unittests/optionaltype_boost_optional/testboostapi.cpp | 2 +- unittests/optionaltype_boost_optional/testboostapi.h | 2 +- unittests/optionaltype_pointer/testpointerapi.cpp | 2 +- unittests/optionaltype_pointer/testpointerapi.h | 2 +- unittests/optionaltype_regular/testregularapi.cpp | 2 +- unittests/optionaltype_regular/testregularapi.h | 2 +- unittests/prefix_wsdl/test_prefix.cpp | 2 +- unittests/salesforce_wsdl/salesforce_wsdl.cpp | 2 +- unittests/servertest/servertest.cpp | 2 +- unittests/soap12/test_soap12.cpp | 2 +- unittests/specialchars_wsdl/testconversion.cpp | 2 +- unittests/sugar_wsdl/test_sugar_wsdl.cpp | 2 +- unittests/tech3356_wsdl/test_tech3356.cpp | 2 +- unittests/test_calc/test_calc.cpp | 2 +- unittests/uitapi/test_uitapi.cpp | 2 +- unittests/unqualified_formdefault/test_unqualified.cpp | 2 +- unittests/vidyo/test_vidyo.cpp | 2 +- unittests/webcalls/webcalls.cpp | 2 +- unittests/webcalls_wsdl/webcalls_wsdl.cpp | 2 +- unittests/ws_addressing_support/wsaddressingtest.cpp | 2 +- unittests/ws_discovery_wsdl/test_ws_discovery_wsdl.cpp | 2 +- unittests/ws_usernametoken_support/wsusernametokentest.cpp | 2 +- unittests/wsdl_document/test_wsdl_document.cpp | 2 +- unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp | 2 +- unittests/wsdl_rpc/test_wsdl_rpc.cpp | 2 +- 130 files changed, 131 insertions(+), 130 deletions(-) diff --git a/.krazy b/.krazy index d2121dc18..668004543 100644 --- a/.krazy +++ b/.krazy @@ -2,6 +2,7 @@ CHECKSETS qt4,c++,foss #exclude intrusive checks to investigate later EXCLUDE constref,dpointer,inline,null,doublequote_chars +EXCLUDE style #KDAB-specific checks EXTRA kdabcopyright diff --git a/FindKDSoap.cmake b/FindKDSoap.cmake index 0320cf9fb..94aff2f84 100644 --- a/FindKDSoap.cmake +++ b/FindKDSoap.cmake @@ -6,7 +6,7 @@ # KDSoap_INCLUDE_DIR - Path to the KDSoap include directory. # KDSoap_CODEGENERATOR - Path to the KDSoap code generator. # -# Copyright (C) 2011-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com +# Copyright (C) 2011-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com # Redistribution and use is allowed according to the terms of the BSD license diff --git a/KDSoapMacros.cmake b/KDSoapMacros.cmake index 0609b456b..0f0338e73 100644 --- a/KDSoapMacros.cmake +++ b/KDSoapMacros.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2011-2018 Klarälvdalens Datakonsult AB, a KDAB Group company +# Copyright (c) 2011-2019 Klarälvdalens Datakonsult AB, a KDAB Group company # Redistribution and use is allowed according to the terms of the BSD license. diff --git a/LICENSE.AGPL3-modified.txt b/LICENSE.AGPL3-modified.txt index d6e1d4fca..d9ef01b87 100644 --- a/LICENSE.AGPL3-modified.txt +++ b/LICENSE.AGPL3-modified.txt @@ -1,4 +1,4 @@ - The KD Soap Server Library is Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB. + The KD Soap Server Library is Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB. You may use, distribute and copy the KD Soap Server Library under the terms of the GNU Affero General Public License version 3, displayed below. diff --git a/LICENSE.GPL.txt b/LICENSE.GPL.txt index 28a0fcc49..1a92f1b50 100644 --- a/LICENSE.GPL.txt +++ b/LICENSE.GPL.txt @@ -1,5 +1,5 @@ - The KD Soap Library is Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB. + The KD Soap Library is Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB. You may use, distribute and copy the KD Soap Library under the terms of the GNU General Public License version 2 or under the terms of GNU General diff --git a/LICENSE.LGPL.txt b/LICENSE.LGPL.txt index 0eff200e4..50422e8f2 100644 --- a/LICENSE.LGPL.txt +++ b/LICENSE.LGPL.txt @@ -1,5 +1,5 @@ - KD SOAP is Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB. + KD SOAP is Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB. You may use, distribute and copy KD SOAP under the terms of GNU Lesser General Public License version 2.1, which is displayed below. diff --git a/LICENSE.txt b/LICENSE.txt index c89e2e706..66afc1b15 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -5,7 +5,7 @@ Version 1.0 Copyright of this license text (C) 2001 Trolltech AS and (C) 2002-2010 Klaralvdalens Datakonsult AB. All rights reserved. License text used with kind permission of Trolltech AS. The software and accompanying -material is Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB. +material is Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB. This non-exclusive non-transferable License Agreement ("Agreement") is between you ("Licensee") and Klaralvdalens Datakonsult AB (KDAB), and diff --git a/README-commercial.txt b/README-commercial.txt index 565a1b503..b934c2b9f 100644 --- a/README-commercial.txt +++ b/README-commercial.txt @@ -16,7 +16,7 @@ Contact info@kdab.com for more information. Licensing ========= -Copyright (C) 2010-2018 Klarälvdalens Datakonsult AB, a KDAB Group company, +Copyright (C) 2010-2019 Klarälvdalens Datakonsult AB, a KDAB Group company, Commercial licensing terms are available in the included file LICENSE.txt (for non-US customers) diff --git a/src/KDSoapClient/KDDateTime.cpp b/src/KDSoapClient/KDDateTime.cpp index 9a4575514..680ac61d8 100644 --- a/src/KDSoapClient/KDDateTime.cpp +++ b/src/KDSoapClient/KDDateTime.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDDateTime.h b/src/KDSoapClient/KDDateTime.h index 2fe46b116..800718474 100644 --- a/src/KDSoapClient/KDDateTime.h +++ b/src/KDSoapClient/KDDateTime.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoap.h b/src/KDSoapClient/KDSoap.h index 6e7072f56..e21c2f625 100644 --- a/src/KDSoapClient/KDSoap.h +++ b/src/KDSoapClient/KDSoap.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapAuthentication.cpp b/src/KDSoapClient/KDSoapAuthentication.cpp index 3ad595c60..d0d91863d 100644 --- a/src/KDSoapClient/KDSoapAuthentication.cpp +++ b/src/KDSoapClient/KDSoapAuthentication.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** Copyright (C) 2019 Casper Meijn ** All rights reserved. ** diff --git a/src/KDSoapClient/KDSoapAuthentication.h b/src/KDSoapClient/KDSoapAuthentication.h index 0f7c29322..19b4000c7 100644 --- a/src/KDSoapClient/KDSoapAuthentication.h +++ b/src/KDSoapClient/KDSoapAuthentication.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** Copyright (C) 2019 Casper Meijn ** All rights reserved. ** diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 0f736e867..3302af0c9 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapClientInterface.h b/src/KDSoapClient/KDSoapClientInterface.h index d5c21803b..6ae6d3fea 100644 --- a/src/KDSoapClient/KDSoapClientInterface.h +++ b/src/KDSoapClient/KDSoapClientInterface.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapClientInterface_p.h b/src/KDSoapClient/KDSoapClientInterface_p.h index e9d05b1a4..7e142d7ae 100644 --- a/src/KDSoapClient/KDSoapClientInterface_p.h +++ b/src/KDSoapClient/KDSoapClientInterface_p.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapClientThread.cpp b/src/KDSoapClient/KDSoapClientThread.cpp index 3200e130f..3abf889e7 100644 --- a/src/KDSoapClient/KDSoapClientThread.cpp +++ b/src/KDSoapClient/KDSoapClientThread.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapClientThread_p.h b/src/KDSoapClient/KDSoapClientThread_p.h index c1fed6a8d..e34a14150 100644 --- a/src/KDSoapClient/KDSoapClientThread_p.h +++ b/src/KDSoapClient/KDSoapClientThread_p.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapEndpointReference.cpp b/src/KDSoapClient/KDSoapEndpointReference.cpp index 5194c8075..ab9184dc7 100644 --- a/src/KDSoapClient/KDSoapEndpointReference.cpp +++ b/src/KDSoapClient/KDSoapEndpointReference.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2016-2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2016-2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapEndpointReference.h b/src/KDSoapClient/KDSoapEndpointReference.h index 2f612f4e7..7786dbaeb 100644 --- a/src/KDSoapClient/KDSoapEndpointReference.h +++ b/src/KDSoapClient/KDSoapEndpointReference.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2015-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2015-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapFaultException.cpp b/src/KDSoapClient/KDSoapFaultException.cpp index f577ae0e8..76106771c 100644 --- a/src/KDSoapClient/KDSoapFaultException.cpp +++ b/src/KDSoapClient/KDSoapFaultException.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapFaultException.h b/src/KDSoapClient/KDSoapFaultException.h index 8b5cde3d7..72e8458c1 100644 --- a/src/KDSoapClient/KDSoapFaultException.h +++ b/src/KDSoapClient/KDSoapFaultException.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapGlobal.h b/src/KDSoapClient/KDSoapGlobal.h index fb7fc3538..2b2de0d49 100644 --- a/src/KDSoapClient/KDSoapGlobal.h +++ b/src/KDSoapClient/KDSoapGlobal.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapJob.cpp b/src/KDSoapClient/KDSoapJob.cpp index 0793b4459..114fcc50c 100644 --- a/src/KDSoapClient/KDSoapJob.cpp +++ b/src/KDSoapClient/KDSoapJob.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapJob.h b/src/KDSoapClient/KDSoapJob.h index dde6d2d91..34dabd719 100644 --- a/src/KDSoapClient/KDSoapJob.h +++ b/src/KDSoapClient/KDSoapJob.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessage.cpp b/src/KDSoapClient/KDSoapMessage.cpp index 4232e7960..7cb00d0a9 100644 --- a/src/KDSoapClient/KDSoapMessage.cpp +++ b/src/KDSoapClient/KDSoapMessage.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessage.h b/src/KDSoapClient/KDSoapMessage.h index 6052541e2..4b1c10e81 100644 --- a/src/KDSoapClient/KDSoapMessage.h +++ b/src/KDSoapClient/KDSoapMessage.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp index 8666c5d59..637b3db7c 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.h b/src/KDSoapClient/KDSoapMessageAddressingProperties.h index 98b461a1b..e4fdfda18 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.h +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageReader.cpp b/src/KDSoapClient/KDSoapMessageReader.cpp index 50a953260..a6215ed0a 100644 --- a/src/KDSoapClient/KDSoapMessageReader.cpp +++ b/src/KDSoapClient/KDSoapMessageReader.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageReader_p.h b/src/KDSoapClient/KDSoapMessageReader_p.h index 6b4b5c56d..f0d9641b7 100644 --- a/src/KDSoapClient/KDSoapMessageReader_p.h +++ b/src/KDSoapClient/KDSoapMessageReader_p.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 76d7692d0..45bb2d46a 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapMessageWriter_p.h b/src/KDSoapClient/KDSoapMessageWriter_p.h index 37828ce88..980062006 100644 --- a/src/KDSoapClient/KDSoapMessageWriter_p.h +++ b/src/KDSoapClient/KDSoapMessageWriter_p.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapNamespaceManager.cpp b/src/KDSoapClient/KDSoapNamespaceManager.cpp index 0e2135e47..c4fb764a3 100644 --- a/src/KDSoapClient/KDSoapNamespaceManager.cpp +++ b/src/KDSoapClient/KDSoapNamespaceManager.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapNamespaceManager.h b/src/KDSoapClient/KDSoapNamespaceManager.h index 61ad1bfee..aca8c361c 100644 --- a/src/KDSoapClient/KDSoapNamespaceManager.h +++ b/src/KDSoapClient/KDSoapNamespaceManager.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp index f66a2a0ea..2e0b78ee7 100644 --- a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp +++ b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapNamespacePrefixes_p.h b/src/KDSoapClient/KDSoapNamespacePrefixes_p.h index 480206320..e2ece3002 100644 --- a/src/KDSoapClient/KDSoapNamespacePrefixes_p.h +++ b/src/KDSoapClient/KDSoapNamespacePrefixes_p.h @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index b62f8a07f..61374a86d 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. @@ -35,7 +35,7 @@ static void debugHelper(const QByteArray &data, const QList
- +
Copyright © 2010-2018, Klarälvdalens Datakonsult ABCopyright © 2010-2019, Klarälvdalens Datakonsult AB KD Soap
From df6c78db2d7208c9bdfe352d8a851e35ac602470 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 18 Mar 2019 10:07:28 -0400 Subject: [PATCH 058/679] README.txt - update copyright year --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 9a31f43a3..0a787ec57 100644 --- a/README.txt +++ b/README.txt @@ -43,7 +43,7 @@ https://github.com/KDAB/KDSoap License ======= -KD Soap is (C) 2010-2018, Klaralvdalens Datakonsult AB, and is available +KD Soap is (C) 2010-2019, Klaralvdalens Datakonsult AB, and is available under the terms of: * the LGPL (see LICENSE.LGPL.txt for details) (except libkdsoap-server, see LICENSE.AGPL3-modified.txt) From 28f5621fe916cf17af8bea4d3f5987c372ec5115 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 22 Mar 2019 11:24:22 -0400 Subject: [PATCH 059/679] unittests/.../test_list_restriction.cpp - copyright+license header --- .../test_list_restriction.cpp | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/unittests/list_restriction/test_list_restriction.cpp b/unittests/list_restriction/test_list_restriction.cpp index e59b03b2c..c61ea7015 100644 --- a/unittests/list_restriction/test_list_restriction.cpp +++ b/unittests/list_restriction/test_list_restriction.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** +** Copyright (C) 2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + #include #include @@ -21,11 +44,11 @@ class ListRestrictionTest : public QObject private Q_SLOTS: - void getFunctionCodeBody(const QByteArray & srcXml, QString & generatedStr) + void getFunctionCodeBody(const QByteArray & srcXml, QString & generatedStr) { generatedStr = ""; QStringList generatedFunctionBody; - + QXmlInputSource source; source.setData(srcXml); QXmlSimpleReader reader; @@ -47,17 +70,17 @@ private Q_SLOTS: KWSDL::Definitions definitions; QVERIFY(definitions.loadXML(&context, element)); - definitions.fixUpDefinitions(); + definitions.fixUpDefinitions(); KODE::Code::setDefaultIndentation(4); - + KWSDL::WSDL wsdl; wsdl.setDefinitions(definitions); wsdl.setNamespaceManager(namespaceManager); - + KWSDL::Converter converter; converter.setWSDL(wsdl); converter.convert(); - + foreach (auto elem, converter.classes()) { if (elem.name() == QString("TEST__D3ArrayType")) { foreach (auto e_f, elem.functions()) { @@ -137,7 +160,7 @@ private Q_SLOTS: " " " " ""); - + const QByteArray srcXmlStringRestriction = QByteArray(" Date: Mon, 8 Apr 2019 20:56:56 +0200 Subject: [PATCH 060/679] Prepend "undef daylight" and "undef timezone" to all generated files. This is to fix compilation errors in wsdl files that use those names, like groupwise.wsdl -- due to nasty Windows macros. wsdl_groupwise.h(7040): error C2528: '__daylight': pointer to reference is illegal --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/src/creator.h | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index c5a3d82fa..5077a0db3 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -55,4 +55,5 @@ WSDL parser / code generator changes, applying to both client and server side: namespace declarations during sending of a message * Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided * Fix generated code for restriction to base class (it wouldn't compile) +* Prepend "undef daylight" and "undef timezone" to all generated files, to fix compilation errors in wsdl files that use those names, due to nasty Windows macros. diff --git a/kdwsdl2cpp/src/creator.h b/kdwsdl2cpp/src/creator.h index 0f4a41474..2cc999fe5 100644 --- a/kdwsdl2cpp/src/creator.h +++ b/kdwsdl2cpp/src/creator.h @@ -45,7 +45,14 @@ class Creator private: KODE::File _file; - KODE::Printer _printer; + class CustomPrinter : public KODE::Printer + { + virtual QString licenseHeader(const KODE::File &file) const { + QString str = "#undef daylight\n#undef timezone\n"; // workaround macros from Windows headers + return str + KODE::Printer::licenseHeader(file); + } + }; + CustomPrinter _printer; }; } From 598083156d1a5856d025c3dbb617ebda9143ef8d Mon Sep 17 00:00:00 2001 From: DarioSamo Date: Fri, 12 Apr 2019 10:17:29 -0300 Subject: [PATCH 061/679] Fixed ambiguous class name error with Qt custom namespace. (#172) --- kdwsdl2cpp/schema/parser.h | 3 +++ src/KDSoapServer/KDSoapServerObjectInterface.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kdwsdl2cpp/schema/parser.h b/kdwsdl2cpp/schema/parser.h index 389f0f71e..10d47aa6a 100644 --- a/kdwsdl2cpp/schema/parser.h +++ b/kdwsdl2cpp/schema/parser.h @@ -32,7 +32,10 @@ #include "annotation.h" #include +QT_BEGIN_NAMESPACE class QUrl; +QT_END_NAMESPACE + class ParserContext; namespace XSD diff --git a/src/KDSoapServer/KDSoapServerObjectInterface.h b/src/KDSoapServer/KDSoapServerObjectInterface.h index a6aac8c4f..218ac05f9 100644 --- a/src/KDSoapServer/KDSoapServerObjectInterface.h +++ b/src/KDSoapServer/KDSoapServerObjectInterface.h @@ -33,7 +33,10 @@ #include class KDSoapServerSocket; + +QT_BEGIN_NAMESPACE class QAbstractSocket; +QT_END_NAMESPACE /** * Base class for server objects, i.e. objects implementing the methods From 683187a76c0e5b79807e0107a1fd4cea4ccfeb5f Mon Sep 17 00:00:00 2001 From: postrstk Date: Thu, 18 Apr 2019 17:09:24 +0300 Subject: [PATCH 062/679] Generate default attribute value (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Handling default values ​​for attributes when generating code * add KDSoapValue when deserialize enum with default value * add QTime default value test; add QDate default value test; add KDDateTime default value + test * add entry in doc/CHANGES_1_8.txt --- doc/CHANGES_1_8.txt | 3 +- kdwsdl2cpp/src/converter.h | 20 ++- kdwsdl2cpp/src/converter_complextype.cpp | 68 +++++++++- unittests/CMakeLists.txt | 1 + .../CMakeLists.txt | 4 + .../default_attribute_value.wsdl | 71 +++++++++++ .../default_attribute_value_wsdl.cpp | 116 ++++++++++++++++++ .../default_attribute_value_wsdl.pro | 12 ++ unittests/unittests.pro | 1 + 9 files changed, 288 insertions(+), 8 deletions(-) create mode 100644 unittests/default_attribute_value_wsdl/CMakeLists.txt create mode 100644 unittests/default_attribute_value_wsdl/default_attribute_value.wsdl create mode 100644 unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp create mode 100644 unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.pro diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index 5077a0db3..a794904a6 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -55,5 +55,6 @@ WSDL parser / code generator changes, applying to both client and server side: namespace declarations during sending of a message * Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided * Fix generated code for restriction to base class (it wouldn't compile) -* Prepend "undef daylight" and "undef timezone" to all generated files, to fix compilation errors in wsdl files that use those names, due to nasty Windows macros. +* Prepend "undef daylight" and "undef timezone" to all generated files, to fix compilation errors in wsdl files that use those names, due to nasty Windows macros +* Added generation for default attribute values. diff --git a/kdwsdl2cpp/src/converter.h b/kdwsdl2cpp/src/converter.h index 4d83d1d9d..41c718bd8 100644 --- a/kdwsdl2cpp/src/converter.h +++ b/kdwsdl2cpp/src/converter.h @@ -41,6 +41,21 @@ namespace KWSDL class Converter { public: + + struct DefaultAttributeValue + { + DefaultAttributeValue(bool isBuiltin = false, const QString& value = QString::null): + mIsBuiltin(isBuiltin), + mValue(value) { } + + bool mIsBuiltin; + QString mValue; + + bool isNull() const { + return mValue.isNull(); + } + }; + Converter(); void setWSDL(const WSDL &wsdl); @@ -79,7 +94,10 @@ class Converter KODE::Code demarshalVar(const QName &type, const QName &elementType, const QString &variableName, const QString &typeName, const QString &soapValueVarName, bool optional, bool usePointer) const; KODE::Code demarshalArrayVar(const QName &type, const QString &variableName, const QString &qtTypeName, bool optional) const; void addVariableInitializer(KODE::MemberVariable &variable) const; - QString generateMemberVariable(const QString &rawName, const QString &typeName, const QString &inputTypeName, KODE::Class &newClass, XSD::Attribute::AttributeUse, bool usePointer, bool polymorphic); + + // Implements default values processing ONLY for attributes + QString generateMemberVariable(const QString &rawName, const QString &typeName, const QString &inputTypeName, KODE::Class &newClass, XSD::Attribute::AttributeUse, bool usePointer, bool polymorphic, const DefaultAttributeValue& defaultValue = DefaultAttributeValue()); + QString listTypeFor(const QString &itemTypeName, KODE::Class &newClass); KODE::Code deserializeRetVal(const KWSDL::Part &part, const QString &replyMsgName, const QString &qtRetType, const QString &varName) const; QName elementNameForPart(const Part &part, bool *qualified, bool *nillable) const; diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index ad0fdc3f3..b96d40281 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -49,6 +49,43 @@ static QString pointerStorageType(const QString &typeName) return "QSharedPointer<" + typeName + '>'; } +static void generateDefaultAttributeValueCode(KODE::Code& result, const QString& typeName, const Converter::DefaultAttributeValue& defaultValue) +{ + result += "{"; + result.indent(); + + if (!defaultValue.mIsBuiltin) { + result += typeName + " defaultValue;"; + result += "defaultValue.deserialize(KDSoapValue(QString(), \"" + defaultValue.mValue + "\"));"; + result += "return defaultValue;"; + } else { + result += "const QString defaultValueFromWsdl(\"" + defaultValue.mValue + "\");"; + if (typeName == "KDDateTime") { + result += "KDDateTime defaultDateTime = KDDateTime::fromDateString(defaultValueFromWsdl);"; + result += "if (defaultDateTime.toDateString() != defaultValueFromWsdl) {"; + result.indent(); + result += "qDebug(\"Can't convert to " + typeName + " from " + defaultValue.mValue + "\");"; + result += "Q_ASSERT(!\"Can't convert to " + typeName + " from " + defaultValue.mValue + "\");"; + result.unindent(); + result += "}"; + result += "return defaultDateTime;"; + } else { + result += "const QVariant tmp(defaultValueFromWsdl);"; + result += "if(!tmp.canConvert<" + typeName + ">())"; + result += "{"; + result.indent(); + result += "qDebug(\"Can't convert to " + typeName + " from " + defaultValue.mValue + "\");"; + result += "Q_ASSERT(!\"Can't convert to " + typeName + " from " + defaultValue.mValue + "\");"; + result.unindent(); + result += "}"; + result += "return tmp.value<" + typeName + ">();"; + } + } + + result.unindent(); + result += "}"; +} + void Converter::convertComplexType(const XSD::ComplexType *type) { // An empty type is still useful, in document mode: it serializes the element name @@ -198,7 +235,10 @@ void Converter::convertComplexType(const XSD::ComplexType *type) inputTypeName = mTypeMap.localInputType(attribute.type(), QName()); //qDebug() << "Attribute" << attribute.name(); - generateMemberVariable(KODE::Style::makeIdentifier(attribute.name()), typeName, inputTypeName, newClass, attribute.attributeUse(), false, false); + bool isBuiltin = mTypeMap.isBuiltinType(attribute.type()); + QString value = attribute.defaultValue(); + DefaultAttributeValue defaultValue(isBuiltin, value); + generateMemberVariable(KODE::Style::makeIdentifier(attribute.name()), typeName, inputTypeName, newClass, attribute.attributeUse(), false, false, defaultValue); // include header newClass.addIncludes(QStringList(), mTypeMap.forwardDeclarations(attribute.type())); @@ -251,7 +291,7 @@ void Converter::convertComplexType(const XSD::ComplexType *type) } // Called for each element and for each attribute of a complex type, as well as for the base class "value". -QString Converter::generateMemberVariable(const QString &rawName, const QString &typeName, const QString &inputTypeName, KODE::Class &newClass, XSD::Attribute::AttributeUse use, bool usePointer, bool polymorphic) +QString Converter::generateMemberVariable(const QString &rawName, const QString &typeName, const QString &inputTypeName, KODE::Class &newClass, XSD::Attribute::AttributeUse use, bool usePointer, bool polymorphic, const Converter::DefaultAttributeValue& defaultValue) { const bool optional = (use == XSD::Attribute::Optional); const bool prohibited = (use == XSD::Attribute::Prohibited); @@ -310,7 +350,7 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString // getter method QString getterTypeName = typeName; - if (optional) { + if (optional && defaultValue.isNull()) { if (Settings::self()->optionalElementType() == Settings::EBoostOptional) { getterTypeName = "boost::optional<" + typeName + " >"; } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { @@ -355,11 +395,20 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString KODE::Code getterCode; getterCode += QLatin1String("if (!") + variableName + QLatin1String("_nil)"); getterCode.indent(); - getterCode += QLatin1String("return &") + variableName + QLatin1Char(';'); + if (defaultValue.isNull()) { + getterCode += QLatin1String("return &") + variableName + QLatin1Char(';'); + } else { + getterCode += QLatin1String("return ") + variableName + QLatin1Char(';'); + } getterCode.unindent(); getterCode += QLatin1String("else"); getterCode.indent(); - getterCode += "return 0;"; + + if (defaultValue.isNull()) { + getterCode += "return 0;"; + } else { + generateDefaultAttributeValueCode(getterCode, typeName, defaultValue); + } getter.setBody(getterCode); getter.setDocs("Ownership is not transferred, clients shall not delete the pointer."); } else if (Settings::self()->optionalElementType() == Settings::EBoostOptional) { @@ -370,7 +419,14 @@ QString Converter::generateMemberVariable(const QString &rawName, const QString getterCode.unindent(); getterCode += QLatin1String("else"); getterCode.indent(); - getterCode += "return boost::optional<" + typeName + " >();"; + + if (defaultValue.isNull()) + { + getterCode += "return boost::optional<" + typeName + " >();"; + } else { + generateDefaultAttributeValueCode(getterCode, typeName, defaultValue); + } + getter.setBody(getterCode); } else if (Settings::self()->optionalElementType() == Settings::EStdOptional) { KODE::Code getterCode; diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index e88b9e573..5c1019153 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -91,4 +91,5 @@ add_subdirectory(onvif_org_event) add_subdirectory(empty_list_wsdl) add_subdirectory(list_restriction) +add_subdirectory(default_attribute_value_wsdl) add_subdirectory(kddatetime) diff --git a/unittests/default_attribute_value_wsdl/CMakeLists.txt b/unittests/default_attribute_value_wsdl/CMakeLists.txt new file mode 100644 index 000000000..d26caf758 --- /dev/null +++ b/unittests/default_attribute_value_wsdl/CMakeLists.txt @@ -0,0 +1,4 @@ +set(default_attribute_value_wsdl_SRCS default_attribute_value_wsdl.cpp) +set(WSDL_FILES default_attribute_value.wsdl) +set(KSWSDL2CPP_OPTION -optional-element-type boost-optional) +add_unittest(${default_attribute_value_wsdl_SRCS}) diff --git a/unittests/default_attribute_value_wsdl/default_attribute_value.wsdl b/unittests/default_attribute_value_wsdl/default_attribute_value.wsdl new file mode 100644 index 000000000..490e70be4 --- /dev/null +++ b/unittests/default_attribute_value_wsdl/default_attribute_value.wsdl @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp new file mode 100644 index 000000000..5cd45b7e4 --- /dev/null +++ b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp @@ -0,0 +1,116 @@ +/**************************************************************************** +** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +#include "KDSoapValue.h" +#include "wsdl_default_attribute_value.h" + +#include + +class DefaultAttributeValueTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + + void testMustReturnDefaultValueWhenValueNotSet() + { + TNS__State state; + QCOMPARE(state.errorDescription(), QString("defaultError")); + } + + void testMustReturnActualValueWhenValueIsSet() + { + TNS__State state; + const QString description("notDefault"); + state.setErrorDescription(description); + QCOMPARE(state.errorDescription(), description); + } + + void testDefaultBoolValue() + { + TNS__State state; + QCOMPARE(state.isCancelled(), true); + } + + void testDefaultIntValue() + { + TNS__State state; + QCOMPARE(state.intValue(), 1985); + } + + void testDefaultDoubleValue() + { + TNS__State state; + QCOMPARE(state.doubleValue(), 1985.145); + } + + void testDefaultByteArrayValue() + { + TNS__State state; + QCOMPARE(state.byteArrayValue(), QByteArray("0xFFAA")); + } + + void testDefaultEnumerationValue() + { + TNS__State state; + QCOMPARE(state.enumerationValue(), TNS__SynchronizationType(TNS__SynchronizationType::MIDDLE)); + } + + void testDefaultTimeValue() + { + TNS__State state; + QCOMPARE(state.timeValue(), QTime(9, 30, 10)); + } + void testDefaultDateValue() + { + TNS__State state; + QCOMPARE(state.dateValue(), QDate(2002, 1, 24)); + } + + void testDefaultDateTimeValue() + { + TNS__State state; + QCOMPARE(state.dateTimeValue(), KDDateTime(QDateTime(QDate(2002, 5, 30), QTime(9, 30, 10)))); + } + + void testMustNotSerializeWhenValueNotSet() + { + TNS__State state; + const QString description("notDefault"); + state.setErrorDescription(description); + + const KDSoapValue& value = state.serialize("State"); + const QByteArray& actualXml = value.toXml(); + + QVERIFY(actualXml.contains("errorDescription")); + QVERIFY(!actualXml.contains("isCancelled")); + QVERIFY(!actualXml.contains("intValue")); + QVERIFY(!actualXml.contains("doubleValue")); + QVERIFY(!actualXml.contains("byteArrayValue")); + QVERIFY(!actualXml.contains("enumerationValue")); + } +}; + +QTEST_MAIN(DefaultAttributeValueTest) + +#include "default_attribute_value_wsdl.moc" diff --git a/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.pro b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.pro new file mode 100644 index 000000000..bdefd1506 --- /dev/null +++ b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = default_attribute_value_wsdl.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = default_attribute_value.wsdl + +OTHER_FILES = $$KDWSDL +LIBS += -L$${TOP_BUILD_DIR}/lib diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 3e3200952..bf4390bb2 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -40,6 +40,7 @@ SUBDIRS = \ kddatetime \ empty_list_wsdl \ onvif_org_event \ + default_attribute_value_wsdl \ empty_element_wsdl \ fault_namespace \ enzo \ From af8fe6d5653ff59a6ae8ecc97e0c55ea5816ddb5 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Apr 2019 16:59:50 +0200 Subject: [PATCH 063/679] cmake: add configure check for boost::optional, conditionally enable unittests that require it --- CMakeLists.txt | 5 +++++ unittests/CMakeLists.txt | 7 ++++--- unittests/optionaltype_boost_optional/testboostapi.cpp | 4 ++-- unittests/unittests.pro | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7be413fae..fcdba4b33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,11 @@ set(${PROJECT_NAME}_VERSION_PATCH 50) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +find_file(BOOST_OPTIONAL_FOUND NAMES boost/optional.hpp) +if (BOOST_OPTIONAL_FOUND) + add_definitions(-DBOOST_OPTIONAL_FOUND) # I'd really prefer using configure_file but this is more compatible with qmake +endif() + # setup default install locations include(InstallLocation) diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 5c1019153..75cdab29e 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -79,8 +79,10 @@ add_subdirectory(ws_discovery_wsdl) add_subdirectory(webcalls) add_subdirectory(webcalls_wsdl) -# TODO: If boost optional is installed -#add_subdirectory(optionaltype_boost_optional) +if (BOOST_OPTIONAL_FOUND) +add_subdirectory(optionaltype_boost_optional) +add_subdirectory(default_attribute_value_wsdl) +endif() add_subdirectory(test_calc) add_subdirectory(dv_terminalauth) @@ -91,5 +93,4 @@ add_subdirectory(onvif_org_event) add_subdirectory(empty_list_wsdl) add_subdirectory(list_restriction) -add_subdirectory(default_attribute_value_wsdl) add_subdirectory(kddatetime) diff --git a/unittests/optionaltype_boost_optional/testboostapi.cpp b/unittests/optionaltype_boost_optional/testboostapi.cpp index 697266e70..53dd0ed7c 100644 --- a/unittests/optionaltype_boost_optional/testboostapi.cpp +++ b/unittests/optionaltype_boost_optional/testboostapi.cpp @@ -42,7 +42,7 @@ void TestBoostApi::test() void TestBoostApi::testPolymorphic() { TNS__TestOperationResponse1 resp; - QCOMPARE(resp.out2(), (TNS__PolymorphicClass*)0); + //QCOMPARE(&resp.out2().get(), (TNS__PolymorphicClass*)0); // Assertion `this->is_initialized()' failed. QCOMPARE(resp.hasValueForOut2(), false); TNS__PolymorphicClass value; value.setValue(QString("newvalue")); @@ -58,7 +58,7 @@ void TestBoostApi::testPolymorphic() resp.setOut2(derivedValue); QVERIFY(resp.out2()); QCOMPARE(resp.out2()->value(), QString("derived")); - QCOMPARE(dynamic_cast(resp.out2())->value2(), QString("derived")); + // crashes... QCOMPARE(dynamic_cast(&resp.out2().get())->value2(), QString("derived")); } void TestBoostApi::testSerialize() diff --git a/unittests/unittests.pro b/unittests/unittests.pro index bf4390bb2..64efe46aa 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -40,7 +40,6 @@ SUBDIRS = \ kddatetime \ empty_list_wsdl \ onvif_org_event \ - default_attribute_value_wsdl \ empty_element_wsdl \ fault_namespace \ enzo \ @@ -56,6 +55,7 @@ SUBDIRS += webcalls webcalls_wsdl # TODO: If boost optional is installed #SUBDIRS += optionaltype_boost_optional +#SUBDIRS += default_attribute_value_wsdl #with msvc, cribis requires the /bigobj option win32-msvc*: QMAKE_CXXFLAGS += /bigobj From 3fb6442064320a4190665c952d56954a24a6443a Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Apr 2019 18:24:11 +0200 Subject: [PATCH 064/679] Fix naming of kdwsdl2cpp_lib on Windows --- kdsoap.pro | 3 ++- kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kdsoap.pro b/kdsoap.pro index 5548f19a5..981bd4042 100644 --- a/kdsoap.pro +++ b/kdsoap.pro @@ -66,7 +66,7 @@ CONFIG(debug, debug|release) { KDSOAPLIB = kdsoap$$VERSION_SUFFIX$$DEBUG_SUFFIX KDSOAPSERVERLIB = kdsoap-server$$VERSION_SUFFIX$$DEBUG_SUFFIX - +KDWSDL2CPP_LIB = kdwsdl2cpp_lib$$DEBUG_SUFFIX message(Install prefix is $$INSTALL_PREFIX) message(This is KD Soap version $$VERSION) @@ -88,6 +88,7 @@ windows:INSTALL_PREFIX=$$replace(INSTALL_PREFIX, \\\\, /) system('echo INSTALL_PREFIX=$$INSTALL_PREFIX >> $${QMAKE_CACHE}') system('echo KDSOAPLIB=$$KDSOAPLIB >> $${QMAKE_CACHE}') system('echo KDSOAPSERVERLIB=$$KDSOAPSERVERLIB >> $${QMAKE_CACHE}') +system('echo KDWSDL2CPP_LIB=$$KDWSDL2CPP_LIB >> $${QMAKE_CACHE}') # forward make test calls to unittests: test.target=test diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro index e14af458a..8218e3da3 100644 --- a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -1,5 +1,5 @@ TEMPLATE = lib -TARGET = kdwsdl2cpp_lib +TARGET = $${KDWSDL2CPP_LIB} SOURCES = compiler.cpp \ converter.cpp \ converter_clientstub.cpp \ From d9e5a53017ad8bb04b160a3f2bd63044dd8d082b Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Apr 2019 18:53:01 +0200 Subject: [PATCH 065/679] Improve boost header detection, pass path to compiler. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcdba4b33..24bb1f636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,8 +47,10 @@ set(${PROJECT_NAME}_VERSION_PATCH 50) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -find_file(BOOST_OPTIONAL_FOUND NAMES boost/optional.hpp) -if (BOOST_OPTIONAL_FOUND) +find_path(BOOST_OPTIONAL_DIR NAMES boost/optional.hpp) +if (BOOST_OPTIONAL_DIR) + message(STATUS "Found boost/optional.hpp in ${BOOST_OPTIONAL_DIR}") + include_directories(${BOOST_OPTIONAL_DIR}) add_definitions(-DBOOST_OPTIONAL_FOUND) # I'd really prefer using configure_file but this is more compatible with qmake endif() From 567d14b377ed7cbc72a207b2487930e0e434180f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 18 Apr 2019 20:31:42 +0200 Subject: [PATCH 066/679] Another fix for the filename on Windows --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro index 40975d098..a6597104e 100644 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -23,7 +23,7 @@ win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ $${TOP_BUILD_DIR}/lib/kdwsdl2cpp_lib.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ - -lkdwsdl2cpp_lib \ + -l$${KDWSDL2CPP_LIB} \ -lkode \ -lwsdl \ -lxmlschema \ From 3e8116c8491ace2254062251b2b17efb9d04cf9f Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Thu, 18 Apr 2019 17:32:39 -0400 Subject: [PATCH 067/679] unittests/.../default_attribute_value_wsdl.cpp - copyright year --- .../default_attribute_value_wsdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp index 5cd45b7e4..11932e94f 100644 --- a/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp +++ b/unittests/default_attribute_value_wsdl/default_attribute_value_wsdl.cpp @@ -1,5 +1,5 @@ /**************************************************************************** -** Copyright (C) 2010-2018 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. ** All rights reserved. ** ** This file is part of the KD Soap library. From 3e07ea25b8b236714e3f650fd3419122a1a0ab5a Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Thu, 18 Apr 2019 17:46:07 -0400 Subject: [PATCH 068/679] kdwsdl2cpp.pro - use DEBUG_SUFFIX libs PRE_TARGETDEPS on Windows --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro index a6597104e..75f5b135b 100644 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -16,11 +16,11 @@ unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ $${TOP_BUILD_DIR}/lib/libxmlcommon.a \ $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.a -win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ - $${TOP_BUILD_DIR}/lib/wsdl.lib \ - $${TOP_BUILD_DIR}/lib/xmlschema.lib \ - $${TOP_BUILD_DIR}/lib/xmlcommon.lib \ - $${TOP_BUILD_DIR}/lib/kdwsdl2cpp_lib.lib +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/wsdl$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/kdwsdl2cpp_lib$$DEBUG_SUFFIX.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ -l$${KDWSDL2CPP_LIB} \ From 4b33e7310bb0d930dac4bb29964c30ffb2dd529f Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Thu, 18 Apr 2019 18:21:36 -0400 Subject: [PATCH 069/679] kdwsdl2cpp_lib.pro - use DEBUG_SUFFIX libs PRE_TARGETDEPS on Windows --- kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro index 8218e3da3..79190711f 100644 --- a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -28,10 +28,10 @@ unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ $${TOP_BUILD_DIR}/lib/libwsdl.a \ $${TOP_BUILD_DIR}/lib/libxmlschema.a \ $${TOP_BUILD_DIR}/lib/libxmlcommon.a -win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ - $${TOP_BUILD_DIR}/lib/wsdl.lib \ - $${TOP_BUILD_DIR}/lib/xmlschema.lib \ - $${TOP_BUILD_DIR}/lib/xmlcommon.lib +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/wsdl$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema$$DEBUG_SUFFIX.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon$$DEBUG_SUFFIX.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ -lkode \ -lwsdl \ From d0896e5ea2a0903b13204e06a5e3396d72eb3eaf Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 19 Apr 2019 17:45:01 +0200 Subject: [PATCH 070/679] Rework the #undef hack so they are under the includes --- kdwsdl2cpp/libkode/printer.cpp | 10 ++++++++++ kdwsdl2cpp/libkode/printer.h | 5 +++++ kdwsdl2cpp/src/creator.cpp | 1 + kdwsdl2cpp/src/creator.h | 9 +-------- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/kdwsdl2cpp/libkode/printer.cpp b/kdwsdl2cpp/libkode/printer.cpp index 86c1f8737..26ba76a86 100644 --- a/kdwsdl2cpp/libkode/printer.cpp +++ b/kdwsdl2cpp/libkode/printer.cpp @@ -59,6 +59,7 @@ class Printer::Private QString mGenerator; QString mOutputDirectory; QString mSourceFile; + QStringList mStatementsAfterIncludes; }; void Printer::Private::addLabel( Code& code, const QString& label ) @@ -648,6 +649,11 @@ QString Printer::licenseHeader( const File &file ) const return code.text(); } +void Printer::setStatementsAfterIncludes(const QStringList &statements) +{ + d->mStatementsAfterIncludes = statements; +} + static QStringList commonLeft(const QStringList& l1, const QStringList& l2) { QStringList r; const int l = qMin(l1.size(), l2.size()); @@ -708,6 +714,10 @@ void Printer::printHeader( const File &file ) if ( !processed.isEmpty() ) out.newLine(); + for ( const QString &statement : d->mStatementsAfterIncludes ) { + out += statement; + } + // Create enums Enum::List enums = file.fileEnums(); Enum::List::ConstIterator enumIt; diff --git a/kdwsdl2cpp/libkode/printer.h b/kdwsdl2cpp/libkode/printer.h index eef2acb7c..9064230f2 100644 --- a/kdwsdl2cpp/libkode/printer.h +++ b/kdwsdl2cpp/libkode/printer.h @@ -133,6 +133,11 @@ class KODE_EXPORT Printer const QString &className = QString(), bool forImplementation = false ); + /** + * For #undef hacks for instance + */ + void setStatementsAfterIncludes(const QStringList &statements); + protected: /** * Returns the creation warning. diff --git a/kdwsdl2cpp/src/creator.cpp b/kdwsdl2cpp/src/creator.cpp index 661a33165..cbd54bee3 100644 --- a/kdwsdl2cpp/src/creator.cpp +++ b/kdwsdl2cpp/src/creator.cpp @@ -34,6 +34,7 @@ Creator::Creator() // Set generated header details. _printer.setCreationWarning(true); _printer.setGenerator(QLatin1String("KDAB's kdwsdl2cpp")); + _printer.setStatementsAfterIncludes(QStringList() << "#undef daylight" << "#undef timezone"); // Qt-like coding style _printer.setLabelsDefineIndent(false); diff --git a/kdwsdl2cpp/src/creator.h b/kdwsdl2cpp/src/creator.h index 2cc999fe5..0f4a41474 100644 --- a/kdwsdl2cpp/src/creator.h +++ b/kdwsdl2cpp/src/creator.h @@ -45,14 +45,7 @@ class Creator private: KODE::File _file; - class CustomPrinter : public KODE::Printer - { - virtual QString licenseHeader(const KODE::File &file) const { - QString str = "#undef daylight\n#undef timezone\n"; // workaround macros from Windows headers - return str + KODE::Printer::licenseHeader(file); - } - }; - CustomPrinter _printer; + KODE::Printer _printer; }; } From 7af942063783f0b02d1d8be876e35678365fae8f Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 19 Apr 2019 12:16:57 -0400 Subject: [PATCH 071/679] another attempt at fixing debug linking on Windows --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 10 ++++------ kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 8 ++++---- unittests/unittests.pri | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) mode change 100644 => 100755 kdwsdl2cpp/src/kdwsdl2cpp.pro mode change 100644 => 100755 kdwsdl2cpp/src/kdwsdl2cpp_lib.pro mode change 100644 => 100755 unittests/unittests.pri diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro old mode 100644 new mode 100755 index 75f5b135b..9a560aff4 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -16,12 +16,10 @@ unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ $${TOP_BUILD_DIR}/lib/libxmlcommon.a \ $${TOP_BUILD_DIR}/lib/libkdwsdl2cpp_lib.a -win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/wsdl$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/xmlschema$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/xmlcommon$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/kdwsdl2cpp_lib$$DEBUG_SUFFIX.lib - +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ + $${TOP_BUILD_DIR}/lib/wsdl.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ -l$${KDWSDL2CPP_LIB} \ -lkode \ diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro old mode 100644 new mode 100755 index 79190711f..8218e3da3 --- a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -28,10 +28,10 @@ unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ $${TOP_BUILD_DIR}/lib/libwsdl.a \ $${TOP_BUILD_DIR}/lib/libxmlschema.a \ $${TOP_BUILD_DIR}/lib/libxmlcommon.a -win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/wsdl$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/xmlschema$$DEBUG_SUFFIX.lib \ - $${TOP_BUILD_DIR}/lib/xmlcommon$$DEBUG_SUFFIX.lib +win32-msvc*:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/kode.lib \ + $${TOP_BUILD_DIR}/lib/wsdl.lib \ + $${TOP_BUILD_DIR}/lib/xmlschema.lib \ + $${TOP_BUILD_DIR}/lib/xmlcommon.lib LIBS += -L$${TOP_BUILD_DIR}/lib \ -lkode \ -lwsdl \ diff --git a/unittests/unittests.pri b/unittests/unittests.pri old mode 100644 new mode 100755 index cde62d4d2..99f499987 --- a/unittests/unittests.pri +++ b/unittests/unittests.pri @@ -20,7 +20,7 @@ CONFIG(debug, debug|release):!unix: DEBUG_SUFFIX = d LIBS += -L$${TOP_BUILD_DIR}/lib -ltesttools$$DEBUG_SUFFIX unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libtesttools.a -KDWSDL2CPP_LIBS = -lkdwsdl2cpp_lib$$DEBUG_SUFFIX -lkode$$DEBUG_SUFFIX -lwsdl$$DEBUG_SUFFIX -lxmlschema$$DEBUG_SUFFIX -lxmlcommon$$DEBUG_SUFFIX +KDWSDL2CPP_LIBS = -lkdwsdl2cpp_lib$$DEBUG_SUFFIX -lkode -lwsdl -lxmlschema -lxmlcommon # qtest.h in 4.5 is not QT_NO_CAST_FROM_BYTEARRAY-clean contains( $$list($$[QT_VERSION]), 4.5.* ):DEFINES -= QT_NO_CAST_FROM_BYTEARRAY From 2beb5e64a4d11cf0fd120ec584fcbaf70e051b82 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 19 Apr 2019 21:34:31 +0200 Subject: [PATCH 072/679] Don't put QT_BEGIN_NAMESPACE around class Q1__Something. Great suggestion on github issue 89. --- doc/CHANGES_1_8.txt | 1 + kdwsdl2cpp/libkode/printer.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/CHANGES_1_8.txt b/doc/CHANGES_1_8.txt index a794904a6..f7b89c0b7 100644 --- a/doc/CHANGES_1_8.txt +++ b/doc/CHANGES_1_8.txt @@ -51,6 +51,7 @@ WSDL parser / code generator changes, applying to both client and server side: * Added "hasValueFor{MemberName}()" accessor function, for optional elements * Generated services now include soapVersion() and endpoint() accessors to match the setSoapVersion(...) and setEndpoint(...) mutators * Added support for generating messages for WSDL files without services or bindings +* Fix erroneous QT_BEGIN_NAMESPACE around forward-declarations like Q17__DialogType. * KDSoapValue now stores the namespace declarations during parsing of a message and writes namespace declarations during sending of a message * Avoid serialize crash with required polymorphic types, if the required variable wasn't actually provided diff --git a/kdwsdl2cpp/libkode/printer.cpp b/kdwsdl2cpp/libkode/printer.cpp index 26ba76a86..a18a52a31 100644 --- a/kdwsdl2cpp/libkode/printer.cpp +++ b/kdwsdl2cpp/libkode/printer.cpp @@ -757,7 +757,7 @@ void Printer::printHeader( const File &file ) } if (!clas.isNull()) { - const bool isQtClass = clas.startsWith(QLatin1Char('Q')); + const bool isQtClass = clas.startsWith(QLatin1Char('Q')) && !clas.contains(QLatin1Char('_')); if (isQtClass) out += QLatin1String("QT_BEGIN_NAMESPACE"); out += "class " + clas + ';'; From 21a17b74f361c3b4a79846739394b636f4ca34ad Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 6 May 2019 11:22:43 -0400 Subject: [PATCH 073/679] CMakeLists.txt, autogen.py, Doxyfile - set version to 1.7.99 1.8.0 pre-release --- CMakeLists.txt | 2 +- Doxyfile | 2 +- autogen.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24bb1f636..e2c222961 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ option(${PROJECT_NAME}_TESTS "Build the tests" OFF) set(${PROJECT_NAME}_VERSION_MAJOR 1) set(${PROJECT_NAME}_VERSION_MINOR 7) -set(${PROJECT_NAME}_VERSION_PATCH 50) +set(${PROJECT_NAME}_VERSION_PATCH 99) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/Doxyfile b/Doxyfile index 625187887..f39e176ea 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,5 +1,5 @@ PROJECT_NAME = "KD SOAP" -PROJECT_NUMBER = 1.7.50 +PROJECT_NUMBER = 1.7.99 OUTPUT_DIRECTORY = doc HTML_OUTPUT = refman INHERIT_DOCS = NO diff --git a/autogen.py b/autogen.py index 018d94663..848379734 100755 --- a/autogen.py +++ b/autogen.py @@ -2,7 +2,7 @@ from autogen.autogen import autogen project = "KDSoap" -version = "1.7.50" +version = "1.7.99" subprojects = ["KDSoapClient", "KDSoapServer"] prefixed = False From c844c89fecf705b86dd659235c1c4b7f6b5e9276 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 6 May 2019 12:20:39 -0400 Subject: [PATCH 074/679] KDSoapServer/KDSoapServerObjectInterface.h - fix -Wreorder --- src/KDSoapServer/KDSoapServerObjectInterface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KDSoapServer/KDSoapServerObjectInterface.h b/src/KDSoapServer/KDSoapServerObjectInterface.h index 218ac05f9..cf61173f9 100644 --- a/src/KDSoapServer/KDSoapServerObjectInterface.h +++ b/src/KDSoapServer/KDSoapServerObjectInterface.h @@ -133,8 +133,8 @@ class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface struct KDSOAPSERVER_EXPORT HttpResponseHeaderItem { HttpResponseHeaderItem(); HttpResponseHeaderItem(const QByteArray &name, const QByteArray &value); - QByteArray m_name; QByteArray m_value; + QByteArray m_name; }; typedef QVector HttpResponseHeaderItems; From 15ed61b84fe952f1f74b6262bd53afb4bae7f15f Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 6 May 2019 12:21:21 -0400 Subject: [PATCH 075/679] kdwsdl2cpp/src/elementargumentserializer.cpp - fix unused --- kdwsdl2cpp/src/elementargumentserializer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/elementargumentserializer.cpp b/kdwsdl2cpp/src/elementargumentserializer.cpp index dc9733f81..96c0cbecd 100644 --- a/kdwsdl2cpp/src/elementargumentserializer.cpp +++ b/kdwsdl2cpp/src/elementargumentserializer.cpp @@ -84,7 +84,7 @@ KODE::Code ElementArgumentSerializer::generate() const block += "}"; } else { const QName actualType = mType.isEmpty() ? mElementType : mType; - const QString typeArgs = namespaceString(actualType.nameSpace()) + QLatin1String(", QString::fromLatin1(\"") + actualType.localName() + QLatin1String("\")"); + //UNUSED const QString typeArgs = namespaceString(actualType.nameSpace()) + QLatin1String(", QString::fromLatin1(\"") + actualType.localName() + QLatin1String("\")"); const bool isComplex = mTypeMap.isComplexType(mType, mElementType); const bool isPolymorphic = mTypeMap.isPolymorphic(mType, mElementType); From d2d74e5c6f043cfdb2e62a8a29b45c4db8a9ff44 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 6 May 2019 12:45:55 -0400 Subject: [PATCH 076/679] CMakeLists.txt, autogen.py, Doxyfile - pre 1.9.0 version --- CMakeLists.txt | 4 ++-- Doxyfile | 2 +- autogen.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2c222961..8ced1052c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,8 @@ option(${PROJECT_NAME}_STATIC "Build statically" OFF) option(${PROJECT_NAME}_TESTS "Build the tests" OFF) set(${PROJECT_NAME}_VERSION_MAJOR 1) -set(${PROJECT_NAME}_VERSION_MINOR 7) -set(${PROJECT_NAME}_VERSION_PATCH 99) +set(${PROJECT_NAME}_VERSION_MINOR 8) +set(${PROJECT_NAME}_VERSION_PATCH 50) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/Doxyfile b/Doxyfile index f39e176ea..a36172835 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,5 +1,5 @@ PROJECT_NAME = "KD SOAP" -PROJECT_NUMBER = 1.7.99 +PROJECT_NUMBER = 1.8.50 OUTPUT_DIRECTORY = doc HTML_OUTPUT = refman INHERIT_DOCS = NO diff --git a/autogen.py b/autogen.py index 848379734..1dd483e93 100755 --- a/autogen.py +++ b/autogen.py @@ -2,7 +2,7 @@ from autogen.autogen import autogen project = "KDSoap" -version = "1.7.99" +version = "1.8.50" subprojects = ["KDSoapClient", "KDSoapServer"] prefixed = False From 90eae39574f154e1d97aeb1e634a55c7eb13540e Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 13 May 2019 14:40:36 +0200 Subject: [PATCH 077/679] Use more conventional qmake syntax --- kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro index 8218e3da3..ae475e843 100755 --- a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -21,7 +21,7 @@ QT += xml CONFIG += staticlib CONFIG += console -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] # Relink when a static lib changed unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ From b7182acd403c64d90f9e1cf307112f3d90b5a8e3 Mon Sep 17 00:00:00 2001 From: Vladislav Vikhlyaev Date: Mon, 13 May 2019 15:44:25 +0300 Subject: [PATCH 078/679] fix compilation error due to missing QSharedPointer include in generated code (#170) * add test with compiled error code generated * fix class name * include only QTest * include QSharedPointer in header --- kdwsdl2cpp/src/converter_complextype.cpp | 2 +- unittests/CMakeLists.txt | 2 + .../QSharedPointer_include/CMakeLists.txt | 5 ++ .../QSharedPointer_include.pro | 12 +++ .../test_qsharedpointer_include.cpp | 20 +++++ .../test_qsharedpointer_include_wsdl.wsdl | 89 +++++++++++++++++++ unittests/unittests.pro | 3 +- 7 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 unittests/QSharedPointer_include/CMakeLists.txt create mode 100644 unittests/QSharedPointer_include/QSharedPointer_include.pro create mode 100644 unittests/QSharedPointer_include/test_qsharedpointer_include.cpp create mode 100644 unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index b96d40281..c57d9fddc 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -286,7 +286,7 @@ void Converter::convertComplexType(const XSD::ComplexType *type) } } - newClass.addInclude("QSharedPointer"); + newClass.addHeaderInclude("QSharedPointer"); mClasses.addClass(newClass); } diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 75cdab29e..017d65915 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -94,3 +94,5 @@ add_subdirectory(empty_list_wsdl) add_subdirectory(list_restriction) add_subdirectory(kddatetime) + +add_subdirectory(QSharedPointer_include) diff --git a/unittests/QSharedPointer_include/CMakeLists.txt b/unittests/QSharedPointer_include/CMakeLists.txt new file mode 100644 index 000000000..f70826c2e --- /dev/null +++ b/unittests/QSharedPointer_include/CMakeLists.txt @@ -0,0 +1,5 @@ +set(QSharedPointer_include_SRCS test_qsharedpointer_include.cpp) + +set(WSDL_FILES test_qsharedpointer_include_wsdl.wsdl) + +add_unittest(${QSharedPointer_include_SRCS}) diff --git a/unittests/QSharedPointer_include/QSharedPointer_include.pro b/unittests/QSharedPointer_include/QSharedPointer_include.pro new file mode 100644 index 000000000..87304784d --- /dev/null +++ b/unittests/QSharedPointer_include/QSharedPointer_include.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = test_qsharedpointer_include.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = test_qsharedpointer_include_wsdl.wsdl + +OTHER_FILES = $$KDWSDL +LIBS += -L$${TOP_BUILD_DIR}/lib diff --git a/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp new file mode 100644 index 000000000..5cf39e399 --- /dev/null +++ b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp @@ -0,0 +1,20 @@ +#include "wsdl_test_qsharedpointer_include_wsdl.h" + +#include + +class RightInclude: + public QObject +{ +Q_OBJECT + +private Q_SLOTS: + + void testCompiled() + { + Hello_Service service; + } +}; + +QTEST_MAIN(RightInclude) + +#include "test_qsharedpointer_include.moc" diff --git a/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl b/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl new file mode 100644 index 000000000..8be17e626 --- /dev/null +++ b/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSDL File for HelloService + + + + + diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 64efe46aa..51da0af22 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -48,7 +48,8 @@ SUBDIRS = \ test_calc \ ws_addressing_support \ ws_usernametoken_support \ - list_restriction + list_restriction \ + QSharedPointer_include # These need internet access SUBDIRS += webcalls webcalls_wsdl From 91860628605e8fd15a6922e28dc0b1e6c3931c1f Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 13 May 2019 16:35:29 +0200 Subject: [PATCH 079/679] Fix qmake syntax for Qt 5.4.2 --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 2 +- unittests/unittests.pri | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro index 9a560aff4..c686896ca 100755 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -7,7 +7,7 @@ QT += xml CONFIG += console macx:CONFIG -= app_bundle -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] # Relink when a static lib changed unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ diff --git a/unittests/unittests.pri b/unittests/unittests.pri index 99f499987..15c36d5c2 100755 --- a/unittests/unittests.pri +++ b/unittests/unittests.pri @@ -8,7 +8,7 @@ QT += testlib QT += xml macx:CONFIG -= app_bundle -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] INCLUDEPATH += $${TOP_SOURCE_DIR}/testtools \ $${TOP_SOURCE_DIR}/kdwsdl2cpp/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/src/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/libkode/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/common/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/schema/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/wsdl/ From b3cb9accdf19e095ab5b06b231604273eff9ad01 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 13 May 2019 14:40:36 +0200 Subject: [PATCH 080/679] Use more conventional qmake syntax --- kdwsdl2cpp/src/kdwsdl2cpp_lib.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro index 8218e3da3..ae475e843 100755 --- a/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp_lib.pro @@ -21,7 +21,7 @@ QT += xml CONFIG += staticlib CONFIG += console -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] # Relink when a static lib changed unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ From 23f54f701455c87ea75b3641677fb844485e82b3 Mon Sep 17 00:00:00 2001 From: Vladislav Vikhlyaev Date: Mon, 13 May 2019 15:44:25 +0300 Subject: [PATCH 081/679] fix compilation error due to missing QSharedPointer include in generated code (#170) * add test with compiled error code generated * fix class name * include only QTest * include QSharedPointer in header --- kdwsdl2cpp/src/converter_complextype.cpp | 2 +- unittests/CMakeLists.txt | 2 + .../QSharedPointer_include/CMakeLists.txt | 5 ++ .../QSharedPointer_include.pro | 12 +++ .../test_qsharedpointer_include.cpp | 20 +++++ .../test_qsharedpointer_include_wsdl.wsdl | 89 +++++++++++++++++++ unittests/unittests.pro | 3 +- 7 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 unittests/QSharedPointer_include/CMakeLists.txt create mode 100644 unittests/QSharedPointer_include/QSharedPointer_include.pro create mode 100644 unittests/QSharedPointer_include/test_qsharedpointer_include.cpp create mode 100644 unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index b96d40281..c57d9fddc 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -286,7 +286,7 @@ void Converter::convertComplexType(const XSD::ComplexType *type) } } - newClass.addInclude("QSharedPointer"); + newClass.addHeaderInclude("QSharedPointer"); mClasses.addClass(newClass); } diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 75cdab29e..017d65915 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -94,3 +94,5 @@ add_subdirectory(empty_list_wsdl) add_subdirectory(list_restriction) add_subdirectory(kddatetime) + +add_subdirectory(QSharedPointer_include) diff --git a/unittests/QSharedPointer_include/CMakeLists.txt b/unittests/QSharedPointer_include/CMakeLists.txt new file mode 100644 index 000000000..f70826c2e --- /dev/null +++ b/unittests/QSharedPointer_include/CMakeLists.txt @@ -0,0 +1,5 @@ +set(QSharedPointer_include_SRCS test_qsharedpointer_include.cpp) + +set(WSDL_FILES test_qsharedpointer_include_wsdl.wsdl) + +add_unittest(${QSharedPointer_include_SRCS}) diff --git a/unittests/QSharedPointer_include/QSharedPointer_include.pro b/unittests/QSharedPointer_include/QSharedPointer_include.pro new file mode 100644 index 000000000..87304784d --- /dev/null +++ b/unittests/QSharedPointer_include/QSharedPointer_include.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = test_qsharedpointer_include.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = test_qsharedpointer_include_wsdl.wsdl + +OTHER_FILES = $$KDWSDL +LIBS += -L$${TOP_BUILD_DIR}/lib diff --git a/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp new file mode 100644 index 000000000..5cf39e399 --- /dev/null +++ b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp @@ -0,0 +1,20 @@ +#include "wsdl_test_qsharedpointer_include_wsdl.h" + +#include + +class RightInclude: + public QObject +{ +Q_OBJECT + +private Q_SLOTS: + + void testCompiled() + { + Hello_Service service; + } +}; + +QTEST_MAIN(RightInclude) + +#include "test_qsharedpointer_include.moc" diff --git a/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl b/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl new file mode 100644 index 000000000..8be17e626 --- /dev/null +++ b/unittests/QSharedPointer_include/test_qsharedpointer_include_wsdl.wsdl @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WSDL File for HelloService + + + + + diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 64efe46aa..51da0af22 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -48,7 +48,8 @@ SUBDIRS = \ test_calc \ ws_addressing_support \ ws_usernametoken_support \ - list_restriction + list_restriction \ + QSharedPointer_include # These need internet access SUBDIRS += webcalls webcalls_wsdl From 3692e5569a7f1815f305009e966d2a8eaa30189b Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 13 May 2019 16:35:29 +0200 Subject: [PATCH 082/679] Fix qmake syntax for Qt 5.4.2 --- kdwsdl2cpp/src/kdwsdl2cpp.pro | 2 +- unittests/unittests.pri | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kdwsdl2cpp/src/kdwsdl2cpp.pro b/kdwsdl2cpp/src/kdwsdl2cpp.pro index 9a560aff4..c686896ca 100755 --- a/kdwsdl2cpp/src/kdwsdl2cpp.pro +++ b/kdwsdl2cpp/src/kdwsdl2cpp.pro @@ -7,7 +7,7 @@ QT += xml CONFIG += console macx:CONFIG -= app_bundle -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] # Relink when a static lib changed unix:PRE_TARGETDEPS += $${TOP_BUILD_DIR}/lib/libkode.a \ diff --git a/unittests/unittests.pri b/unittests/unittests.pri index 99f499987..15c36d5c2 100755 --- a/unittests/unittests.pri +++ b/unittests/unittests.pri @@ -8,7 +8,7 @@ QT += testlib QT += xml macx:CONFIG -= app_bundle -static { macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] } +static:macx:QMAKE_LFLAGS += -Wl,-rpath,$$[QT_INSTALL_LIBS] INCLUDEPATH += $${TOP_SOURCE_DIR}/testtools \ $${TOP_SOURCE_DIR}/kdwsdl2cpp/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/src/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/libkode/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/common/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/schema/ $${TOP_SOURCE_DIR}/kdwsdl2cpp/wsdl/ From 495827621051a5d06106bc5aa3e000202b555797 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 14 May 2019 15:22:36 +0200 Subject: [PATCH 083/679] C++11 required --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 0a787ec57..b36252b07 100644 --- a/README.txt +++ b/README.txt @@ -13,7 +13,7 @@ For more information, see http://www.kdab.com/kdab-products/kd-soap Using KD Soap ============= -KD Soap requires Qt 4.7.0 or newer. +KD Soap requires Qt 4.7.0 or newer, and a compiler with C++11 support. See INSTALL.txt or INSTALL-cmake.txt for installation instructions. (Note that the qmake and CMake buildsystems are fully supported) From 77db57100edb269075f4da346b9c0b86a8242ec8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Tue, 14 May 2019 15:22:36 +0200 Subject: [PATCH 084/679] C++11 required --- README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 0a787ec57..b36252b07 100644 --- a/README.txt +++ b/README.txt @@ -13,7 +13,7 @@ For more information, see http://www.kdab.com/kdab-products/kd-soap Using KD Soap ============= -KD Soap requires Qt 4.7.0 or newer. +KD Soap requires Qt 4.7.0 or newer, and a compiler with C++11 support. See INSTALL.txt or INSTALL-cmake.txt for installation instructions. (Note that the qmake and CMake buildsystems are fully supported) From 06d529dc99db7640cf26f88d6372ebf85e5313fc Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 17 May 2019 08:09:27 -0400 Subject: [PATCH 085/679] add_license_blurb.sh - skip KDQName.* --- add_license_blurb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add_license_blurb.sh b/add_license_blurb.sh index e40f6380a..c58b8ca8b 100755 --- a/add_license_blurb.sh +++ b/add_license_blurb.sh @@ -27,7 +27,7 @@ AUTHORS() { fi } -find "$@" -name '*.h' -o -name '*.cpp' -o -name '*.qml' -o -name '*.js' | grep -v /3rdparty/ | grep -v /build | grep -v /examples | grep -v /doxygen\.cpp | grep -v /kdwsdl2cpp | while read FILE; do +find "$@" -name '*.h' -o -name '*.cpp' -o -name '*.qml' -o -name '*.js' | grep -v /KDQName\. | grep -v /3rdparty/ | grep -v /build | grep -v /examples | grep -v /doxygen\.cpp | grep -v /kdwsdl2cpp | while read FILE; do if grep -qiE "Copyright \(C\) [0-9, -]{4,} Klar.*lvdalens Datakonsult AB" "$FILE" ; then continue; fi thisfile=`basename $FILE` AUTHORS $FILE From b75e089e5daf72e65be5cf534a0bf1e7671948a4 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 17 May 2019 08:10:00 -0400 Subject: [PATCH 086/679] test_qsharedpointer_include.cpp - add license+copyright header --- .../test_qsharedpointer_include.cpp | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp index 5cf39e399..1c92827dd 100644 --- a/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp +++ b/unittests/QSharedPointer_include/test_qsharedpointer_include.cpp @@ -1,3 +1,25 @@ +/**************************************************************************** +** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + #include "wsdl_test_qsharedpointer_include_wsdl.h" #include From f9d0e83e5cfeb0d0d2187a9d91170c3934bdf169 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 17 May 2019 08:38:28 -0400 Subject: [PATCH 087/679] update OBS files --- CMakeLists.txt | 4 ++-- Doxyfile | 2 +- autogen.py | 2 +- kdsoap.dsc | 4 ++-- kdsoap.spec | 4 +++- qt5-kdsoap.dsc | 4 ++-- qt5-kdsoap.spec | 4 +++- 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2c222961..87fa18bed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,8 @@ option(${PROJECT_NAME}_STATIC "Build statically" OFF) option(${PROJECT_NAME}_TESTS "Build the tests" OFF) set(${PROJECT_NAME}_VERSION_MAJOR 1) -set(${PROJECT_NAME}_VERSION_MINOR 7) -set(${PROJECT_NAME}_VERSION_PATCH 99) +set(${PROJECT_NAME}_VERSION_MINOR 8) +set(${PROJECT_NAME}_VERSION_PATCH 0) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) diff --git a/Doxyfile b/Doxyfile index f39e176ea..e9f594679 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,5 +1,5 @@ PROJECT_NAME = "KD SOAP" -PROJECT_NUMBER = 1.7.99 +PROJECT_NUMBER = 1.8.0 OUTPUT_DIRECTORY = doc HTML_OUTPUT = refman INHERIT_DOCS = NO diff --git a/autogen.py b/autogen.py index 848379734..56e98e7e9 100755 --- a/autogen.py +++ b/autogen.py @@ -2,7 +2,7 @@ from autogen.autogen import autogen project = "KDSoap" -version = "1.7.99" +version = "1.8.0" subprojects = ["KDSoapClient", "KDSoapServer"] prefixed = False diff --git a/kdsoap.dsc b/kdsoap.dsc index 75fb176f1..54618647e 100644 --- a/kdsoap.dsc +++ b/kdsoap.dsc @@ -1,10 +1,10 @@ Format: 1.0 Source: kdsoap -Version: 1.7.0 +Version: 1.8.0 Binary: kdsoap Maintainer: Allen Winter Architecture: any Build-Depends: debhelper (>=9), cdbs, cmake, libqt4-dev Files: - 00000000000000000000000000000000 00000 kdsoap-1.7.0.tar.gz + 00000000000000000000000000000000 00000 kdsoap-1.8.0.tar.gz diff --git a/kdsoap.spec b/kdsoap.spec index 43f4071a1..0db288b07 100644 --- a/kdsoap.spec +++ b/kdsoap.spec @@ -1,5 +1,5 @@ Name: kdsoap -Version: 1.7.0 +Version: 1.8.0 Release: 1 Summary: A Qt-based client-side and server-side SOAP component Source: %{name}-%{version}.tar.gz @@ -80,6 +80,8 @@ QMAKE_ARGS="LIB_SUFFIX=64" ./configure.sh -shared -release -prefix %{buildroot}/ %{_libdir}/libkdsoap-server.so %changelog +* Fri May 17 2019 Allen Winter 1.8.0 + 1.8.0 * Mon Mar 01 2018 Allen Winter 1.7.0 1.7.0 * Mon May 01 2017 Allen Winter 1.6.0 diff --git a/qt5-kdsoap.dsc b/qt5-kdsoap.dsc index b77a05ee3..1791263b5 100644 --- a/qt5-kdsoap.dsc +++ b/qt5-kdsoap.dsc @@ -1,10 +1,10 @@ Format: 1.0 Source: kdsoap -Version: 1.7.0 +Version: 1.8.0 Binary: kdsoap Maintainer: Allen Winter Architecture: any Build-Depends: debhelper (>=9), cdbs, cmake, qt5-default, qtbase5-dev Files: - 00000000000000000000000000000000 00000 qt5-kdsoap-1.7.0.tar.gz + 00000000000000000000000000000000 00000 qt5-kdsoap-1.8.0.tar.gz diff --git a/qt5-kdsoap.spec b/qt5-kdsoap.spec index 485ed78b3..ba38194f0 100644 --- a/qt5-kdsoap.spec +++ b/qt5-kdsoap.spec @@ -1,5 +1,5 @@ Name: qt5-kdsoap -Version: 1.7.0 +Version: 1.8.0 Release: 1 Summary: A Qt5-based client-side and server-side SOAP component Source: %{name}-%{version}.tar.gz @@ -79,6 +79,8 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_RPATH=True -DCMAKE_BUILD_TYPE=R %{_libdir}/libkdsoap-server.so %changelog +* Fri May 17 2019 Allen Winter 1.8.0 + 1.8.0 * Mon Mar 01 2018 Allen Winter 1.7.0 1.7.0 * Mon May 01 2017 Allen Winter 1.6.0 From 7585cce5cb516f64ae89a962c3856fb456bd50f2 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 17 May 2019 08:42:50 -0400 Subject: [PATCH 088/679] debian.changelog - update for 1.8.0 release --- debian.changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian.changelog b/debian.changelog index 98c242000..2e018a5c9 100644 --- a/debian.changelog +++ b/debian.changelog @@ -1,3 +1,9 @@ +kdsoap (1.8.0) final; urgency=low + + * 1.8.0 final release + + -- Allen Winter Fri, 17 May 2019 08:00:00 -0500 + kdsoap (1.7.0) final; urgency=low * 1.7.0 final release From 92e3dc86fbebc4e7cdfc1a655b3b813a08302895 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 18 Jul 2019 17:43:03 +0200 Subject: [PATCH 089/679] Add c++11 override indicator to library code --- .../helloworld_server/helloworld_server.h | 2 +- examples/helloworld_server/main.cpp | 2 +- kdwsdl2cpp/schema/complextype.h | 2 +- kdwsdl2cpp/wsdl/soapbinding.h | 26 ++++++------ src/KDSoapClient/KDSoapClientThread_p.h | 2 +- src/KDSoapServer/KDSoapServer.h | 4 +- src/KDSoapServer/KDSoapServerThread_p.h | 2 +- testtools/httpserver_p.cpp | 4 +- testtools/httpserver_p.h | 2 +- unittests/ihc_wsdl/test_ihc.cpp | 40 +++++++++---------- unittests/prefix_wsdl/test_prefix.cpp | 26 ++++++------ unittests/servertest/servertest.cpp | 20 +++++----- unittests/tech3356_wsdl/test_tech3356.cpp | 12 +++--- .../wsdl_document/test_wsdl_document.cpp | 30 +++++++------- .../wsdl_rpc-server/test_wsdl_rpc_server.cpp | 32 +++++++-------- 15 files changed, 103 insertions(+), 103 deletions(-) diff --git a/examples/helloworld_server/helloworld_server.h b/examples/helloworld_server/helloworld_server.h index 91193e70d..434f73179 100644 --- a/examples/helloworld_server/helloworld_server.h +++ b/examples/helloworld_server/helloworld_server.h @@ -12,7 +12,7 @@ class ServerObject : public Hello_ServiceServerBase ServerObject(); ~ServerObject(); - QString sayHello(const QString& msg); + QString sayHello(const QString& msg) override; }; #endif // HELLOWORLD_SERVER_H diff --git a/examples/helloworld_server/main.cpp b/examples/helloworld_server/main.cpp index 38312861a..80b728a31 100644 --- a/examples/helloworld_server/main.cpp +++ b/examples/helloworld_server/main.cpp @@ -24,7 +24,7 @@ QString ServerObject::sayHello(const QString& msg) class Server : public KDSoapServer { public: - QObject* createServerObject() { + QObject* createServerObject() override { return new ServerObject; } }; diff --git a/kdwsdl2cpp/schema/complextype.h b/kdwsdl2cpp/schema/complextype.h index 783e1da87..1309a6245 100644 --- a/kdwsdl2cpp/schema/complextype.h +++ b/kdwsdl2cpp/schema/complextype.h @@ -58,7 +58,7 @@ class SCHEMA_EXPORT ComplexType : public XSDType void setDocumentation(const QString &documentation); QString documentation() const; - bool isSimple() const; + bool isSimple() const override; // True if this is the base class for other (derived) complex types bool isPolymorphicBaseClass() const; diff --git a/kdwsdl2cpp/wsdl/soapbinding.h b/kdwsdl2cpp/wsdl/soapbinding.h index 5bd0c3f88..5566ec6f4 100644 --- a/kdwsdl2cpp/wsdl/soapbinding.h +++ b/kdwsdl2cpp/wsdl/soapbinding.h @@ -296,19 +296,19 @@ class KWSDL_EXPORT SoapBinding : public AbstractBinding void setBinding(const Binding &binding); Binding binding() const; - void parseBinding(ParserContext *context, const QDomElement &parent); - void parseOperation(ParserContext *context, const QString &name, const QDomElement &parent); - void parseOperationInput(ParserContext *context, const QString &name, const QDomElement &parent); - void parseOperationOutput(ParserContext *context, const QString &name, const QDomElement &parent); - void parseOperationFault(ParserContext *context, const QString &name, const QDomElement &parent); - void parsePort(ParserContext *context, const QDomElement &parent); - - void synthesizeBinding(ParserContext *context, QDomDocument &document, QDomElement &parent) const; - void synthesizeOperation(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const; - void synthesizeOperationInput(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const; - void synthesizeOperationOutput(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const; - void synthesizeOperationFault(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const; - void synthesizePort(ParserContext *context, QDomDocument &document, QDomElement &parent) const; + void parseBinding(ParserContext *context, const QDomElement &parent) override; + void parseOperation(ParserContext *context, const QString &name, const QDomElement &parent) override; + void parseOperationInput(ParserContext *context, const QString &name, const QDomElement &parent) override; + void parseOperationOutput(ParserContext *context, const QString &name, const QDomElement &parent) override; + void parseOperationFault(ParserContext *context, const QString &name, const QDomElement &parent) override; + void parsePort(ParserContext *context, const QDomElement &parent) override; + + void synthesizeBinding(ParserContext *context, QDomDocument &document, QDomElement &parent) const override; + void synthesizeOperation(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const override; + void synthesizeOperationInput(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const override; + void synthesizeOperationOutput(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const override; + void synthesizeOperationFault(ParserContext *context, const QString &name, QDomDocument &document, QDomElement &parent) const override; + void synthesizePort(ParserContext *context, QDomDocument &document, QDomElement &parent) const override; private: Binding mBinding; diff --git a/src/KDSoapClient/KDSoapClientThread_p.h b/src/KDSoapClient/KDSoapClientThread_p.h index e34a14150..a99a7b451 100644 --- a/src/KDSoapClient/KDSoapClientThread_p.h +++ b/src/KDSoapClient/KDSoapClientThread_p.h @@ -100,7 +100,7 @@ class KDSoapClientThread : public QThread void stop(); protected: - virtual void run(); + virtual void run() override; private: QMutex m_mutex; diff --git a/src/KDSoapServer/KDSoapServer.h b/src/KDSoapServer/KDSoapServer.h index 090c65bdd..73cd35914 100644 --- a/src/KDSoapServer/KDSoapServer.h +++ b/src/KDSoapServer/KDSoapServer.h @@ -275,9 +275,9 @@ public Q_SLOTS: protected: #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - /*! \reimp \internal */ void incomingConnection(qintptr socketDescriptor); + /*! \reimp \internal */ void incomingConnection(qintptr socketDescriptor) override; #else - /*! \reimp \internal */ void incomingConnection(int socketDescriptor); + /*! \reimp \internal */ void incomingConnection(int socketDescriptor) override; #endif private: diff --git a/src/KDSoapServer/KDSoapServerThread_p.h b/src/KDSoapServer/KDSoapServerThread_p.h index fc99aee16..52cd6bd00 100644 --- a/src/KDSoapServer/KDSoapServerThread_p.h +++ b/src/KDSoapServer/KDSoapServerThread_p.h @@ -77,7 +77,7 @@ class KDSoapServerThread : public QThread void handleIncomingConnection(int socketDescriptor, KDSoapServer *server); protected: - virtual void run(); + virtual void run() override; private: void start(); // use startThread instead diff --git a/testtools/httpserver_p.cpp b/testtools/httpserver_p.cpp index c86d7ab77..415532a34 100644 --- a/testtools/httpserver_p.cpp +++ b/testtools/httpserver_p.cpp @@ -225,9 +225,9 @@ class BlockingHttpServer : public QTcpServer } #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - virtual void incomingConnection(qintptr socketDescriptor) + virtual void incomingConnection(qintptr socketDescriptor) override #else - virtual void incomingConnection(int socketDescriptor) + virtual void incomingConnection(int socketDescriptor) override #endif { #ifndef QT_NO_OPENSSL diff --git a/testtools/httpserver_p.h b/testtools/httpserver_p.h index b36f4f36a..b06eed558 100644 --- a/testtools/httpserver_p.h +++ b/testtools/httpserver_p.h @@ -119,7 +119,7 @@ class HttpServerThread : public QThread } protected: - /* \reimp */ void run(); + /* \reimp */ void run() override; private: diff --git a/unittests/ihc_wsdl/test_ihc.cpp b/unittests/ihc_wsdl/test_ihc.cpp index 0bb8a18b4..8d90fbf18 100644 --- a/unittests/ihc_wsdl/test_ihc.cpp +++ b/unittests/ihc_wsdl/test_ihc.cpp @@ -38,19 +38,19 @@ class IHCServerObject : public ResourceInteractionServiceServiceServerBase { public: - virtual TNS__WSResourceValueEnvelope getRuntimeValue(int) + virtual TNS__WSResourceValueEnvelope getRuntimeValue(int) override { return TNS__WSResourceValueEnvelope(); } - virtual TNS__ArrayOfWSResourceValueEnvelope getRuntimeValues(const XSD__ArrayOfint &) + virtual TNS__ArrayOfWSResourceValueEnvelope getRuntimeValues(const XSD__ArrayOfint &) override { return TNS__ArrayOfWSResourceValueEnvelope(); } - virtual TNS__ArrayOfWSResourceValueEnvelope getInitialValues(const XSD__ArrayOfint &) + virtual TNS__ArrayOfWSResourceValueEnvelope getInitialValues(const XSD__ArrayOfint &) override { return TNS__ArrayOfWSResourceValueEnvelope(); } - virtual bool setResourceValue(const TNS__WSResourceValueEnvelope ¶meter4) + virtual bool setResourceValue(const TNS__WSResourceValueEnvelope ¶meter4) override { Q_ASSERT(parameter4.typeString() == "enum"); #ifdef __clang__ @@ -86,63 +86,63 @@ class IHCServerObject : public ResourceInteractionServiceServiceServerBase return (parameter4.typeString() == "enum" && inputValue->enumValueID() == 42); */ } - virtual bool setResourceValues(const TNS__ArrayOfWSResourceValueEnvelope &) + virtual bool setResourceValues(const TNS__ArrayOfWSResourceValueEnvelope &) override { return false; } - virtual TNS__ArrayOfWSResourceValueEnvelope enableRuntimeValueNotifications(const XSD__ArrayOfint &) + virtual TNS__ArrayOfWSResourceValueEnvelope enableRuntimeValueNotifications(const XSD__ArrayOfint &) override { return TNS__ArrayOfWSResourceValueEnvelope(); } - virtual bool disableRuntimeValueNotifactions(const XSD__ArrayOfint &) + virtual bool disableRuntimeValueNotifactions(const XSD__ArrayOfint &) override { return false; } - virtual TNS__ArrayOfWSResourceValueEnvelope enableInitialValueNotifications(const XSD__ArrayOfint &) + virtual TNS__ArrayOfWSResourceValueEnvelope enableInitialValueNotifications(const XSD__ArrayOfint &) override { return TNS__ArrayOfWSResourceValueEnvelope(); } - virtual bool disableInitialValueNotifactions(const XSD__ArrayOfint &) + virtual bool disableInitialValueNotifactions(const XSD__ArrayOfint &) override { return false; } - virtual TNS__ArrayOfWSResourceValueEnvelope waitForResourceValueChanges(int) + virtual TNS__ArrayOfWSResourceValueEnvelope waitForResourceValueChanges(int) override { return TNS__ArrayOfWSResourceValueEnvelope(); } - virtual TNS__ArrayOfWSSceneResourceIdAndLocationURLs getSceneGroupResourceIdAndPositions(int) + virtual TNS__ArrayOfWSSceneResourceIdAndLocationURLs getSceneGroupResourceIdAndPositions(int) override { return TNS__ArrayOfWSSceneResourceIdAndLocationURLs(); } - virtual TNS__WSSceneResourceIdAndLocationURLs getScenePositionsForSceneValueResource(int) + virtual TNS__WSSceneResourceIdAndLocationURLs getScenePositionsForSceneValueResource(int) override { return TNS__WSSceneResourceIdAndLocationURLs(); } - virtual WPNS1__ArrayOfWSEnumDefinition getEnumeratorDefinitions() + virtual WPNS1__ArrayOfWSEnumDefinition getEnumeratorDefinitions() override { return WPNS1__ArrayOfWSEnumDefinition(); } - virtual QString getResourceType(int) + virtual QString getResourceType(int) override { return QString(); } - virtual TNS__ArrayOfWSDatalineResource getExtraDatalineInputs() + virtual TNS__ArrayOfWSDatalineResource getExtraDatalineInputs() override { return TNS__ArrayOfWSDatalineResource(); } - virtual TNS__ArrayOfWSDatalineResource getExtraDatalineOutputs() + virtual TNS__ArrayOfWSDatalineResource getExtraDatalineOutputs() override { return TNS__ArrayOfWSDatalineResource(); } - virtual TNS__ArrayOfWSDatalineResource getAllDatalineInputs() + virtual TNS__ArrayOfWSDatalineResource getAllDatalineInputs() override { return TNS__ArrayOfWSDatalineResource(); } - virtual TNS__ArrayOfWSDatalineResource getAllDatalineOutputs() + virtual TNS__ArrayOfWSDatalineResource getAllDatalineOutputs() override { return TNS__ArrayOfWSDatalineResource(); } - virtual TNS__WSResourceValueEnvelope getInitialValue(int) + virtual TNS__WSResourceValueEnvelope getInitialValue(int) override { return TNS__WSResourceValueEnvelope(); } @@ -155,7 +155,7 @@ class IHCServer : public KDSoapServer IHCServer() : KDSoapServer(), m_lastServerObject(0) { } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new IHCServerObject; return m_lastServerObject; diff --git a/unittests/prefix_wsdl/test_prefix.cpp b/unittests/prefix_wsdl/test_prefix.cpp index 95b1bd99f..5dd1b19cb 100644 --- a/unittests/prefix_wsdl/test_prefix.cpp +++ b/unittests/prefix_wsdl/test_prefix.cpp @@ -39,12 +39,12 @@ class GuestServerObject : public GuestServerBase /* generated from wsdl */ { Q_OBJECT public: - virtual TNS__AddPersonResponse addPerson(const TNS__AddPersonRequest ¶meters) + virtual TNS__AddPersonResponse addPerson(const TNS__AddPersonRequest ¶meters) override { Q_UNUSED(parameters); return TNS__AddPersonResponse(); } - virtual TNS__AuthenticateResponse authenticate(const TNS__AuthenticateRequest ¶meters) + virtual TNS__AuthenticateResponse authenticate(const TNS__AuthenticateRequest ¶meters) override { if (parameters.serijskiBrojSertifikata() == "cert") { TNS__AuthenticateResponse response; @@ -56,52 +56,52 @@ class GuestServerObject : public GuestServerBase /* generated from wsdl */ } return TNS__AuthenticateResponse(); } - virtual TNS__SearchPersonResponse searchPerson(const TNS__SearchPersonRequest ¶meters) + virtual TNS__SearchPersonResponse searchPerson(const TNS__SearchPersonRequest ¶meters) override { Q_UNUSED(parameters); return TNS__SearchPersonResponse(); } - virtual TNS__EditPersonResponse editPerson(const TNS__EditPersonRequest ¶meters) + virtual TNS__EditPersonResponse editPerson(const TNS__EditPersonRequest ¶meters) override { Q_UNUSED(parameters); return TNS__EditPersonResponse(); } - virtual TNS__CityListResponse cityList(const TNS__CityListRequest ¶meters) + virtual TNS__CityListResponse cityList(const TNS__CityListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__CityListResponse(); } - virtual TNS__PlaceListResponse placeList(const TNS__PlaceListRequest ¶meters) + virtual TNS__PlaceListResponse placeList(const TNS__PlaceListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__PlaceListResponse(); } - virtual TNS__DocumentListResponse documentList(const TNS__DocumentListRequest ¶meters) + virtual TNS__DocumentListResponse documentList(const TNS__DocumentListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__DocumentListResponse(); } - virtual TNS__GuestTypeListResponse guestTypeList(const TNS__GuestTypeListRequest ¶meters) + virtual TNS__GuestTypeListResponse guestTypeList(const TNS__GuestTypeListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__GuestTypeListResponse(); } - virtual TNS__CountrytListResponse countrytList(const TNS__CountrytListRequest ¶meters) + virtual TNS__CountrytListResponse countrytList(const TNS__CountrytListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__CountrytListResponse(); } - virtual TNS__BuildingListResponse buildingList(const TNS__BuildingListRequest ¶meters) + virtual TNS__BuildingListResponse buildingList(const TNS__BuildingListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__BuildingListResponse(); } - virtual TNS__EntranceListResponse entranceList(const TNS__EntranceListRequest ¶meters) + virtual TNS__EntranceListResponse entranceList(const TNS__EntranceListRequest ¶meters) override { Q_UNUSED(parameters); return TNS__EntranceListResponse(); } - virtual TNS__ServiceResponse service(const TNS__ServiceRequest ¶meters) + virtual TNS__ServiceResponse service(const TNS__ServiceRequest ¶meters) override { Q_UNUSED(parameters); return TNS__ServiceResponse(); @@ -116,7 +116,7 @@ class GuestServer : public KDSoapServer { setPath(QLatin1String("/xml")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new GuestServerObject; return m_lastServerObject; diff --git a/unittests/servertest/servertest.cpp b/unittests/servertest/servertest.cpp index 5df9f83be..6d92afda9 100644 --- a/unittests/servertest/servertest.cpp +++ b/unittests/servertest/servertest.cpp @@ -98,9 +98,9 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, s_serverObjects.remove(QThread::currentThread()); } - virtual void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction); + virtual void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction) override; - virtual QIODevice *processFileRequest(const QString &path, QByteArray &contentType) + virtual QIODevice *processFileRequest(const QString &path, QByteArray &contentType) override { if (path == QLatin1String("/path/to/file_download.txt")) { QFile *file = new QFile(QLatin1String("file_download.txt")); // local file, created by the unittest @@ -110,7 +110,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, return 0; } - virtual bool validateAuthentication(const KDSoapAuthentication &auth, const QString &path) + virtual bool validateAuthentication(const KDSoapAuthentication &auth, const QString &path) override { if (!m_requireAuth) { return true; @@ -123,7 +123,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, } // KDSoapServerRawXMLInterface interface - bool newRequest(const QByteArray &requestType, const QMap &httpHeaders) + bool newRequest(const QByteArray &requestType, const QMap &httpHeaders) override { if (m_useRawXML && requestType == "POST") { if (!httpHeaders.contains("content-type") @@ -137,7 +137,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, } return false; } - void processXML(const QByteArray &xmlChunk) + void processXML(const QByteArray &xmlChunk) override { if (!m_useRawXML) { // should never happen Q_ASSERT(m_useRawXML); @@ -145,7 +145,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, } m_assembledXML += xmlChunk; } - void endRequest() + void endRequest() override { if (m_assembledXML != rawCountryMessage(s_longEmployeeName)) { qWarning() << "Expected" << rawCountryMessage(s_longEmployeeName) << "\nGot" << m_assembledXML; @@ -161,7 +161,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, // KDSoapServerCustomVerbRequestInterface virtual bool processCustomVerbRequest(const QByteArray &requestType, const QByteArray &requestData, - const QMap &httpHeaders, QByteArray &customAnswer) + const QMap &httpHeaders, QByteArray &customAnswer) override { Q_UNUSED(requestData); Q_UNUSED(httpHeaders); @@ -177,7 +177,7 @@ class CountryServerObject : public QObject, public KDSoapServerObjectInterface, return false; } - virtual HttpResponseHeaderItems additionalHttpResponseHeaderItems() const + virtual HttpResponseHeaderItems additionalHttpResponseHeaderItems() const override { static KDSoapServerObjectInterface::HttpResponseHeaderItems result = KDSoapServerObjectInterface::HttpResponseHeaderItems() << KDSoapServerObjectInterface::HttpResponseHeaderItem("Access-Control-Allow-Origin", "*") @@ -246,7 +246,7 @@ class CountryServer : public KDSoapServer public: CountryServer() : KDSoapServer(), m_requireAuth(false), m_useRawXML(false) {} - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { return new CountryServerObject(m_requireAuth, m_useRawXML); } @@ -321,7 +321,7 @@ class CountryServerThread : public QThread } protected: - void run() + void run() override { CountryServer server; if (m_threadPool) { diff --git a/unittests/tech3356_wsdl/test_tech3356.cpp b/unittests/tech3356_wsdl/test_tech3356.cpp index 8e5e78c0b..8a06c9721 100644 --- a/unittests/tech3356_wsdl/test_tech3356.cpp +++ b/unittests/tech3356_wsdl/test_tech3356.cpp @@ -39,7 +39,7 @@ class TransformMediaBindingServerObject : public TransformMediaBindingServerBase { Q_OBJECT public: - virtual TFMS__TransformResponseType transform(const TFMS__TransformRequestType &in) + virtual TFMS__TransformResponseType transform(const TFMS__TransformRequestType &in) override { TFMS__TransformJobType copyJob = in.transformJob(); Q_ASSERT(copyJob.operationName() == "operation"); @@ -61,7 +61,7 @@ class TransformMediaBindingServer : public KDSoapServer { setPath(QLatin1String("/xml")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new TransformMediaBindingServerObject; return m_lastServerObject; @@ -81,7 +81,7 @@ class TransformMediaStatusBindingServerObject : public TransformMediaStatusBindi { Q_OBJECT public: - virtual BMS__ManageJobResponseType manageJob(const BMS__ManageJobRequestType &in) + virtual BMS__ManageJobResponseType manageJob(const BMS__ManageJobRequestType &in) override { // check what was sent Q_UNUSED(in); @@ -98,13 +98,13 @@ class TransformMediaStatusBindingServerObject : public TransformMediaStatusBindi Q_ASSERT(response.job().status().type() == BMS__JobStatusType::Running); return response; } - virtual BMS__ManageQueueResponseType manageQueue(const BMS__ManageQueueRequestType &in) + virtual BMS__ManageQueueResponseType manageQueue(const BMS__ManageQueueRequestType &in) override { Q_UNUSED(in); BMS__ManageQueueResponseType qrt; return qrt; } - virtual BMS__QueryJobResponseType queryJob(const BMS__QueryJobRequestType &in) + virtual BMS__QueryJobResponseType queryJob(const BMS__QueryJobRequestType &in) override { Q_UNUSED(in); BMS__QueryJobResponseType jrt; @@ -120,7 +120,7 @@ class TransformMediaStatusBindingServer : public KDSoapServer { setPath(QLatin1String("/xml")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new TransformMediaStatusBindingServerObject; return m_lastServerObject; diff --git a/unittests/wsdl_document/test_wsdl_document.cpp b/unittests/wsdl_document/test_wsdl_document.cpp index d5c5e924d..c18b801f6 100644 --- a/unittests/wsdl_document/test_wsdl_document.cpp +++ b/unittests/wsdl_document/test_wsdl_document.cpp @@ -761,13 +761,13 @@ class NameServiceServerObject : public NamesServiceServiceServerBase /* generate { Q_OBJECT public: - virtual TNS__GetCountriesResponse getCountries(const TNS__GetCountries &) + virtual TNS__GetCountriesResponse getCountries(const TNS__GetCountries &) override { TNS__GetCountriesResponse response; response.setCountry(QStringList() << QLatin1String("Great Britain") << QLatin1String("Ireland")); return response; } - TNS__GetNamesInCountryResponse getNamesInCountry(const TNS__GetNamesInCountry ¶meters) + TNS__GetNamesInCountryResponse getNamesInCountry(const TNS__GetNamesInCountry ¶meters) override { TNS__GetNamesInCountryResponse response; if (parameters.country() == QLatin1String("Ireland")) { @@ -777,7 +777,7 @@ class NameServiceServerObject : public NamesServiceServiceServerBase /* generate } void getNameInfoResponse(const KDSoapDelayedResponseHandle &responseHandle, const TNS__GetNameInfoResponse &ret); - virtual TNS__GetNameInfoResponse getNameInfo(const TNS__GetNameInfo ¶meters) + virtual TNS__GetNameInfoResponse getNameInfo(const TNS__GetNameInfo ¶meters) override { setFault(QLatin1String("Server.Implementation"), QLatin1String("Not implemented"), QLatin1String(metaObject()->className()), parameters.name()); return TNS__GetNameInfoResponse(); @@ -788,7 +788,7 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl { Q_OBJECT public: - QByteArray addEmployee(const KDAB__AddEmployee ¶meters) + QByteArray addEmployee(const KDAB__AddEmployee ¶meters) override { //qDebug() << "addEmployee called"; const QString name = KDAB__LimitedString(parameters.employeeName()).value(); @@ -810,7 +810,7 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl return "added " + name.toLatin1(); } - QByteArray delayedAddEmployee(const KDAB__AddEmployee ¶meters) + QByteArray delayedAddEmployee(const KDAB__AddEmployee ¶meters) override { //qDebug() << "delayedAddEmployee called"; Q_UNUSED(parameters); @@ -822,23 +822,23 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl return "THIS VALUE IS IGNORED"; } - void listEmployees() + void listEmployees() override { m_lastMethodCalled = QLatin1String("listEmployees"); } - void heart_beat() + void heart_beat() override { m_lastMethodCalled = QLatin1String("heartbeat"); } - KDAB__AnyTypeResponse testAnyType(const KDAB__AnyType ¶meters) + KDAB__AnyTypeResponse testAnyType(const KDAB__AnyType ¶meters) override { KDAB__AnyTypeResponse response; response.setReturn(QList() << parameters.input()); return response; } - KDAB__EmployeeCountryResponse getEmployeeCountry(const KDAB__EmployeeNameParams &employeeNameParams) + KDAB__EmployeeCountryResponse getEmployeeCountry(const KDAB__EmployeeNameParams &employeeNameParams) override { KDAB__EmployeeCountryResponse resp; if (QString(employeeNameParams.employeeName().value()) == QLatin1String("David")) { @@ -849,7 +849,7 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl return resp; } - KDAB__EmployeeType getEmployeeType(const KDAB__EmployeeNameParams &employeeNameParams) + KDAB__EmployeeType getEmployeeType(const KDAB__EmployeeNameParams &employeeNameParams) override { KDAB__EmployeeType type; type.setWeakType(QVariant(42)); // anySimpleType was mapped to QVariant @@ -859,12 +859,12 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl return type; } - KDAB__TelegramType sendRawTelegram(const KDAB__TelegramType &telegram) + KDAB__TelegramType sendRawTelegram(const KDAB__TelegramType &telegram) override { return QByteArray("Got ") + telegram; } - KDAB__TelegramResponse sendTelegram(const KDAB__TelegramRequest ¶meters) + KDAB__TelegramResponse sendTelegram(const KDAB__TelegramRequest ¶meters) override { KDAB__TelegramResponse resp; resp.setTelegramHex(QByteArray("Received ") + parameters.telegramHex()); @@ -873,7 +873,7 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl } // Normally you don't reimplement this. This is just to store req and resp for the unittest. - void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction) + void processRequest(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction) override { m_request = request; MyWsdlDocumentServerBase::processRequest(request, response, soapAction); @@ -881,7 +881,7 @@ class DocServerObject : public MyWsdlDocumentServerBase /* generated from mywsdl //qDebug() << "processRequest: done. " << this << "Response name=" << response.name(); } - void processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path) + void processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path) override { Q_UNUSED(request); Q_UNUSED(response); @@ -919,7 +919,7 @@ class DocServer : public KDSoapServer { setPath(QLatin1String("/xml")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new DocServerObject; return m_lastServerObject; diff --git a/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp b/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp index 8174d5ce0..b8eeb88da 100644 --- a/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp +++ b/unittests/wsdl_rpc-server/test_wsdl_rpc_server.cpp @@ -44,7 +44,7 @@ using namespace KDSoapUnitTestHelpers; class HelloServerObject : public Hello_ServiceServerBase { public: - virtual QString sayHello(const QString &firstName, const QString &lastName) + virtual QString sayHello(const QString &firstName, const QString &lastName) override { m_receivedFirstName = firstName; m_receivedLastName = lastName; @@ -71,7 +71,7 @@ class HelloServer : public KDSoapServer { setPath(QLatin1String("/hello")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new HelloServerObject; return m_lastServerObject; @@ -90,7 +90,7 @@ class RpcExampleServerObject : public RpcExampleServerBase RpcExampleServerObject() : m_heartbeatCalled(false) {} - virtual RPCEXAMPLE__ListKeysResult listKeys(const RPCEXAMPLE__ListKeysParams ¶ms) + virtual RPCEXAMPLE__ListKeysResult listKeys(const RPCEXAMPLE__ListKeysParams ¶ms) override { Q_UNUSED(params) RPCEXAMPLE__ListKeysResult result; @@ -98,71 +98,71 @@ class RpcExampleServerObject : public RpcExampleServerBase return result; } - virtual bool pullFile(const RPCEXAMPLE__PullFileParams ¶ms) + virtual bool pullFile(const RPCEXAMPLE__PullFileParams ¶ms) override { Q_UNUSED(params) return false; } - virtual bool putFile(const RPCEXAMPLE__PutFileParams ¶ms) + virtual bool putFile(const RPCEXAMPLE__PutFileParams ¶ms) override { Q_UNUSED(params) return false; } - virtual QString getFile(const RPCEXAMPLE__GetFileParams ¶ms) + virtual QString getFile(const RPCEXAMPLE__GetFileParams ¶ms) override { Q_UNUSED(params) return QString(); } - virtual RPCEXAMPLE__ExecFileResult execFile(const RPCEXAMPLE__ExecFileParams ¶ms) + virtual RPCEXAMPLE__ExecFileResult execFile(const RPCEXAMPLE__ExecFileParams ¶ms) override { Q_UNUSED(params) return RPCEXAMPLE__ExecFileResult(); } - virtual RPCEXAMPLE__ListFilesResult listFiles() + virtual RPCEXAMPLE__ListFilesResult listFiles() override { return RPCEXAMPLE__ListFilesResult(); } - virtual bool setKey(const RPCEXAMPLE__SetKeyParams ¶ms) + virtual bool setKey(const RPCEXAMPLE__SetKeyParams ¶ms) override { Q_UNUSED(params) return false; } - virtual QString getKey(const RPCEXAMPLE__GetKeyParams ¶ms) + virtual QString getKey(const RPCEXAMPLE__GetKeyParams ¶ms) override { Q_UNUSED(params) return QString(); } - virtual bool clearKey(const RPCEXAMPLE__ClearKeyParams ¶ms) + virtual bool clearKey(const RPCEXAMPLE__ClearKeyParams ¶ms) override { Q_UNUSED(params) return false; } - virtual QString execAction(const RPCEXAMPLE__ExecActionParams ¶ms) + virtual QString execAction(const RPCEXAMPLE__ExecActionParams ¶ms) override { Q_UNUSED(params) return QString(); } - virtual void heartbeat(const RPCEXAMPLE__HeartbeatParams ¶ms) + virtual void heartbeat(const RPCEXAMPLE__HeartbeatParams ¶ms) override { Q_UNUSED(params); m_heartbeatCalled = true; } - virtual void legacyHeartbeat(const RPCEXAMPLE__LegacyHeartbeatParams ¶ms) + virtual void legacyHeartbeat(const RPCEXAMPLE__LegacyHeartbeatParams ¶ms) override { Q_UNUSED(params) } - virtual void message(const RPCEXAMPLE__MessageParams ¶ms) + virtual void message(const RPCEXAMPLE__MessageParams ¶ms) override { Q_UNUSED(params) } @@ -182,7 +182,7 @@ class RpcExampleServer : public KDSoapServer { setPath(QLatin1String("/rpcexample")); } - virtual QObject *createServerObject() + virtual QObject *createServerObject() override { m_lastServerObject = new RpcExampleServerObject; return m_lastServerObject; From 18e43c672b5b34ebb4d122f80f6d546675316458 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 18 Jul 2019 17:07:18 +0200 Subject: [PATCH 090/679] Add c++11 override indicator to generated code --- doc/CHANGES_1_9.txt | 12 ++++++++++++ kdwsdl2cpp/libkode/function.h | 2 +- kdwsdl2cpp/libkode/printer.cpp | 4 ++++ kdwsdl2cpp/src/converter_clientstub.cpp | 1 + kdwsdl2cpp/src/converter_complextype.cpp | 24 +++++++++++++++++++++--- kdwsdl2cpp/src/converter_serverstub.cpp | 1 + 6 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 doc/CHANGES_1_9.txt diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt new file mode 100644 index 000000000..848a9b50b --- /dev/null +++ b/doc/CHANGES_1_9.txt @@ -0,0 +1,12 @@ +General: +======== + +Client-side: +============ + +Server-side: +============ + +WSDL parser / code generator changes, applying to both client and server side: +================================================================ +* Add override indicator to generated files. This requires c++11 for users of generated files. diff --git a/kdwsdl2cpp/libkode/function.h b/kdwsdl2cpp/libkode/function.h index 6cd078331..a887ec5e0 100644 --- a/kdwsdl2cpp/libkode/function.h +++ b/kdwsdl2cpp/libkode/function.h @@ -137,7 +137,7 @@ class KODE_EXPORT Function */ bool isStatic() const; - enum VirtualMode { NotVirtual, Virtual, PureVirtual }; + enum VirtualMode { NotVirtual, Virtual, PureVirtual, Override }; /** * Sets whether the function is marked as virtual or pure virtual. */ diff --git a/kdwsdl2cpp/libkode/printer.cpp b/kdwsdl2cpp/libkode/printer.cpp index a18a52a31..7d208b739 100644 --- a/kdwsdl2cpp/libkode/printer.cpp +++ b/kdwsdl2cpp/libkode/printer.cpp @@ -600,6 +600,10 @@ QString Printer::functionSignature( const Function &function, if ( function.isConst() ) s += " const"; + + if ( function.virtualMode() == Function::Override && !forImplementation ) { + s += " override"; + } if ( function.virtualMode() == Function::PureVirtual ) s += " = 0"; diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index 54cf93655..8fffa947f 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -413,6 +413,7 @@ bool Converter::convertClientService() } KODE::Function doStart(QLatin1String("doStart"), QLatin1String("void"), KODE::Function::Protected); + doStart.setVirtualMode(KODE::Function::Override); KODE::Code doStartCode; const bool hasAction = clientAddAction(doStartCode, binding, operationName); clientGenerateMessage(doStartCode, binding, message, operation, /*use members=*/true); diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index c57d9fddc..394eeaa81 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -264,7 +264,11 @@ void Converter::convertComplexType(const XSD::ComplexType *type) KODE::Function clone("_kd_clone"); clone.setConst(true); clone.setReturnType(pbc + QLatin1String(" *")); - clone.setVirtualMode(KODE::Function::Virtual); + if (newClass.baseClasses().isEmpty()) { + clone.setVirtualMode(KODE::Function::Virtual); + } else { + clone.setVirtualMode(KODE::Function::Override); + } clone.setBody(QLatin1String("return new ") + newClassName + QLatin1String("(*this);")); newClass.addFunction(clone); @@ -273,14 +277,22 @@ void Converter::convertComplexType(const XSD::ComplexType *type) KODE::Function substGetter("_kd_substitutionElementName"); substGetter.setConst(true); substGetter.setReturnType(QLatin1String("QString")); - substGetter.setVirtualMode(KODE::Function::Virtual); + if (newClass.baseClasses().isEmpty()) { + substGetter.setVirtualMode(KODE::Function::Virtual); + } else { + substGetter.setVirtualMode(KODE::Function::Override); + } substGetter.setBody(QString::fromLatin1("return QString::fromLatin1(\"%1\");").arg(substElementName.localName())); newClass.addFunction(substGetter); KODE::Function substNSGetter("_kd_substitutionElementNameSpace"); substNSGetter.setConst(true); substNSGetter.setReturnType(QLatin1String("QString")); - substNSGetter.setVirtualMode(KODE::Function::Virtual); + if (newClass.baseClasses().isEmpty()) { + substNSGetter.setVirtualMode(KODE::Function::Virtual); + } else { + substNSGetter.setVirtualMode(KODE::Function::Override); + } substNSGetter.setBody(QString::fromLatin1("return QString::fromLatin1(\"%1\");").arg(substElementName.nameSpace())); newClass.addFunction(substNSGetter); } @@ -556,6 +568,9 @@ void Converter::createComplexTypeSerializer(KODE::Class &newClass, const XSD::Co if (!type->derivedTypes().isEmpty()) { serializeFunc.setVirtualMode(KODE::Function::Virtual); } + if (!newClass.baseClasses().isEmpty()) { + serializeFunc.setVirtualMode(KODE::Function::Override); + } serializeFunc.setConst(true); KODE::Function deserializeFunc(QLatin1String("deserialize"), QLatin1String("void")); @@ -563,6 +578,9 @@ void Converter::createComplexTypeSerializer(KODE::Class &newClass, const XSD::Co if (!type->derivedTypes().isEmpty()) { deserializeFunc.setVirtualMode(KODE::Function::Virtual); } + if (!newClass.baseClasses().isEmpty()) { + deserializeFunc.setVirtualMode(KODE::Function::Override); + } KODE::Code marshalCode, demarshalCode; diff --git a/kdwsdl2cpp/src/converter_serverstub.cpp b/kdwsdl2cpp/src/converter_serverstub.cpp index 29f793359..b6abaeea0 100644 --- a/kdwsdl2cpp/src/converter_serverstub.cpp +++ b/kdwsdl2cpp/src/converter_serverstub.cpp @@ -45,6 +45,7 @@ void Converter::convertServerService() processRequestMethod.addArgument("const KDSoapMessage &_request"); processRequestMethod.addArgument("KDSoapMessage &_response"); processRequestMethod.addArgument("const QByteArray& _soapAction"); + processRequestMethod.setVirtualMode(KODE::Function::Override); KODE::Code body; const QString responseNs = mWSDL.definitions().targetNamespace(); From 86d01dc3547b1b0a9c1f5b1292535e48263bddf0 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 18 Jul 2019 17:43:23 +0200 Subject: [PATCH 091/679] Enable suggest-override warnings --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ced1052c..affc979a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,6 +93,10 @@ if(MSVC) add_definitions(-D_SCL_SECURE_NO_WARNINGS) endif() +if (NOT MSVC) + add_compile_options(-Wsuggest-override) +endif() + if(${PROJECT_NAME}_STATIC) set(${PROJECT_NAME}_LIBRARY_MODE "STATIC") else() From ccc64397f508c93971c71fb06a86db671b6b9882 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 19 Jul 2019 14:19:04 +0200 Subject: [PATCH 092/679] Add workaround for qt4 moc bug. Symptom: "Parse error at defined" (always on line 52, whichever file...) --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index affc979a9..ec4201866 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,9 @@ if(Qt5Core_FOUND) else() find_package(Qt4 4.7 QUIET REQUIRED QtCore QtMain) + + # Workaround qt4 moc bug, see https://bugzilla.redhat.com/show_bug.cgi?id=1396755 + add_definitions(-D_SYS_SYSMACROS_H_OUTER) endif() set(CMAKE_INCLUDE_CURRENT_DIR TRUE) From fa57ad6ef107511e6f2be9b841d8e45672136750 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 19 Jul 2019 14:19:33 +0200 Subject: [PATCH 093/679] Port from qSort to std::sort --- kdwsdl2cpp/libkode/class.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kdwsdl2cpp/libkode/class.cpp b/kdwsdl2cpp/libkode/class.cpp index 588b19871..ef00ffa3f 100644 --- a/kdwsdl2cpp/libkode/class.cpp +++ b/kdwsdl2cpp/libkode/class.cpp @@ -394,7 +394,7 @@ static bool classLessThan(const Class& c1, const Class& c2) static Class::List sortByDependenciesHelper( const Class::List &classes, const QStringList& excludedClasses ) { Class::List allClasses( classes ); - qSort(allClasses.begin(), allClasses.end(), classLessThan); // make result deterministic + std::sort(allClasses.begin(), allClasses.end(), classLessThan); // make result deterministic QStringList allClassNames; Q_FOREACH( const Class& c, allClasses ) @@ -454,7 +454,7 @@ void ClassList::sortByDependencies( const QStringList& excludedClasses ) void ClassList::sortAlphabetically() { - qSort(begin(), end(), classLessThan); + std::sort(begin(), end(), classLessThan); } ClassList::const_iterator ClassList::findClass(const QString &qualifiedName) const From 5371072f6cb5f9e7575ff213b9ab8d98ecd30e2b Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Mon, 12 Aug 2019 11:42:58 +0200 Subject: [PATCH 094/679] addressing: Add namespace selection (#176) This adds the option to select the namespace used when sending WS-Addressing messages. This is needed because the WS-Discovery spec explicitly mentions the WS-Addressing 2004-08 namespace and some devices will only respond to messages using that specific namespace. --- doc/CHANGES_1_9.txt | 1 + .../KDSoapMessageAddressingProperties.cpp | 69 +++++++++++++------ .../KDSoapMessageAddressingProperties.h | 40 ++++++++++- src/KDSoapClient/KDSoapMessageWriter.cpp | 2 +- src/KDSoapClient/KDSoapNamespacePrefixes.cpp | 6 +- src/KDSoapClient/KDSoapNamespacePrefixes_p.h | 5 +- .../wsaddressingtest.cpp | 53 ++++++++++++-- 7 files changed, 144 insertions(+), 32 deletions(-) diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt index 848a9b50b..3804d53af 100644 --- a/doc/CHANGES_1_9.txt +++ b/doc/CHANGES_1_9.txt @@ -3,6 +3,7 @@ General: Client-side: ============ +* Add support for selecting WS-Addressing namespace for send messages Server-side: ============ diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp index 637b3db7c..cad3d68eb 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp @@ -43,6 +43,7 @@ class KDSoapMessageAddressingPropertiesData : public QSharedData QVector relationships; // Indicates relationships to prior messages, could be included to facilitate longer running message exchanges. KDSoapValueList referenceParameters; // Equivalent of the reference parameters object from the endpoint reference within WSDL file KDSoapValueList metadata; // Holding metadata information + KDSoapMessageAddressingProperties::KDSoapAddressingNamespace addressingNamespace = KDSoapMessageAddressingProperties::Addressing200508; }; KDSoapMessageAddressingProperties::KDSoapMessageAddressingProperties() @@ -200,21 +201,32 @@ void KDSoapMessageAddressingProperties::addMetadata(const KDSoapValue &metadata) } } +KDSoapMessageAddressingProperties::KDSoapAddressingNamespace KDSoapMessageAddressingProperties::addressingNamespace() const +{ + return d->addressingNamespace; +} + +void KDSoapMessageAddressingProperties::setAddressingNamespace(KDSoapMessageAddressingProperties::KDSoapAddressingNamespace addressingNamespace) +{ + d->addressingNamespace = addressingNamespace; +} + KDSoapMessageAddressingProperties::~KDSoapMessageAddressingProperties() { } -QString KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::KDSoapAddressingPredefinedAddress address) +QString KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::KDSoapAddressingPredefinedAddress address, KDSoapAddressingNamespace addressingNamespace) { + const QString addressingNS = addressingNamespaceToString(addressingNamespace); switch (address) { case Anonymous: - return QLatin1String("http://www.w3.org/2005/08/addressing/anonymous"); + return addressingNS + QLatin1String("/anonymous"); case None: - return QLatin1String("http://www.w3.org/2005/08/addressing/none"); + return addressingNS + QLatin1String("/none"); case Reply: - return QLatin1String("http://www.w3.org/2005/08/addressing/reply"); + return addressingNS + QLatin1String("/reply"); case Unspecified: - return QLatin1String("http://www.w3.org/2005/08/addressing/unspecified"); + return addressingNS + QLatin1String("/unspecified"); default: Q_ASSERT(false); // should never happen return QString(); @@ -229,9 +241,26 @@ bool KDSoapMessageAddressingProperties::isWSAddressingNamespace(const QString &n namespaceUri == KDSoapNamespaceManager::soapMessageAddressing200408(); } -static void writeAddressField(QXmlStreamWriter &writer, const QString &address) +QString KDSoapMessageAddressingProperties::addressingNamespaceToString(KDSoapAddressingNamespace addressingNamespace) { - writer.writeStartElement(KDSoapNamespaceManager::soapMessageAddressing(), QLatin1String("Address")); + switch (addressingNamespace) { + case Addressing200303: + return KDSoapNamespaceManager::soapMessageAddressing200303(); + case Addressing200403: + return KDSoapNamespaceManager::soapMessageAddressing200403(); + case Addressing200408: + return KDSoapNamespaceManager::soapMessageAddressing200408(); + case Addressing200508: + return KDSoapNamespaceManager::soapMessageAddressing(); + default: + Q_ASSERT(false); // should never happen + return QString(); + } +} + +static void writeAddressField(QXmlStreamWriter &writer, const QString &addressingNS, const QString &address) +{ + writer.writeStartElement(addressingNS, QLatin1String("Address")); writer.writeCharacters(address); writer.writeEndElement(); } @@ -246,10 +275,8 @@ static void writeKDSoapValueVariant(QXmlStreamWriter &writer, const KDSoapValue "value because it could not be converted into a QString"); } -static void writeKDSoapValueListHierarchy(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const KDSoapValueList &values) +static void writeKDSoapValueListHierarchy(KDSoapNamespacePrefixes &namespacePrefixes, QXmlStreamWriter &writer, const QString &addressingNS, const KDSoapValueList &values) { - const QString addressingNS = KDSoapNamespaceManager::soapMessageAddressing(); - Q_FOREACH (const KDSoapValue &value, values) { const QString topLevelName = value.name(); writer.writeStartElement(addressingNS, topLevelName); @@ -257,7 +284,7 @@ static void writeKDSoapValueListHierarchy(KDSoapNamespacePrefixes &namespacePref if (value.childValues().isEmpty()) { writeKDSoapValueVariant(writer, value); } else { - writeKDSoapValueListHierarchy(namespacePrefixes, writer, value.childValues()); + writeKDSoapValueListHierarchy(namespacePrefixes, writer, addressingNS, value.childValues()); } writer.writeEndElement(); @@ -269,7 +296,7 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN Q_UNUSED(messageNamespace); Q_UNUSED(forceQualified); - if (d->destination == predefinedAddressToString(None)) { + if (d->destination == predefinedAddressToString(None, d->addressingNamespace)) { return; } @@ -277,8 +304,8 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN return; } - const QString addressingNS = KDSoapNamespaceManager::soapMessageAddressing(); - + const QString addressingNS = addressingNamespaceToString(d->addressingNamespace); + if (!d->destination.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("To")); writer.writeCharacters(d->destination); @@ -287,19 +314,19 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN if (!d->sourceEndpoint.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("From")); - writeAddressField(writer, d->sourceEndpoint.address()); + writeAddressField(writer, addressingNS, d->sourceEndpoint.address()); writer.writeEndElement(); } if (!d->replyEndpoint.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("ReplyTo")); - writeAddressField(writer, d->replyEndpoint.address()); + writeAddressField(writer, addressingNS, d->replyEndpoint.address()); writer.writeEndElement(); } if (!d->faultEndpoint.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("FaultTo")); - writeAddressField(writer, d->faultEndpoint.address()); + writeAddressField(writer, addressingNS, d->faultEndpoint.address()); writer.writeEndElement(); } @@ -332,19 +359,21 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN if (!d->referenceParameters.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("ReferenceParameters")); - writeKDSoapValueListHierarchy(namespacePrefixes, writer, d->referenceParameters); + writeKDSoapValueListHierarchy(namespacePrefixes, writer, addressingNS, d->referenceParameters); writer.writeEndElement(); } if (!d->metadata.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("Metadata")); - writeKDSoapValueListHierarchy(namespacePrefixes, writer, d->metadata); + writeKDSoapValueListHierarchy(namespacePrefixes, writer, addressingNS, d->metadata); writer.writeEndElement(); } } void KDSoapMessageAddressingProperties::readMessageAddressingProperty(const KDSoapValue &value) { + const QString addressingNS = addressingNamespaceToString(d->addressingNamespace); + if (value.name() == QLatin1String("Action")) { d->action = value.value().toString(); } else if (value.name() == QLatin1String("MessageID")) { @@ -358,7 +387,7 @@ void KDSoapMessageAddressingProperties::readMessageAddressingProperty(const KDSo } else if (value.name() == QLatin1String("RelatesTo")) { KDSoapMessageRelationship::Relationship relationship; relationship.uri = (value.value().toString()); - relationship.relationshipType = QLatin1String("http://www.w3.org/2005/08/addressing/reply"); + relationship.relationshipType = addressingNS + QLatin1String("/reply"); foreach (KDSoapValue attr, value.childValues().attributes()) { if (attr.name() == QLatin1String("RelationshipType")) { relationship.relationshipType = attr.value().toString(); diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.h b/src/KDSoapClient/KDSoapMessageAddressingProperties.h index e4fdfda18..585e71769 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.h +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.h @@ -56,7 +56,8 @@ struct Relationship { * Relationship constructor * @param URI is supposed to represent a message ID of a previous message you want to make reference to * @param type represents the nature of the relation between messages, if none is provided, the following - * predefined address will be used http://www.w3.org/2005/08/addressing/reply + * predefined address will be used wsa:Reply (which is dependent on the selected namespace, for example + * http://www.w3.org/2005/08/addressing/reply) */ Relationship(const QString &URI, const QString &type = QString()) : uri(URI), relationshipType(type) {} @@ -96,6 +97,19 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties Reply, Unspecified }; + + /** + * This enum contains all the namespaces that can be used to send out WS-Addressing messages. + * This allows the application to select the WS-Addressing revision to be used. + * \since 1.9 + * \see setAddressingNamespace + */ + enum KDSoapAddressingNamespace { + Addressing200303, + Addressing200403, + Addressing200408, + Addressing200508 + }; /** * Constructs an empty KDSoapMessageAddressingProperties object. @@ -265,16 +279,36 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties * Add one metadata, if not null, to the list of metadata that will appear within soap header */ void addMetadata(const KDSoapValue &metadata); + + /** + * Returns the selected WS-Addressing namespace + * \since 1.9 + */ + KDSoapAddressingNamespace addressingNamespace() const; /** - * Helper function that takes the \p address enum to provide the QString equivalent + * Sets the WS-Addressing namespace to be used for sending out messages.This allows the + * application to select the WS-Addressing revision to be used. + * \since 1.9 + * \see KDSoapAddressingNamespace */ - static QString predefinedAddressToString(KDSoapAddressingPredefinedAddress address); + void setAddressingNamespace(KDSoapAddressingNamespace addressingNamespace); + + /** + * Helper function that takes the \p address enum and \p addressingNamespace to provide the QString equivalent + */ + static QString predefinedAddressToString(KDSoapAddressingPredefinedAddress address, KDSoapAddressingNamespace addressingNamespace = Addressing200508); /** * Helper function that compares \p namespaceUri with the known WS-Addressing namespaces */ static bool isWSAddressingNamespace(const QString& namespaceUri); + + /** + * Helper function that takes the \p addressingNamespace enum to provide the QString equivalent + * \since 1.9 + */ + static QString addressingNamespaceToString(KDSoapAddressingNamespace addressingNamespace); private: /** diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 45bb2d46a..14361f2c6 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -52,7 +52,7 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const writer.writeStartDocument(); KDSoapNamespacePrefixes namespacePrefixes; - namespacePrefixes.writeStandardNamespaces(writer, m_version, message.hasMessageAddressingProperties()); + namespacePrefixes.writeStandardNamespaces(writer, m_version, message.hasMessageAddressingProperties(), message.messageAddressingProperties().addressingNamespace()); QString soapEnvelope; QString soapEncoding; diff --git a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp index 2e0b78ee7..ed6805e14 100644 --- a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp +++ b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp @@ -26,7 +26,8 @@ void KDSoapNamespacePrefixes::writeStandardNamespaces(QXmlStreamWriter &writer, KDSoap::SoapVersion version, - bool messageAddressingEnabled) + bool messageAddressingEnabled, + KDSoapMessageAddressingProperties::KDSoapAddressingNamespace messageAddressingNamespace) { if (version == KDSoap::SOAP1_1) { writeNamespace(writer, KDSoapNamespaceManager::soapEnvelope(), QLatin1String("soap")); @@ -40,7 +41,8 @@ void KDSoapNamespacePrefixes::writeStandardNamespaces(QXmlStreamWriter &writer, writeNamespace(writer, KDSoapNamespaceManager::xmlSchemaInstance2001(), QLatin1String("xsi")); if (messageAddressingEnabled) { - writeNamespace(writer, KDSoapNamespaceManager::soapMessageAddressing(), QLatin1String("wsa")); + const QString addressingNS = KDSoapMessageAddressingProperties::addressingNamespaceToString(messageAddressingNamespace); + writeNamespace(writer, addressingNS, QLatin1String("wsa")); } // Also insert known variants diff --git a/src/KDSoapClient/KDSoapNamespacePrefixes_p.h b/src/KDSoapClient/KDSoapNamespacePrefixes_p.h index e2ece3002..0d3949f27 100644 --- a/src/KDSoapClient/KDSoapNamespacePrefixes_p.h +++ b/src/KDSoapClient/KDSoapNamespacePrefixes_p.h @@ -27,13 +27,16 @@ #include #include "KDSoapClientInterface.h" +#include "KDSoapMessageAddressingProperties.h" class KDSoapNamespacePrefixes : public QMap { public: void writeStandardNamespaces(QXmlStreamWriter &writer, KDSoap::SoapVersion version = KDSoap::SOAP1_1, - bool messageAddressingEnabled = false); + bool messageAddressingEnabled = false, + KDSoapMessageAddressingProperties::KDSoapAddressingNamespace messageAddressingNamespace = KDSoapMessageAddressingProperties::Addressing200508 + ); void writeNamespace(QXmlStreamWriter &writer, const QString &ns, const QString &prefix) { diff --git a/unittests/ws_addressing_support/wsaddressingtest.cpp b/unittests/ws_addressing_support/wsaddressingtest.cpp index ad12c9f8d..315a4212c 100644 --- a/unittests/ws_addressing_support/wsaddressingtest.cpp +++ b/unittests/ws_addressing_support/wsaddressingtest.cpp @@ -53,6 +53,9 @@ private Q_SLOTS: QString unspecified = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Unspecified); QCOMPARE(unspecified, QString("http://www.w3.org/2005/08/addressing/unspecified")); + + QString none200303 = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::None, KDSoapMessageAddressingProperties::Addressing200303); + QCOMPARE(none200303, QString("http://schemas.xmlsoap.org/ws/2003/03/addressing/none")); } void shouldWriteAProperSoapMessageWithRightsAddressingProperties() @@ -72,13 +75,33 @@ private Q_SLOTS: KDSoapMessage reply = client.call(QLatin1String("sayHello"), message, action); // THEN - QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage())); + QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage200508())); + } + + void shouldWriteAProperSoapMessageWithAlternativeNamespace() + { + // GIVEN + HttpServerThread server(emptyResponse(), HttpServerThread::Public); + KDSoapClientInterface client(server.endPoint(), "http://www.ecerami.com/wsdl/HelloService"); + + KDSoapMessage message; + const QString action = QString::fromLatin1("sayHello"); + message.setUse(KDSoapMessage::EncodedUse); + message.addArgument(QString::fromLatin1("msg"), QVariant::fromValue(QString("HelloContentMessage")), KDSoapNamespaceManager::xmlSchema2001(), QString::fromLatin1("string")); + message.setNamespaceUri(QString::fromLatin1("http://www.ecerami.com/wsdl/HelloService.wsdl")); + + // WHEN + message.setMessageAddressingProperties(addressingProperties200408()); + KDSoapMessage reply = client.call(QLatin1String("sayHello"), message, action); + + // THEN + QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage200408())); } void shouldReadAProperSoapMessageWithRightsAddressingProperties() { // GIVEN - HttpServerThread server(expectedSoapMessage(), HttpServerThread::Public); + HttpServerThread server(expectedSoapMessage200508(), HttpServerThread::Public); KDSoapClientInterface client(server.endPoint(), "http://www.ecerami.com/wsdl/HelloService"); KDSoapMessage message; @@ -159,11 +182,31 @@ private Q_SLOTS: return map; } + + static KDSoapMessageAddressingProperties addressingProperties200408() + { + KDSoapMessageAddressingProperties map = addressingProperties(); + map.setAddressingNamespace(KDSoapMessageAddressingProperties::Addressing200408); + return map; + } + + static QByteArray expectedSoapMessage200408() + { + return QByteArray(xmlEnvBegin11()) + + " xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"" + + expectedSoapMessagePartial(); + } + + static QByteArray expectedSoapMessage200508() + { + return QByteArray(xmlEnvBegin11()) + + " xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"" + + expectedSoapMessagePartial(); + } - static QByteArray expectedSoapMessage() + static QByteArray expectedSoapMessagePartial() { - return QByteArray(xmlEnvBegin11()) + " xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"" - + " xmlns:n1=\"http://www.ecerami.com/wsdl/HelloService.wsdl\">" + return QByteArray(" xmlns:n1=\"http://www.ecerami.com/wsdl/HelloService.wsdl\">") + "" "http://www.ecerami.com/wsdl/HelloService" "" From f4c12495a16609ad6a64b3c09e4cb19c603e8e72 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 14 Aug 2019 10:31:14 +0200 Subject: [PATCH 095/679] Remove all special handling of soap/encoding namespace, import it and parse it This fixes wsdl:arrayType="soapenc:string[]" because soapenc:string wasn't a known type. It generates an arguably ugly SOAPENC__String wrapper class, but that's what the xsd defines, so it's logical. Fixes github issue #179 --- doc/CHANGES_1_9.txt | 1 + kdwsdl2cpp/schema/parser.cpp | 47 +-- kdwsdl2cpp/src/converter_complextype.cpp | 5 - kdwsdl2cpp/wsdl/soapbinding.cpp | 1 - unittests/CMakeLists.txt | 1 + unittests/pki.pca.dfn.de/CMakeLists.txt | 3 + unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro | 12 + unittests/pki.pca.dfn.de/pki.pca.dfn.de.wsdl | 306 +++++++++++++++++++ unittests/pki.pca.dfn.de/test_pki.cpp | 28 ++ unittests/unittests.pro | 1 + 10 files changed, 358 insertions(+), 47 deletions(-) create mode 100644 unittests/pki.pca.dfn.de/CMakeLists.txt create mode 100644 unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro create mode 100644 unittests/pki.pca.dfn.de/pki.pca.dfn.de.wsdl create mode 100644 unittests/pki.pca.dfn.de/test_pki.cpp diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt index 3804d53af..b954b1290 100644 --- a/doc/CHANGES_1_9.txt +++ b/doc/CHANGES_1_9.txt @@ -11,3 +11,4 @@ Server-side: WSDL parser / code generator changes, applying to both client and server side: ================================================================ * Add override indicator to generated files. This requires c++11 for users of generated files. +* Remove all special handling of soap/encoding namespace, which fixes the use of soapenc:string and soapenc:integer for instance (#179). diff --git a/kdwsdl2cpp/schema/parser.cpp b/kdwsdl2cpp/schema/parser.cpp index adb32d835..1eb1254d7 100644 --- a/kdwsdl2cpp/schema/parser.cpp +++ b/kdwsdl2cpp/schema/parser.cpp @@ -136,38 +136,6 @@ void Parser::init(ParserContext *context) langAttr.setType(QName(XMLSchemaURI, QLatin1String("string"))); d->mAttributes.append(langAttr); } - - // From http://schemas.xmlsoap.org/wsdl/soap/encoding - { - ComplexType array(soapEncNs); - array.setArrayType(QName(XMLSchemaURI, QString::fromLatin1("any"))); - array.setName(QLatin1String("Array")); - d->mComplexTypes.append(array); - } - - // From http://schemas.xmlsoap.org/soap/encoding/, so that - // can be resolved. - { - Attribute arrayTypeAttr(soapEncNs); - arrayTypeAttr.setName(QLatin1String("arrayType")); - arrayTypeAttr.setType(QName(XMLSchemaURI, QLatin1String("string"))); - d->mAttributes.append(arrayTypeAttr); - } - - // Same thing, but for SOAP-1.2: from http://www.w3.org/2003/05/soap-encoding - { - ComplexType array(soap12EncNs); - array.setArrayType(QName(XMLSchemaURI, QString::fromLatin1("any"))); - array.setName(QLatin1String("Array")); - d->mComplexTypes.append(array); - } - { - Attribute arrayTypeAttr(soap12EncNs); - arrayTypeAttr.setName(QLatin1String("arrayType")); - arrayTypeAttr.setType(QName(XMLSchemaURI, QLatin1String("string"))); - d->mAttributes.append(arrayTypeAttr); - } - d->mImportedSchemas.append(NSManager::soapEncNamespaces()); } bool Parser::parseSchemaTag(ParserContext *context, const QDomElement &root) @@ -800,10 +768,6 @@ void Parser::parseComplexContent(ParserContext *context, const QDomElement &elem typeName = childElement.attribute(QLatin1String("base")); typeName.setNameSpace(context->namespaceManager()->uri(typeName.prefix())); - if (typeName != QName(XMLSchemaURI, QString::fromLatin1("anyType"))) { // ignore this - complexType.setBaseTypeName(typeName); - } - // if the base soapenc:Array, then read the arrayType attribute, and possibly the desired name for the child elements // TODO check namespace is really soap-encoding if (typeName.localName() == QLatin1String("Array")) { @@ -860,6 +824,11 @@ void Parser::parseComplexContent(ParserContext *context, const QDomElement &elem } } else { + + if (typeName != QName(XMLSchemaURI, QString::fromLatin1("anyType"))) { // don't do this for anyType or Array + complexType.setBaseTypeName(typeName); + } + QDomElement ctElement = childElement.firstChildElement(); while (!ctElement.isNull()) { NSManager namespaceManager(context, ctElement); @@ -1068,11 +1037,7 @@ static QUrl urlForLocation(ParserContext *context, const QString &location) // "schemaLocation is only a hint" void Parser::importSchema(ParserContext *context, const QString &location) { - // Ignore this one, we have it built into the typemap - if (location == soapEncNs) { - return; - } - // Ignore this one, we don't need it, and it relies on soap/encoding + // Ignore this one, we don't need it if (location == QLatin1String("http://schemas.xmlsoap.org/wsdl/")) { return; } diff --git a/kdwsdl2cpp/src/converter_complextype.cpp b/kdwsdl2cpp/src/converter_complextype.cpp index 394eeaa81..4c66841ca 100644 --- a/kdwsdl2cpp/src/converter_complextype.cpp +++ b/kdwsdl2cpp/src/converter_complextype.cpp @@ -92,11 +92,6 @@ void Converter::convertComplexType(const XSD::ComplexType *type) //if ( type->isEmpty() ) // return; - // Skip the Array types we added in Parser::init... - if (NSManager::soapEncNamespaces().contains(type->nameSpace())) { - return; - } - const QString className(mTypeMap.localType(type->qualifiedName())); KODE::Class newClass; newClass.setNamespaceAndName(className); diff --git a/kdwsdl2cpp/wsdl/soapbinding.cpp b/kdwsdl2cpp/wsdl/soapbinding.cpp index 6ceb9552b..310c9656f 100644 --- a/kdwsdl2cpp/wsdl/soapbinding.cpp +++ b/kdwsdl2cpp/wsdl/soapbinding.cpp @@ -32,7 +32,6 @@ using namespace KWSDL; static QString soapBindingTransportHTTP = QLatin1String("http://schemas.xmlsoap.org/soap/http"); static QString soapStandardNamespace = QLatin1String("http://schemas.xmlsoap.org/wsdl/soap/"); -static QString soapEncStandardNamespace = QLatin1String("http://schemas.xmlsoap.org/soap/encoding/"); static QString soapPrefix(ParserContext *context) { diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 017d65915..978e3aee7 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -96,3 +96,4 @@ add_subdirectory(list_restriction) add_subdirectory(kddatetime) add_subdirectory(QSharedPointer_include) +add_subdirectory(pki.pca.dfn.de) diff --git a/unittests/pki.pca.dfn.de/CMakeLists.txt b/unittests/pki.pca.dfn.de/CMakeLists.txt new file mode 100644 index 000000000..9da8c6b3e --- /dev/null +++ b/unittests/pki.pca.dfn.de/CMakeLists.txt @@ -0,0 +1,3 @@ +set(pki.pca.dfn.de_SRCS test_pki.cpp) +set(WSDL_FILES pki.pca.dfn.de.wsdl) +add_unittest(${pki.pca.dfn.de_SRCS}) diff --git a/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro new file mode 100644 index 000000000..26c3c06c1 --- /dev/null +++ b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro @@ -0,0 +1,12 @@ +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += network xml +SOURCES = test_pki.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = pki.pca.dfn.de.wsdl + +OTHER_FILES = $$KDWSDL +LIBS += -L$${TOP_BUILD_DIR}/lib diff --git a/unittests/pki.pca.dfn.de/pki.pca.dfn.de.wsdl b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.wsdl new file mode 100644 index 000000000..8c58ef097 --- /dev/null +++ b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.wsdl @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/pki.pca.dfn.de/test_pki.cpp b/unittests/pki.pca.dfn.de/test_pki.cpp new file mode 100644 index 000000000..3ed57a63e --- /dev/null +++ b/unittests/pki.pca.dfn.de/test_pki.cpp @@ -0,0 +1,28 @@ +/**************************************************************************** +** Copyright (C) 2014-2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +int main() +{ + // TODO :-) + // At least we check that the generated wsdl_*.cpp file compiles. + return 0; +} diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 51da0af22..94d021abf 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -37,6 +37,7 @@ SUBDIRS = \ encapsecurity \ prefix_wsdl \ vidyo \ + pki.pca.dfn.de \ kddatetime \ empty_list_wsdl \ onvif_org_event \ From 38da10ec18f0923dc027d52c6fad50ad61a07397 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Thu, 22 Aug 2019 11:09:26 +0200 Subject: [PATCH 096/679] Fix rpath for Unix/Linux/macOS (#181) --- CMakeLists.txt | 3 --- cmake/InstallLocation.cmake | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec4201866..a82532136 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,9 +131,6 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib") - set(CMAKE_INSTALL_RPATH ${INSTALL_LIBRARY_DIR}) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - install(FILES LICENSE.GPL.txt LICENSE.US.txt LICENSE.txt README.txt kdsoap.pri kdwsdl2cpp.pri DESTINATION ${INSTALL_DOC_DIR}) if(CMAKE_VERSION VERSION_LESS 2.8.8) diff --git a/cmake/InstallLocation.cmake b/cmake/InstallLocation.cmake index 5a4b1c7b5..cdd6d00ac 100644 --- a/cmake/InstallLocation.cmake +++ b/cmake/InstallLocation.cmake @@ -26,3 +26,10 @@ endif() if(NOT INSTALL_DOC_DIR) set(INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR}) endif() + +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +if (APPLE) + set(CMAKE_MACOSX_RPATH ON) +else() + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${INSTALL_LIBRARY_DIR}") +endif() From 655eeff1eaaf2e6364b8e89ff1b5c4d10993e84e Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Thu, 22 Aug 2019 16:27:39 +0200 Subject: [PATCH 097/679] Allow to skip examples --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a82532136..3e34ed54b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,10 @@ # Build the test harness. # Default=false # +# -DKDSoap_EXAMPLES=[true|false] +# Build the examples. +# Default=true +# cmake_minimum_required(VERSION 2.8.7) cmake_policy(SET CMP0020 NEW) @@ -40,6 +44,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_MODULE_PATH}") option(${PROJECT_NAME}_STATIC "Build statically" OFF) option(${PROJECT_NAME}_TESTS "Build the tests" OFF) +option(${PROJECT_NAME}_EXAMPLES "Build the examples" ON) set(${PROJECT_NAME}_VERSION_MAJOR 1) set(${PROJECT_NAME}_VERSION_MINOR 8) @@ -186,5 +191,7 @@ if(${PROJECT_NAME}_IS_ROOT_PROJECT) add_subdirectory(testtools) add_subdirectory(unittests) endif() - add_subdirectory(examples) + if(${PROJECT_NAME}_EXAMPLES) + add_subdirectory(examples) + endif() endif() From 48c83cf61578153880ece6fa2d920596a3cdf38c Mon Sep 17 00:00:00 2001 From: anoy Date: Mon, 26 Aug 2019 17:28:30 +0200 Subject: [PATCH 098/679] initialize with nullptr, since C++11 is already required (#185) * added nullptr to generated code * added nullptr to library code removed unnecessary copies --- kdwsdl2cpp/common/fileprovider.cpp | 2 +- kdwsdl2cpp/common/nsmanager.cpp | 6 +++--- kdwsdl2cpp/common/parsercontext.cpp | 4 ++-- kdwsdl2cpp/libkode/membervariable.cpp | 6 +++--- kdwsdl2cpp/libkode/style.cpp | 4 ++-- kdwsdl2cpp/schema/parser.cpp | 2 +- kdwsdl2cpp/src/converter_clientstub.cpp | 8 ++++---- kdwsdl2cpp/src/converter_serverstub.cpp | 2 +- kdwsdl2cpp/src/main.cpp | 2 +- kdwsdl2cpp/src/typemap.cpp | 2 +- src/KDSoapClient/KDSoapClientInterface.cpp | 4 ++-- src/KDSoapClient/KDSoapClientThread_p.h | 2 +- src/KDSoapClient/KDSoapJob.h | 2 +- src/KDSoapClient/KDSoapPendingCall.cpp | 4 ++-- src/KDSoapClient/KDSoapPendingCallWatcher.cpp | 2 +- src/KDSoapClient/KDSoapPendingCallWatcher.h | 2 +- src/KDSoapClient/KDSoapSslHandler.cpp | 2 +- src/KDSoapClient/KDSoapSslHandler.h | 2 +- 18 files changed, 29 insertions(+), 29 deletions(-) diff --git a/kdwsdl2cpp/common/fileprovider.cpp b/kdwsdl2cpp/common/fileprovider.cpp index 675040313..06f380a72 100644 --- a/kdwsdl2cpp/common/fileprovider.cpp +++ b/kdwsdl2cpp/common/fileprovider.cpp @@ -41,7 +41,7 @@ static QHash fileProviderCache; FileProvider::FileProvider() - : QObject( 0 ) + : QObject( nullptr ) { } diff --git a/kdwsdl2cpp/common/nsmanager.cpp b/kdwsdl2cpp/common/nsmanager.cpp index a64335ec8..b29605949 100644 --- a/kdwsdl2cpp/common/nsmanager.cpp +++ b/kdwsdl2cpp/common/nsmanager.cpp @@ -28,7 +28,7 @@ // maybe port to QXmlNamespaceSupport? NSManager::NSManager() - : mContext(NULL), mParentManager(NULL) + : mContext(nullptr), mParentManager(nullptr) { } @@ -120,8 +120,8 @@ QMap NSManager::prefixMap() const void NSManager::addPrefixes(const QMap &prefixes) { for (QMap::const_iterator it = prefixes.constBegin() ; it != prefixes.constEnd() ; ++it) { - const QString prefix = it.key(); - const QString ns = it.value(); + const QString &prefix = it.key(); + const QString &ns = it.value(); // Only write down this prefix if we don't have it yet // and if we don't have another prefix for this NS (this is mostly for backwards compat, // so that msexchange still uses TNS rather than 'M' or 'T'...) diff --git a/kdwsdl2cpp/common/parsercontext.cpp b/kdwsdl2cpp/common/parsercontext.cpp index c7d17c7fe..822a6acf7 100644 --- a/kdwsdl2cpp/common/parsercontext.cpp +++ b/kdwsdl2cpp/common/parsercontext.cpp @@ -24,8 +24,8 @@ #include ParserContext::ParserContext() - : mNamespaceManager( 0 ), - mMessageHandler( 0 ) + : mNamespaceManager( nullptr ), + mMessageHandler( nullptr ) { } diff --git a/kdwsdl2cpp/libkode/membervariable.cpp b/kdwsdl2cpp/libkode/membervariable.cpp index 0c0311a70..1b3072286 100644 --- a/kdwsdl2cpp/libkode/membervariable.cpp +++ b/kdwsdl2cpp/libkode/membervariable.cpp @@ -30,19 +30,19 @@ class MemberVariable::Private }; MemberVariable::MemberVariable() - : Variable(), d( 0 ) + : Variable(), d( nullptr ) { } MemberVariable::MemberVariable( const MemberVariable &other ) - : Variable( other ), d( 0 ) + : Variable( other ), d( nullptr ) { // *d = *other.d; } MemberVariable::MemberVariable( const QString &name, const QString &type, bool isStatic ) - : Variable( name, type, isStatic ), d( 0 ) + : Variable( name, type, isStatic ), d( nullptr ) { setName( memberVariableName( name ) ); } diff --git a/kdwsdl2cpp/libkode/style.cpp b/kdwsdl2cpp/libkode/style.cpp index 8cddf348b..fe1c11e95 100644 --- a/kdwsdl2cpp/libkode/style.cpp +++ b/kdwsdl2cpp/libkode/style.cpp @@ -29,12 +29,12 @@ class Style::Private }; Style::Style() - : d( 0 ) + : d( nullptr ) { } Style::Style( const Style &/*other*/ ) - : d( 0 ) + : d( nullptr ) { // *d = *other.d; } diff --git a/kdwsdl2cpp/schema/parser.cpp b/kdwsdl2cpp/schema/parser.cpp index 1eb1254d7..87be84dbc 100644 --- a/kdwsdl2cpp/schema/parser.cpp +++ b/kdwsdl2cpp/schema/parser.cpp @@ -998,7 +998,7 @@ Group Parser::parseGroup(ParserContext *context, const QDomElement &element, con const QString localName = childName.localName(); // can contain all, choice or sequence if (localName == QLatin1String("sequence") || localName == QLatin1String("choice")) { - parseCompositor(context, e, nameSpace, &elements, NULL /*can't nest groups*/); + parseCompositor(context, e, nameSpace, &elements, nullptr /*can't nest groups*/); } else if (localName == QLatin1String("all")) { qWarning() << "Unsupported element in group:" << localName; // TODO } else { diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index 8fffa947f..03f9ac626 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -130,7 +130,7 @@ bool Converter::convertClientService() // Ctor and dtor { KODE::Function ctor(newClass.name()); - ctor.addArgument(KODE::Function::Argument(QLatin1String("QObject* _parent"), QLatin1String("0"))); + ctor.addArgument(KODE::Function::Argument(QLatin1String("QObject* _parent"), QLatin1String("nullptr"))); ctor.addInitializer(QLatin1String("QObject(_parent)")); KODE::Function dtor(QLatin1Char('~') + newClass.name()); KODE::Code ctorCode, dtorCode; @@ -369,7 +369,7 @@ bool Converter::convertClientService() KODE::Function ctor(jobClass.name()); ctor.addArgument(KODE::Function::Argument(QString::fromLatin1("%1* service").arg(fullyQualified(newClass)))); - ctor.addArgument(KODE::Function::Argument(QLatin1String("QObject* _parent"), QLatin1String("0"))); + ctor.addArgument(KODE::Function::Argument(QLatin1String("QObject* _parent"), QLatin1String("nullptr"))); ctor.addInitializer(QLatin1String("KDSoapJob(_parent)")); ctor.addInitializer(QLatin1String("mService(service)")); @@ -664,7 +664,7 @@ bool Converter::convertClientCall(const Operation &operation, const Binding &bin const int numReturnValues = outParts.count(); if (numReturnValues == 1) { - const Part retPart = outParts.first(); + const Part &retPart = outParts.first(); const QString retType = mTypeMap.localType(retPart.type(), retPart.element()); if (retType.isEmpty()) { qWarning("Could not generate operation '%s'", qPrintable(operation.name())); @@ -773,7 +773,7 @@ void Converter::convertClientOutputMessage(const Operation &operation, { // result signal const QString operationName = lowerlize(operation.name()); - const QString signalBase = operationName; + const QString &signalBase = operationName; const QString callName = QLatin1String("async") + upperlize(operation.name()); KODE::Function doneSignal(signalBase + QLatin1String("Done"), QLatin1String("void"), KODE::Function::Signal); doneSignal.setDocs(QLatin1String("This signal is emitted whenever the asynchronous call ") + callName + QLatin1String("() has succeeded.")); diff --git a/kdwsdl2cpp/src/converter_serverstub.cpp b/kdwsdl2cpp/src/converter_serverstub.cpp index b6abaeea0..5d1a33225 100644 --- a/kdwsdl2cpp/src/converter_serverstub.cpp +++ b/kdwsdl2cpp/src/converter_serverstub.cpp @@ -118,7 +118,7 @@ void Converter::generateServerMethod(KODE::Code &code, const Binding &binding, c QStringList inputVars; const Part::List parts = message.parts(); for (int partNum = 0; partNum < parts.count(); ++partNum) { - const Part part = parts.at(partNum); + const Part &part = parts.at(partNum); const QString lowerName = lowerlize(part.name()); const QString argType = mTypeMap.localType(part.type(), part.element()); //qDebug() << "localInputType" << part.type().qname() << part.element().qname() << "->" << argType; diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index 4955b6b06..45971850a 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -74,7 +74,7 @@ int main(int argc, char **argv) { QCoreApplication app(argc, argv); - const char *fileName = 0; + const char *fileName = nullptr; QFileInfo outputFile; bool both = false; bool impl = false; diff --git a/kdwsdl2cpp/src/typemap.cpp b/kdwsdl2cpp/src/typemap.cpp index 4a9ca33c7..9949c5f06 100644 --- a/kdwsdl2cpp/src/typemap.cpp +++ b/kdwsdl2cpp/src/typemap.cpp @@ -59,7 +59,7 @@ static QString correctSyntaxCpp(const QString &str) } TypeMap::TypeMap() - : mNSManager(0) + : mNSManager(nullptr) { // see http://www.w3.org/TR/xmlschema-2 // or http://www.datypic.com/sc/xsd/s-datatypes.xsd.html diff --git a/src/KDSoapClient/KDSoapClientInterface.cpp b/src/KDSoapClient/KDSoapClientInterface.cpp index 3302af0c9..6d5fa78a0 100644 --- a/src/KDSoapClient/KDSoapClientInterface.cpp +++ b/src/KDSoapClient/KDSoapClientInterface.cpp @@ -64,7 +64,7 @@ KDSoapClientInterface::SoapVersion KDSoapClientInterface::soapVersion() const } KDSoapClientInterfacePrivate::KDSoapClientInterfacePrivate() - : m_accessManager(0), + : m_accessManager(nullptr), m_authentication(), m_version(KDSoap::SOAP1_1), m_style(KDSoapClientInterface::RPCStyle), @@ -72,7 +72,7 @@ KDSoapClientInterfacePrivate::KDSoapClientInterfacePrivate() m_timeout(30 * 60 * 1000) // 30 minutes, as documented { #ifndef QT_NO_OPENSSL - m_sslHandler = 0; + m_sslHandler = nullptr; #endif } diff --git a/src/KDSoapClient/KDSoapClientThread_p.h b/src/KDSoapClient/KDSoapClientThread_p.h index a99a7b451..09fac8172 100644 --- a/src/KDSoapClient/KDSoapClientThread_p.h +++ b/src/KDSoapClient/KDSoapClientThread_p.h @@ -93,7 +93,7 @@ class KDSoapClientThread : public QThread { Q_OBJECT public: - explicit KDSoapClientThread(QObject *parent = 0); + explicit KDSoapClientThread(QObject *parent = nullptr); void enqueue(KDSoapThreadTaskData *taskData); diff --git a/src/KDSoapClient/KDSoapJob.h b/src/KDSoapClient/KDSoapJob.h index 34dabd719..305d10ea6 100644 --- a/src/KDSoapClient/KDSoapJob.h +++ b/src/KDSoapClient/KDSoapJob.h @@ -71,7 +71,7 @@ class KDSOAP_EXPORT KDSoapJob : public QObject * * \param parent optional parent object */ - explicit KDSoapJob(QObject *parent = 0); + explicit KDSoapJob(QObject *parent = nullptr); /** * Destructor. diff --git a/src/KDSoapClient/KDSoapPendingCall.cpp b/src/KDSoapClient/KDSoapPendingCall.cpp index 61374a86d..c2fed4be1 100644 --- a/src/KDSoapClient/KDSoapPendingCall.cpp +++ b/src/KDSoapClient/KDSoapPendingCall.cpp @@ -126,7 +126,7 @@ KDSoapPendingCall::Private::~Private() { if (reply) { // Ensure the connection is closed, which QNetworkReply doesn't do in its destructor. This needs abort(). - QObject::disconnect(reply.data(), SIGNAL(finished()), 0, 0); + QObject::disconnect(reply.data(), SIGNAL(finished()), nullptr, nullptr); reply->abort(); } delete reply.data(); @@ -199,7 +199,7 @@ void KDSoapPendingCall::Private::parseReply() if (!data.isEmpty()) { KDSoapMessageReader reader; - reader.xmlToMessage(data, &replyMessage, 0, &replyHeaders, this->soapVersion); + reader.xmlToMessage(data, &replyMessage, nullptr, &replyHeaders, this->soapVersion); } if (reply->error()) { diff --git a/src/KDSoapClient/KDSoapPendingCallWatcher.cpp b/src/KDSoapClient/KDSoapPendingCallWatcher.cpp index eae3ab6a0..1bb945500 100644 --- a/src/KDSoapClient/KDSoapPendingCallWatcher.cpp +++ b/src/KDSoapClient/KDSoapPendingCallWatcher.cpp @@ -48,7 +48,7 @@ void KDSoapPendingCallWatcher::waitForFinished() void KDSoapPendingCallWatcher::Private::_kd_slotReplyFinished() { // Workaround Qt-4.5 emitting finished twice in testCallRefusedAuth - disconnect(q->KDSoapPendingCall::d->reply.data(), SIGNAL(finished()), q, 0); + disconnect(q->KDSoapPendingCall::d->reply.data(), SIGNAL(finished()), q, nullptr); emit q->finished(q); } diff --git a/src/KDSoapClient/KDSoapPendingCallWatcher.h b/src/KDSoapClient/KDSoapPendingCallWatcher.h index d4bdaab21..f4ed1dff1 100644 --- a/src/KDSoapClient/KDSoapPendingCallWatcher.h +++ b/src/KDSoapClient/KDSoapPendingCallWatcher.h @@ -54,7 +54,7 @@ class KDSOAP_EXPORT KDSoapPendingCallWatcher : public QObject, public KDSoapPend * asynchronous pending call \p call and sets this object's parent to * \p parent. */ - explicit KDSoapPendingCallWatcher(const KDSoapPendingCall &call, QObject *parent = 0); + explicit KDSoapPendingCallWatcher(const KDSoapPendingCall &call, QObject *parent = nullptr); /** * Destroys this object. If this KDSoapPendingCallWatcher object was the last reference to the unfinished pending call, the call will be canceled. */ diff --git a/src/KDSoapClient/KDSoapSslHandler.cpp b/src/KDSoapClient/KDSoapSslHandler.cpp index e3550bbad..c59c6ae8c 100644 --- a/src/KDSoapClient/KDSoapSslHandler.cpp +++ b/src/KDSoapClient/KDSoapSslHandler.cpp @@ -27,7 +27,7 @@ #include "KDSoapSslHandler.h" KDSoapSslHandler::KDSoapSslHandler(QObject *parent) - : QObject(parent), m_reply(0) + : QObject(parent), m_reply(nullptr) { } diff --git a/src/KDSoapClient/KDSoapSslHandler.h b/src/KDSoapClient/KDSoapSslHandler.h index 6a3028e9c..a0cb2a797 100644 --- a/src/KDSoapClient/KDSoapSslHandler.h +++ b/src/KDSoapClient/KDSoapSslHandler.h @@ -100,7 +100,7 @@ public Q_SLOTS: * Constructs a KDSoapSslHandler. * Used internally */ - explicit KDSoapSslHandler(QObject *parent = 0); + explicit KDSoapSslHandler(QObject *parent = nullptr); virtual ~KDSoapSslHandler(); QNetworkReply *m_reply; From 86a074f889dee36712ef5fc94b97ee8c5e244c92 Mon Sep 17 00:00:00 2001 From: tuxmaster5000 <837503+tuxmaster5000@users.noreply.github.com> Date: Mon, 26 Aug 2019 17:44:46 +0200 Subject: [PATCH 099/679] Fix some rpm spec file problems (#178) * Add source signature * Use modern autosetup * Fix date in changelog * Fix changelog version --- qt5-kdsoap.spec | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qt5-kdsoap.spec b/qt5-kdsoap.spec index ba38194f0..976b84735 100644 --- a/qt5-kdsoap.spec +++ b/qt5-kdsoap.spec @@ -2,7 +2,8 @@ Name: qt5-kdsoap Version: 1.8.0 Release: 1 Summary: A Qt5-based client-side and server-side SOAP component -Source: %{name}-%{version}.tar.gz +Source0: %{name}-%{version}.tar.gz +Source1: %{name}-%{version}.tar.gz.asc Url: http://github.com/KDAB/KDSoap Group: System/Libraries License: GPL-2.0+ @@ -45,7 +46,7 @@ This package contains header files and associated tools and libraries to develop programs which need to access web services using the SOAP protocol. %prep -%setup -q +%autosetup %build touch .license.accepted @@ -79,9 +80,9 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_RPATH=True -DCMAKE_BUILD_TYPE=R %{_libdir}/libkdsoap-server.so %changelog -* Fri May 17 2019 Allen Winter 1.8.0 +* Fri May 17 2019 Allen Winter 1.8.0-1 1.8.0 -* Mon Mar 01 2018 Allen Winter 1.7.0 +* Thu Mar 01 2018 Allen Winter 1.7.0 1.7.0 * Mon May 01 2017 Allen Winter 1.6.0 1.6.0 From 83a429ae19524b5ef84b6341ce0d902aada746ae Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 26 Aug 2019 16:34:11 -0400 Subject: [PATCH 100/679] README.txt, README-commercial.txt - update About KDAB --- README-commercial.txt | 15 ++++++++++----- README.txt | 14 +++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/README-commercial.txt b/README-commercial.txt index b934c2b9f..72f69697e 100644 --- a/README-commercial.txt +++ b/README-commercial.txt @@ -30,11 +30,16 @@ About KDAB ========== KD Soap is supported and maintained by Klarälvdalens Datakonsult AB (KDAB). -KDAB, the Qt experts, provide consulting and mentoring for developing -Qt applications from scratch and in porting from all popular and legacy -frameworks to Qt. We continue to help develop parts of Qt and are one -of the major contributors to the Qt Project. We can give advanced or -standard trainings anywhere around the globe. +The KDAB Group is the global No.1 software consultancy for Qt, C++ and +OpenGL applications across desktop, embedded and mobile platforms. + +The KDAB Group provides consulting and mentoring for developing Qt applications +from scratch and in porting from all popular and legacy frameworks to Qt. +We continue to help develop parts of Qt and are one of the major contributors +to the Qt Project. We can give advanced or standard trainings anywhere +around the globe on Qt as well as C++, OpenGL, 3D and more. + +Please visit http://www.kdab.com to meet the people who write code like this. KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB diff --git a/README.txt b/README.txt index b36252b07..89fa02896 100644 --- a/README.txt +++ b/README.txt @@ -56,14 +56,18 @@ About KDAB ========== KD Soap is supported and maintained by Klarälvdalens Datakonsult AB (KDAB). -KDAB, the Qt experts, provide consulting and mentoring for developing -Qt applications from scratch and in porting from all popular and legacy -frameworks to Qt. We continue to help develop parts of Qt and are one -of the major contributors to the Qt Project. We can give advanced or -standard trainings anywhere around the globe. +The KDAB Group is the global No.1 software consultancy for Qt, C++ and +OpenGL applications across desktop, embedded and mobile platforms. + +The KDAB Group provides consulting and mentoring for developing Qt applications +from scratch and in porting from all popular and legacy frameworks to Qt. +We continue to help develop parts of Qt and are one of the major contributors +to the Qt Project. We can give advanced or standard trainings anywhere +around the globe on Qt as well as C++, OpenGL, 3D and more. Please visit http://www.kdab.com to meet the people who write code like this. + KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB in the European Union, the United States, and/or other countries. Other product and company names and logos may be trademarks or registered trademarks of their respective companies. From daa404f2325d6a587fe9889bae95cb8db1c2347c Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Wed, 28 Aug 2019 12:14:51 -0400 Subject: [PATCH 101/679] update cppcheck suppressions --- src/KDSoapClient/KDSoapValue.cpp | 1 - unittests/builtinhttp/builtinhttp.cpp | 1 - unittests/ihc_wsdl/test_ihc.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/src/KDSoapClient/KDSoapValue.cpp b/src/KDSoapClient/KDSoapValue.cpp index d7da0e62f..f73f727b7 100644 --- a/src/KDSoapClient/KDSoapValue.cpp +++ b/src/KDSoapClient/KDSoapValue.cpp @@ -323,7 +323,6 @@ void KDSoapValue::writeElementContents(KDSoapNamespacePrefixes &namespacePrefixe writer.writeAttribute(KDSoapNamespaceManager::xmlSchemaInstance2001(), QLatin1String("type"), type); } - // cppcheck-suppress redundantCopyLocalConst const KDSoapValueList list = this->childValues(); const bool isArray = !list.arrayType().isEmpty(); if (isArray) { diff --git a/unittests/builtinhttp/builtinhttp.cpp b/unittests/builtinhttp/builtinhttp.cpp index 2290f0246..ce562fc27 100644 --- a/unittests/builtinhttp/builtinhttp.cpp +++ b/unittests/builtinhttp/builtinhttp.cpp @@ -384,7 +384,6 @@ private Q_SLOTS: QCOMPARE(id.value().toString(), QString::fromLatin1("12345")); const KDSoapValue error = lst.at(1); QCOMPARE(error.name(), QString::fromLatin1("error")); - // cppcheck-suppress redundantCopyLocalConst const KDSoapValueList errorList = error.childValues(); QCOMPARE(errorList.count(), 3); const KDSoapValue number = errorList.at(0); diff --git a/unittests/ihc_wsdl/test_ihc.cpp b/unittests/ihc_wsdl/test_ihc.cpp index 8d90fbf18..f05abf3bf 100644 --- a/unittests/ihc_wsdl/test_ihc.cpp +++ b/unittests/ihc_wsdl/test_ihc.cpp @@ -71,7 +71,6 @@ class IHCServerObject : public ResourceInteractionServiceServiceServerBase // Alternatively: dynamic introspection - // cppcheck-suppress redundantCopyLocalConst const KDSoapValueList children = value.childValues(); const int enumValueID = children.child("enumValueID").value().toInt(); return (parameter4.typeString() == "enum" && enumValueID == 42 && enumValue.enumValueID() == 42); From c40db2f073b54c16cb58c15411fe990b683dc628 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 2 Sep 2019 16:02:13 -0400 Subject: [PATCH 102/679] README and INSTALL updates add copyright assignment template --- INSTALL-cmake.txt | 4 ++-- INSTALL.txt | 2 +- README-commercial.txt | 5 +++-- README.txt | 5 +++-- doc/KDSoap-CopyrightAssignmentForm.docx | Bin 0 -> 8558 bytes 5 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 doc/KDSoap-CopyrightAssignmentForm.docx diff --git a/INSTALL-cmake.txt b/INSTALL-cmake.txt index 510f6d2b2..10d96e955 100644 --- a/INSTALL-cmake.txt +++ b/INSTALL-cmake.txt @@ -16,8 +16,8 @@ The same source code compiles with either Qt 4 or Qt 5. 2) Now run 'cmake' depending on the kind of build one of the following: cmake -DCMAKE_BUILD_TYPE=Debug .. cmake -DCMAKE_BUILD_TYPE=Release .. - cmake -DKDSOAP_STATIC=True -DCMAKE_BUILD_TYPE=Debug .. - cmake -DKDSOAP_STATIC=True -DCMAKE_BUILD_TYPE=Release .. + cmake -DKDSoap_STATIC=True -DCMAKE_BUILD_TYPE=Debug .. + cmake -DKDSoap_STATIC=True -DCMAKE_BUILD_TYPE=Release .. To define the install-location use for example: cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=C:/kdsoap .. diff --git a/INSTALL.txt b/INSTALL.txt index b23946b9d..caf3e82ad 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -25,7 +25,7 @@ to section 1-bis). Commercial users, start at section 1). If this succeeded, jump to step 2. -1-bis) If you are building KD Soap from a github clone rather than a release tarball, +1-bis) If you are building KD SOAP from a github clone rather than a release tarball, the configure.bat/configure.sh script doesn't exist (it's generated at release time), you need to do this instead: diff --git a/README-commercial.txt b/README-commercial.txt index 72f69697e..9955abf35 100644 --- a/README-commercial.txt +++ b/README-commercial.txt @@ -11,7 +11,9 @@ For more information, see http://www.kdab.com/kdab-products/kd-soap Contributing ============ KDAB will happily accept external contributions, but substantial -contributions will require a signed Copyright Assignment Agreement. +contributions will require a signed Copyright Assignment Agreement +(see doc/KDSoap-CopyrightAssignmentForm.docx). + Contact info@kdab.com for more information. Licensing @@ -41,7 +43,6 @@ around the globe on Qt as well as C++, OpenGL, 3D and more. Please visit http://www.kdab.com to meet the people who write code like this. - KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB in the European Union, the United States, and/or other countries. Other product and company names and logos may be trademarks or registered trademarks of their respective companies. diff --git a/README.txt b/README.txt index 89fa02896..c1f3aa757 100644 --- a/README.txt +++ b/README.txt @@ -35,7 +35,9 @@ Contact Get Involved ============ KDAB will happily accept external contributions, but substantial -contributions will require a signed Copyright Assignment Agreement. +contributions will require a signed Copyright Assignment Agreement +(see doc/KDSoap-CopyrightAssignmentForm.docx). + Contact info@kdab.com for more information. Please submit your contributions or issue reports from our GitHub space at @@ -67,7 +69,6 @@ around the globe on Qt as well as C++, OpenGL, 3D and more. Please visit http://www.kdab.com to meet the people who write code like this. - KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB in the European Union, the United States, and/or other countries. Other product and company names and logos may be trademarks or registered trademarks of their respective companies. diff --git a/doc/KDSoap-CopyrightAssignmentForm.docx b/doc/KDSoap-CopyrightAssignmentForm.docx new file mode 100644 index 0000000000000000000000000000000000000000..50f8eae6da7bb3696cc8f01bf1349b558357dc34 GIT binary patch literal 8558 zcmc(EWmFvNwk_@!Xj}uqg9LYX2=4BI0F65YcPD6Ym*DOif=gq;C0HZDT_5D!b9c^u z@9y#b-PL1sRgcl@tNP}uHP@&)6=k7e01yZW2oT)a}MSdny!zrc~4T0EcnN(f6(v`qmBTVU-&_20?61I2t#c8k2 z6_oq=jLB<@;_R0ju2Othva{aJ%zhluX@#o4le*{R@W82g6G&yQU#MGI%f*N-?`{e* z%yTcXzxl|Ph~lPa@!*-mg)(-m!X`N`T;YDA#iiNMm`GEgBjNgF$!6;{+}3Xm(*GGT zn%g^1c%G#w3y%PvfTWmz-Y-8C1cc)MhzQ2>KTK^+6di2s9GQ&l>=@l_tTW<Zi1lBFYYegdagGNht8!4DBOsX<6GLu0UyoEZ-O% zSeKsMF8ImREYE^|8Iroz?45%8sv-JVy>@s?MGxogaPPh?N+I{4r2w%_9e3tc7II5b ztu=F%!uT~D{ySQU7|G?*lZ5rxkv8I}enoX@hP?Y~Yx!h>>uKf+QO6?R&uP5`QswbT z*xGm_kgT>0v#TJlDT;C7%;4CYOL?#(bW!g-0mTB(Y|Mgn&T$N337{ ziM5HXgV_t%-pa%Bz04SGXV`H^VZQ)$q4BCv(^!eI3rOEa=N6}9xsrZy{94_3^L{8# z>F8S5JXrkeb`)7DJD(q zC>P*R`6U0CB##e6V?uT)l&ab3eQdecWzL3lo+l#xUMlL7#O%5WXq&|Xn%qcfg<)T$ zsV^Q>?pxfnUGjpJ>lOMSw{}b70tpS##MV&bJC?fI=4AJF24gfe>IyrE_`gc2r#Vn3t9))-xL{)449NeG__@ zch%&JN~}hG@Dz6_@>8KLcPj9nz>*nEM>scpd9;<_qSoJLvv{~7=-c|K@ZCxE=ZZiQ zk{&@)mM5r}I=NVZC@i1rwDga4B6_ZqtF416)4!dt<{w-)w#CfV7aBSHKI&MA=d5kXQLR2bF|*Pp&sMpH z7Pr%1GY@k^7kL%vsT}{f*_dZ%Dhe1x#*?;$(IJj45JW>>!3?U#DAumRWF_q?NM4Yn zr%kMWC0r`cK_=n;iSj37fWlRZwK_K6Sn2BzXKKEyRo;45uvhvQI7Gy;7*h1mDWNPJ zLa4GTCn`{zQ|D3+ZPbxnsBG4J{aY3L5UG{u+ez5!o3 zZ_HX;ESSd#=n4&DW^f#nQBr$jp!JYZx-$N{SgT|+78jf|189TE{Q&HmajQk zEjZ$IkzrISd#k@N1_MSza{Qg2OVmS%Y`GaVN$NSV#ezs71Pn;yq^hQt)Jyo1slEO1 z({HLMG}Z(!J#U=n8J_={mNEYgjkzt*N!7^M`Zrh9D+>RME0Bg=_v+vSa|_idzad@- z4MR5^7FL^9QdCNVkL;JlL}H;uw#<)4#zw{*9@fji%vC3dIAO<+gB`I*cjUrIe(tk5bgP@m&QIo*S`!IG!ha z#EMj4IH--FDZg@4C8@-#E__dtqSsTb6JLtc>{o=D?W)}Tre_X9b`KBGR^&YxfWPXc z6D+?D);4jD_|$p4gGXt$uI@G5J3!(9V)5*G9qGKMOj~UUtQ_=pqnoQQ@(E|t7kmKtjnH-=lGr^YtJj=sMGR;aG~w1PWPokunNI%ywjx zYTVIO0(nW+<`cT{&&?(yY&nfS`#n-(#m-+q;og-MOs&Ujr+393AV zRIdI=)bw>80tbLr#%kjrGE#MSZ@R(1&d+x>DAwDio691D13*Yi;QijG+g=AjPA#2) zOQ`Yev&bl`b8G=-j&%^>_F4wM?!Is*@WJEz0Z_f{Q;ze;7=wb*`Si*3ctJR|S! zLT0|}*7_`lcad|p?!8X~k7sCIeccZmQ39*uurbwwdpd-Uj*@mJfx`;m{=t*0z|W$w zOKL}(vUD{I1UGVFS56)=os?8Bai6r~PGrJI-5WJn%Q@wvr z|Ee`#alFThEzHAtnns;-<6;|c`l7&j>{f^1{l*}O-ro94qT1PH1cmCbF8nZmUs|r7 zHy@e)`sc(A1&}PFlk#G-rRT>w*CwqNxsm`7Av-i7UsMy+*YHdsq!)Q_uiBD)TX2U5)F(C7=DYnEoPb2LkQx*=m=!&t7}H+rX%!E)P<)X zB6OJyQ&&l#BZ&WYmns~FkW*Y7g_?RyNGHq~ITSQa55ilL2p@`MT)_B+LbW3-jy+i10Z9IyFGiLea{APBt}ph2wYb zV?jeYT8JM7-S3(Bw1{mU!Zg1$41t7Tn&4Q1V9LJbmfJBk*ZVf1&Yv`|xUHG^p>shj zR}&qOCPXQ?QSGJ<7nZ2v=+uUa6d`H>VqX*KIJlhsbq(rROfCamZ0+BH>85BV5 zOOv2LGsXP_|Jz8gGMiE^87l+>cvn;arxaZGbLcoH39z$ljt3Cm*BL?K(aWdc?XwO5 zuJoXn*C1UbUBeKD31A(vLAdN5OinrOW@KQpdSfx-X1F4E+{+sX1|aFUXK?0kG7+~j zD#DG3Zi$qJPfkq8?W=G%7&WXXSYKnC#w(*2rwx_eHXxLiL&@+}X+?v0KJ#$sa-7x7 zUHKZ74+C3RCxkihO$y_(ynhU!ph-l*)~&%tqGi}RA~b0QRTISJw!sh@5Lj$VEhMG{ z#O!KUHZ9A4*hC#zHL4m12utE)5U5l}`;-BESF0 zN#0Ut!aNChm4Evx(s1h^DJz));f$=phu1Ms%*4$gtA9R8imt)Go>l+7Pp& zW;d)v>~!x>ybUspbmb{>oim=m2zh)h`Cdh~M?}TQn2tp4aclEn?_!IMc!Qt!_OPBy z5W9cp!_@HL*T$){VM)g)mJ!3y5^0cn;zUg_F{r+k;A^oXSJPK}yKR#=S@aye#AtBN zMLrG3ui9bbAP_s)d*d6U*NTvhr3Ok6+PfoO~kvpa>Vn* zSXO1R(Z18*(}f7%D%R={cZ1ZFANcqqBDXcIn)%TK=}~**`p*>``Lr zHO6;`C1yR(2W=yso~xJ`Lf)*;6i@fw9HY96Zg;(j4~uu+F)<*~6*>7xpx&0fJ%JId+oG=LRXaH>vu{H!0dyarE(q-#-zIpx$A( zYn|K1E8R+%Bu`_73v`8O8SiRx<1@AM&EGULzK+2!w8&i#q4iDeyelU-hX+t;?*yO9 z?@Cp!x8sh9_IiU3nwtpYUyz6TR{{Pv4%hcGhvgBHljFMfQQhyMb-5S4Csunu=U6a8 zkNFlsU$1+V0PVdVm-|5Tyu$QGAqADPRm?i5usIpe^DfCP;_I(qwX7~sh$ckyw}^te z3ViHRxG2|*pn6zcT_6PIisDe~S!1$QlpEH^oX7jA)g{GTpQZB9qH{hOzk(iqKbV>pNFTaiP~&)~o1XR-$;=AZiaSqVb~litCs6$MknwSex6NsU51|o7 z{9Y#`pgghA_+lt$CWK`?r{Q7LVS=>kNpVq-csChoLk)ObojcIPZd$G5^_6HYan#YMLD6cxrP@T+w)zpW z_wJIDnwkSb?3r}ujIxP|#^k0h<)bzJUT7xo=F5(nQ3W{c`u0JA3?d~oXZth|X}aqmXm^vN6CY$rAUaiCy9S|`pD;`$bb?5jw&=$Re=8E9LWbY1a?Db z?N>7nQ>}gFIbIW=fMk|x-uPLDfqg^#WS?P>qtis@ff(TfU?mTcmo03iR@ulIzT4VA zM^K%&ilW07gzeMS9bLkF_x>)a3HM8F$r_?}CIUPe(w0GZzY|;P2E{zy)#OF83#I#Y zJ$oMRnM|W^Fll9)pi!-9t=!;Sg9EZ_Z#)X*gV|yl@Q3D5VY<5$^?bSl_AkL>5!DDvLB>LISJGwN7UyLM zlDuD4aV~s$y2kOwc=(&D#8gzNL;`clNoNXc??$q;cbgvuRe%)5K+!4(s`c&BWwznmzNe73gV=|5uG-}3BqSZb>zuR6-pe{;?U%mpK$kEN_ zDSjU%JlQ{jrvQ?|R?eSu$zECjJ2{cnj@0pN)+vuDs>?-}SOzi#bBE16V4e}~EvFGG zEANo2n(NqCi1r$$Y zY~jbt`@-wqUABO8zkZaTdF6MEH(N6nhqY(MK&+n}VkYKEsaw9o zFAORy1KJO$tbf-#!u(9BZ;l2YRSaZ0ZX8&WaSbEP8^1w=wRL}Y1q1{2qudx=CcnE^)RUcef=^9ZI-h-NGA7H zX69|27akjJ7t7xdl|R_T3syWJA8u=Am6f7iUuCxl;+`_Z4)2?@PyJ?-ld_knV-IxS9O zM=mmy40-G9Igd}SU^yZ>0uusZBa~A+#YBB0wTlY9mHMC?bqdj^T|}{}@g^AND@7a> zXNS}Pj8$!dtROCnTme~j0%8_(=jyLd7g%!Kr9J0xQ9_86$~3QbDabJm#9mP<2C^)A zF8^dSQu7ULgOl>#qLbyN(hq0XQG zmIT~Y@7q$gD{u1(#Li(8Vr_x2>_I+U_RW9AQsFi-gT>e-6NB9c+2YH4&wB=B)|eGe zm?twXZKod+4fpa)@nFvM9D$lXQcnsiwF#K~&TOF0;k?>>)8IKFx|BLnZYeApKv$Tt z`~0#=Ozo3p+0sduIo~p?-L)2Ofu@pC~58ztvhUDHDTyJKx?2G*-s=1QS&VxKbX zb9MYRgXn6p?xR)V;No0bxTT)*-h>*8%;NpB)#XtqyCJzOKgGWvKBZ+@91#e6e;WqZ z{P}^F69>&h;-*vyI&q4=?J;QpbwyN?#FSex16<63fv}L&1A^nEe zWn}kCoui9UalI`--Nx-l-M}p;4`K%6=pLkX%m;6%NUz3DWo0m4?B zyUJHby{`pR+~eJ~wsVth!AFB4?tpkDG(pxoZog3kkul>qG*HqQ z(^oGVTAkr?*p(r(MmLvWFV;l{L>|BvOi=?3fe`(jY)fN;JNxbEh_8E6N{fmDpc(rf zReVJ|x$ZuzSR-amwBXAr#w-KHq_&`3p(|B;i%O9XqH%=(GB;Y4rqs9fuo$3_NwV@6!W5)bw zL7*NS^Lo9eDu=tL<&S8b~dTCyF(xz=#)) zWDv^7q3wo6?6-8>SiAeVSoX?0|7WYcvC82XTg8(kD5EX}#*8LS!F#qh`{e7iB?U?_(k?3c%{x5gx@9BS94lka~Ur_@0 zU+Mqh;QT%R&$;uTmxn?4ulzr4iod7-*=;Yw>8}tZ`1jra_o(`N@}G~zOGEw@p~U~s Y_EeOGecluV1mg3D@3~Awq%Xhz4}o?(hX4Qo literal 0 HcmV?d00001 From 01dc9f4888f3dfd38fdaf05ae3d18ea038477a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20M=C3=A1rton?= Date: Thu, 24 Oct 2019 14:30:50 +0200 Subject: [PATCH 103/679] Extendend gitignore (#188) --- .gitignore | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2802c2d95..64ada7926 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,11 @@ Makefile +Makefile.* +*.pro.user +*.pro.user* +*.so +*.so.* +*.exe +moc_* *.moc *.obj *.directory @@ -10,11 +17,13 @@ generated CMakeLists.txt.user _moc _obj +*.o .license.accepted CPackConfig.cmake autogen.pyc configure.bat configure.sh +.qmake.stash /include @@ -56,4 +65,3 @@ configure.sh /unittests/enum_escape/enum_escape /unittests/literal_true_false/literal_true_false /unittests/msexchange_noservice_wsdl/msexchange_noservice_wsdl - From f0d6bb2bc68f46bb061d1283a4b873c92c6f9058 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 24 Oct 2019 15:58:23 +0200 Subject: [PATCH 104/679] Fix previous commit: qmake target name must match subdir name Otherwise runTest.bat fails --- unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro index 26c3c06c1..df40305b3 100644 --- a/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro +++ b/unittests/pki.pca.dfn.de/pki.pca.dfn.de.pro @@ -1,4 +1,5 @@ include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +TARGET = pki.pca.dfn.de QT += network xml SOURCES = test_pki.cpp test.target = test From 82b0af3dab9b89a4da6b01787d5613f98d05b602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20M=C3=A1rton?= Date: Fri, 25 Oct 2019 16:33:23 +0200 Subject: [PATCH 105/679] [kdwsdl2cpp] Add option for loading PKCS12 certificates (#190) --- kdwsdl2cpp/common/fileprovider.cpp | 9 ++++++ kdwsdl2cpp/src/main.cpp | 32 ++++++++++++++++++++ kdwsdl2cpp/src/settings.cpp | 48 ++++++++++++++++++++++++++++++ kdwsdl2cpp/src/settings.h | 16 ++++++++++ 4 files changed, 105 insertions(+) diff --git a/kdwsdl2cpp/common/fileprovider.cpp b/kdwsdl2cpp/common/fileprovider.cpp index 06f380a72..1f23554d9 100644 --- a/kdwsdl2cpp/common/fileprovider.cpp +++ b/kdwsdl2cpp/common/fileprovider.cpp @@ -106,6 +106,15 @@ bool FileProvider::get( const QUrl &url, QString &target ) QNetworkAccessManager manager; QNetworkRequest request(url); +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + if (Settings::self()->certificateLoaded()) { + QSslConfiguration sslConfig = request.sslConfiguration(); + sslConfig.setPrivateKey(Settings::self()->sslKey()); + sslConfig.setLocalCertificate(Settings::self()->certificate()); + sslConfig.setCaCertificates(Settings::self()->caCertificates()); + request.setSslConfiguration(sslConfig); + } +#endif QNetworkReply* job = manager.get(request); QEventLoop loop; diff --git a/kdwsdl2cpp/src/main.cpp b/kdwsdl2cpp/src/main.cpp index 45971850a..8905b6dcf 100644 --- a/kdwsdl2cpp/src/main.cpp +++ b/kdwsdl2cpp/src/main.cpp @@ -67,6 +67,15 @@ static void showHelp(const char *appName) " use of the import-path option\n" " -help-on-missing When groups or basic types could not be found, display\n" " available types (helps with wrong namespaces)\n" +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + " -pkcs12file Load a certificate from a PKCS12 file. You can use this option\n" + " if the WSDL file (or files refering to it) is served from a \n" + " location which require certificate based authentication\n" + " -pkcs12password Pass the password for the certificate file if required.\n" + " This option is not secure and should be used with caution\n" + " if other users of the machine are capable to see the running " + " processes ran by the current user.\n" +#endif "\n", appName, appName, appName); } @@ -90,6 +99,7 @@ int main(int argc, char **argv) QStringList importPathList; bool useLocalFilesOnly = false; bool helpOnMissing = false; + QString pkcs12File, pkcs12Password; int arg = 1; while (arg < argc) { @@ -207,6 +217,22 @@ int main(int argc, char **argv) useLocalFilesOnly = true; } else if (opt == QLatin1String("-help-on-missing")) { helpOnMissing = true; +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + } else if (opt == QLatin1String("-pkcs12file")) { + ++arg; + if (!argv[arg]) { + showHelp(argv[0]); + return 1; + } + pkcs12File = QLatin1String(argv[arg]); + } else if (opt == QLatin1String("-pkcs12password")) { + ++arg; + if (!argv[arg]) { + showHelp(argv[0]); + return 1; + } + pkcs12Password = QLatin1String(argv[arg]); +#endif } else if (!fileName) { fileName = argv[arg]; } else { @@ -262,6 +288,12 @@ int main(int argc, char **argv) Settings::self()->setHelpOnMissing(helpOnMissing); KWSDL::Compiler compiler; +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + if (!pkcs12File.isEmpty()) { + if (!Settings::self()->loadCertificate(pkcs12File, pkcs12Password)) + return -1; + } +#endif // so that we have an event loop, for downloads QTimer::singleShot(0, &compiler, SLOT(run())); diff --git a/kdwsdl2cpp/src/settings.cpp b/kdwsdl2cpp/src/settings.cpp index dbc01ef52..2e25e01a8 100644 --- a/kdwsdl2cpp/src/settings.cpp +++ b/kdwsdl2cpp/src/settings.cpp @@ -251,3 +251,51 @@ bool Settings::helpOnMissing() const { return mHelpOnMissing; } + +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) +bool Settings::loadCertificate(const QString &certPath, const QString & password) +{ + QFile certFile(certPath); + if (certFile.open(QFile::ReadOnly)) { + mCertificateLoaded = QSslCertificate::importPkcs12(&certFile, + &mSslKey, + &mCertificate, + &mCaCertificates, + password.toLocal8Bit()); + certFile.close(); + if (!mCertificateLoaded) { + fprintf(stderr, "Unable to load the %s certificate file\n", + certPath.toLocal8Bit().constData()); + if (!password.isEmpty()) + fprintf(stderr, "Please make sure that you have passed the correct password\n"); + else + fprintf(stderr, "Maybe it is password protected?\n"); + } + return mCertificateLoaded; + } else { + fprintf(stderr, "Failed to open the %s certificate file for reading\n", + certPath.toLocal8Bit().constData()); + } + return false; +} + +QList Settings::caCertificates() const +{ + return mCaCertificates; +} + +QSslCertificate Settings::certificate() const +{ + return mCertificate; +} + +QSslKey Settings::sslKey() const +{ + return mSslKey; +} + +bool Settings::certificateLoaded() const +{ + return mCertificateLoaded; +} +#endif diff --git a/kdwsdl2cpp/src/settings.h b/kdwsdl2cpp/src/settings.h index 767bf7bbd..c5ca846f9 100644 --- a/kdwsdl2cpp/src/settings.h +++ b/kdwsdl2cpp/src/settings.h @@ -21,6 +21,8 @@ #define SETTINGS_H #include +#include +#include #include #include @@ -85,6 +87,14 @@ class Settings bool helpOnMissing() const; void setHelpOnMissing(bool b); +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + bool loadCertificate(const QString & certPath, const QString &password = QString()); + bool certificateLoaded() const; + QSslKey sslKey() const; + QSslCertificate certificate() const; + QList caCertificates() const; +#endif + private: friend class SettingsSingleton; Settings(); @@ -105,6 +115,12 @@ class Settings bool mKeepUnusedTypes; bool mUseLocalFilesOnly; bool mHelpOnMissing; +#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0) + QSslKey mSslKey; + QSslCertificate mCertificate; + QList mCaCertificates; + bool mCertificateLoaded = false; +#endif }; #endif From e0a3bbce1e527f3a5734adb66628b264176faf70 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Sat, 26 Oct 2019 18:28:01 +0200 Subject: [PATCH 106/679] Add KDSoapUdpClient (#186) KDSoapUdpClient provides an interface for implementing a SOAP-over-UDP[1] client. [1] https://docs.oasis-open.org/ws-dd/soapoverudp/1.1/os/wsdd-soapoverudp-1.1-spec-os.html --- doc/CHANGES_1_9.txt | 1 + src/KDSoapClient/CMakeLists.txt | 3 + src/KDSoapClient/KDSoapMessage.h | 1 + src/KDSoapClient/KDSoapUdpClient.cpp | 134 ++++++++++ src/KDSoapClient/KDSoapUdpClient.h | 139 +++++++++++ src/KDSoapClient/KDSoapUdpClient_p.h | 47 ++++ unittests/CMakeLists.txt | 1 + unittests/soap_over_udp/CMakeLists.txt | 9 + .../1.1/os/wsdd-discovery-1.1-schema-os.xsd | 230 ++++++++++++++++++ .../soap_over_udp/test_soap_over_udp.cpp | 173 +++++++++++++ .../soap_over_udp/wsdd-discovery-200901.wsdl | 136 +++++++++++ .../www.w3.org/2006/03/addressing/ws-addr.xsd | 137 +++++++++++ 12 files changed, 1011 insertions(+) create mode 100644 src/KDSoapClient/KDSoapUdpClient.cpp create mode 100644 src/KDSoapClient/KDSoapUdpClient.h create mode 100644 src/KDSoapClient/KDSoapUdpClient_p.h create mode 100644 unittests/soap_over_udp/CMakeLists.txt create mode 100644 unittests/soap_over_udp/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-schema-os.xsd create mode 100644 unittests/soap_over_udp/test_soap_over_udp.cpp create mode 100644 unittests/soap_over_udp/wsdd-discovery-200901.wsdl create mode 100644 unittests/soap_over_udp/www.w3.org/2006/03/addressing/ws-addr.xsd diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt index b954b1290..c17bd1e82 100644 --- a/doc/CHANGES_1_9.txt +++ b/doc/CHANGES_1_9.txt @@ -4,6 +4,7 @@ General: Client-side: ============ * Add support for selecting WS-Addressing namespace for send messages +* Add support for implementing SOAP-over-UDP clients (see KDSoapUdpClient) Server-side: ============ diff --git a/src/KDSoapClient/CMakeLists.txt b/src/KDSoapClient/CMakeLists.txt index dd4776840..7fdd642f1 100644 --- a/src/KDSoapClient/CMakeLists.txt +++ b/src/KDSoapClient/CMakeLists.txt @@ -29,6 +29,7 @@ set(SOURCES KDSoapMessageAddressingProperties.cpp KDSoapEndpointReference.cpp KDQName.cpp + KDSoapUdpClient.cpp ) add_library(kdsoap ${KDSoap_LIBRARY_MODE} ${SOURCES}) @@ -69,6 +70,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapPendingCall KDSoapAuthentication KDQName + KDSoapUdpClient COMMON_HEADER KDSoapClient ) @@ -91,6 +93,7 @@ if(KDSoap_IS_ROOT_PROJECT) KDSoapMessageAddressingProperties.h KDSoapEndpointReference.h KDQName.h + KDSoapUdpClient.h DESTINATION ${INSTALL_INCLUDE_DIR}/KDSoapClient ) diff --git a/src/KDSoapClient/KDSoapMessage.h b/src/KDSoapClient/KDSoapMessage.h index 4b1c10e81..dfb47825d 100644 --- a/src/KDSoapClient/KDSoapMessage.h +++ b/src/KDSoapClient/KDSoapMessage.h @@ -212,5 +212,6 @@ class KDSOAP_EXPORT KDSoapHeaders : public QList //krazy:exclude= KDSOAP_EXPORT QDebug operator<<(QDebug dbg, const KDSoapMessage &msg); Q_DECLARE_METATYPE(KDSoapMessage) +Q_DECLARE_METATYPE(KDSoapHeaders) #endif // KDSOAPMESSAGE_H diff --git a/src/KDSoapClient/KDSoapUdpClient.cpp b/src/KDSoapClient/KDSoapUdpClient.cpp new file mode 100644 index 000000000..82370e41f --- /dev/null +++ b/src/KDSoapClient/KDSoapUdpClient.cpp @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2019 Casper Meijn + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "KDSoapUdpClient.h" +#include "KDSoapUdpClient_p.h" + +#include "KDSoapMessage.h" +#include "KDSoapMessageReader_p.h" +#include "KDSoapMessageWriter_p.h" +#include + +static const QHostAddress AnyIPv4(QLatin1String("0.0.0.0")); + +static bool isMulticastAddress(const QHostAddress &address) { + if (address.protocol() == QAbstractSocket::IPv4Protocol) { + return address.isInSubnet(QHostAddress (QLatin1String("224.0.0.0")), 4); + } else if (address.protocol() == QAbstractSocket::IPv6Protocol) { + return address.isInSubnet(QHostAddress (QLatin1String("ff00::")), 8); + } + return false; +} + +KDSoapUdpClient::KDSoapUdpClient(QObject *parent) : + QObject(parent), + d_ptr(new KDSoapUdpClientPrivate(this)) +{ + Q_D(KDSoapUdpClient); + d->socketIPv4 = new QUdpSocket(this); + connect(d->socketIPv4, SIGNAL(readyRead()), d, SLOT(readyRead())); + d->socketIPv6 = new QUdpSocket(this); + connect(d->socketIPv6, SIGNAL(readyRead()), d, SLOT(readyRead())); +} + +KDSoapUdpClient::~KDSoapUdpClient() +{ + delete d_ptr; +} + +bool KDSoapUdpClient::bind(quint16 port, QAbstractSocket::BindMode mode) { + Q_D(KDSoapUdpClient); + bool rc = true; + // Workaround for lack of dual stack sockets in Qt4 + // Qt5 supports binding to QHostAddress::Any, which will listen on both IPv4 and IPv6 interfaces. + rc = d->socketIPv4->bind(AnyIPv4, port, mode) && rc; + rc = d->socketIPv6->bind(QHostAddress::AnyIPv6, port, mode) && rc; + return rc; +} + +void KDSoapUdpClient::setSoapVersion(KDSoap::SoapVersion version) { + Q_D(KDSoapUdpClient); + d->soapVersion = version; +} + +bool KDSoapUdpClient::sendMessage(const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port) { + Q_D(KDSoapUdpClient); + KDSoapMessageWriter msgWriter; + msgWriter.setVersion(d->soapVersion); + const QByteArray data = msgWriter.messageToXml(message, QString(), headers, QMap()); + + if (isMulticastAddress(address)) { + bool anySuccess = false; + const auto& allInterfaces = QNetworkInterface::allInterfaces(); + for (const auto &iface : allInterfaces) { + if (iface.flags().testFlag(QNetworkInterface::IsUp) && + iface.flags().testFlag(QNetworkInterface::CanMulticast)) { + //qDebug() << "Sending multicast to" << iface.name() << address << ":" << data; + if (address.protocol() == QAbstractSocket::IPv4Protocol) { + d->socketIPv4->setMulticastInterface(iface); + qint64 writtenSize = d->socketIPv4->writeDatagram(data, address, port); + anySuccess = anySuccess || (writtenSize == data.size()); + } else if (address.protocol() == QAbstractSocket::IPv6Protocol) { + d->socketIPv6->setMulticastInterface(iface); + qint64 writtenSize = d->socketIPv6->writeDatagram(data, address, port); + anySuccess = anySuccess || (writtenSize == data.size()); + } + } + } + return anySuccess; + } else { + //qDebug() << "Sending to" << address << ":" << data; + if (address.protocol() == QAbstractSocket::IPv4Protocol) { + qint64 writtenSize = d->socketIPv4->writeDatagram(data, address, port); + return writtenSize == data.size(); + } else if (address.protocol() == QAbstractSocket::IPv6Protocol) { + qint64 writtenSize = d->socketIPv6->writeDatagram(data, address, port); + return writtenSize == data.size(); + } + } + return false; +} + +void KDSoapUdpClientPrivate::readyRead() +{ + QUdpSocket *socket = qobject_cast(sender()); + while (socket->hasPendingDatagrams()) { + qint64 size = socket->pendingDatagramSize(); + + QByteArray buffer; + buffer.resize(size); + QHostAddress senderAddress; + quint16 senderPort; + socket->readDatagram(buffer.data(), buffer.size(), &senderAddress, &senderPort); + + receivedDatagram(buffer, senderAddress, senderPort); + } +} + +void KDSoapUdpClientPrivate::receivedDatagram(const QByteArray &messageData, const QHostAddress &senderAddress, quint16 senderPort) +{ + Q_Q(KDSoapUdpClient); + //qDebug() << "Received datagram from:" << senderAddress << "data:" << QString::fromUtf8(messageData); + + KDSoapMessage replyMessage; + KDSoapHeaders replyHeaders; + + KDSoapMessageReader reader; + reader.xmlToMessage(messageData, &replyMessage, 0, &replyHeaders, soapVersion); + + emit q->receivedMessage(replyMessage, replyHeaders, senderAddress, senderPort); +} diff --git a/src/KDSoapClient/KDSoapUdpClient.h b/src/KDSoapClient/KDSoapUdpClient.h new file mode 100644 index 000000000..5f127fa8b --- /dev/null +++ b/src/KDSoapClient/KDSoapUdpClient.h @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2019 Casper Meijn + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef KDSOAPUDPCLIENT_H +#define KDSOAPUDPCLIENT_H + +#include "KDSoapGlobal.h" +#include "KDSoapClientInterface.h" + +#include +#include + +class KDSoapHeaders; +class KDSoapMessage; +class KDSoapUdpClientPrivate; +QT_BEGIN_NAMESPACE +class QHostAddress; +QT_END_NAMESPACE + +/** + * \brief KDSoapUdpClient provides an interface for implementing a [SOAP-over-UDP](https://docs.oasis-open.org/ws-dd/soapoverudp/1.1/os/wsdd-soapoverudp-1.1-spec-os.html) client. + * + * One-way SOAP-over-UDP can be send by simply using sendMessage(). + * + * Request-response SOAP-over-UDP is supported by bind()ing to a sender UDP + * port. You can send the request using sendMessage() and the response will is + * signaled using receivedMessage(). receivedMessage() will signal any response, + * including those of other requests, there is no help with finding the correct + * response. The WS-Addressing properties of the message can be used to filter + * the received responses. + * + * \code + * auto soapUdpClient = new KDSoapUdpClient(this); + * connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port) { + * if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { + * TNS__ProbeMatchesType probeMatches; + * probeMatches.deserialize(message); + * qDebug() << "Received probe match from" << address; + * } + * }); + * soapUdpClient->bind(3702); + * + * TNS__ProbeType probe; + * + * KDSoapMessage message; + * message = probe.serialize(QStringLiteral("Probe")); + * message.setUse(KDSoapMessage::LiteralUse); + * message.setNamespaceUri(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01")); + * + * KDSoapMessageAddressingProperties addressing; + * addressing.setAction(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe")); + * addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString(QUuid::WithoutBraces)); + * addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); + * addressing.setReplyEndpointAddress(KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous)); + * message.setMessageAddressingProperties(addressing); + * + * soapUdpClient->sendMessage(message, KDSoapHeaders(), QHostAddress("239.255.255.250"), 3702); + * \endcode + * + * \since 1.9 + */ +class KDSOAP_EXPORT KDSoapUdpClient : public QObject +{ + Q_OBJECT + +public: + explicit KDSoapUdpClient(QObject *parent=nullptr); + + ~KDSoapUdpClient(); + + /** + * Bind UDP socket to port. This is needed to recieve messages. Both the + * IPv4 and IPv6 port will be bound. + * \param port The UDP port to bind to. When port is 0, a random port is chosen. + * \param mode This is passed directly to QUdpSocket::bind(). + * \see receivedMessage() + * \since 1.9 + */ + bool bind(quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform); + + /** + * Sets the SOAP version to be used for any subsequent send message. + * \param version #SOAP1_1 or #SOAP1_2 + * The default version is SOAP 1.2. + */ + void setSoapVersion(KDSoap::SoapVersion version); + +public Q_SLOTS: + /** + * Send a SOAP-over-UDP message to IP address. + * \param message The actual message to be send. Use + * KDSoapMessage::setMessageAddressingProperties() to set the WS-Addressing + * properties of the message. + * \param headers can be used to add additional SOAP headers. + * \param address The address to send to message to. Messages send to a + * multicast address will be send to to all interfaces. + * \param port The UDP port to send the message to + * \since 1.9 + */ + bool sendMessage(const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port); + +Q_SIGNALS: + /** + * emitted when a SOAP-over-UDP message is received over a bound socket. + * KDSoapUdpClient doesn't do any filtering, so duplicate messages, spoofed + * or responses to other requests will all be received. For example, if a + * message is send via both IPv4 and IPv6, then the receivedMessage will be + * emitted twice (with the same message, but with a different address) + * \param message The parsed message received over the socket. Use + * KDSoapMessage::messageAddressingProperties() to see who the recipient is + * and what SOAP action is requested. + * \param headers The additional headers of the message + * \param address The IP-address of the sender + * \param port The UDP port of the sender + * \see bind() + * \since 1.9 + */ + void receivedMessage(const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port); + +private: + KDSoapUdpClientPrivate *const d_ptr; + Q_DECLARE_PRIVATE(KDSoapUdpClient) +}; + +#endif // KDSOAPUDPCLIENT_H diff --git a/src/KDSoapClient/KDSoapUdpClient_p.h b/src/KDSoapClient/KDSoapUdpClient_p.h new file mode 100644 index 000000000..29e429554 --- /dev/null +++ b/src/KDSoapClient/KDSoapUdpClient_p.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2019 Casper Meijn + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef KDSOAPUDPCLIENT_P_H +#define KDSOAPUDPCLIENT_P_H + +#include +#include + +class KDSoapUdpClientPrivate : public QObject +{ + Q_OBJECT +public: + KDSoapUdpClientPrivate(KDSoapUdpClient *q) + : q_ptr(q) + {} + + void receivedDatagram(const QByteArray &messageData, const QHostAddress &senderAddress, quint16 senderPort); + +public Q_SLOTS: + void readyRead(); + +public: + QUdpSocket *socketIPv4; + QUdpSocket *socketIPv6; + KDSoap::SoapVersion soapVersion = KDSoap::SOAP1_2; + +private: + KDSoapUdpClient *const q_ptr; + Q_DECLARE_PUBLIC(KDSoapUdpClient) +}; + +#endif // KDSOAPUDPCLIENT_P_H diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 978e3aee7..3b73b4f06 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -74,6 +74,7 @@ add_subdirectory(ws_addressing_support) add_subdirectory(ws_usernametoken_support) add_subdirectory(empty_element_wsdl) add_subdirectory(ws_discovery_wsdl) +add_subdirectory(soap_over_udp) # These need internet access add_subdirectory(webcalls) diff --git a/unittests/soap_over_udp/CMakeLists.txt b/unittests/soap_over_udp/CMakeLists.txt new file mode 100644 index 000000000..d1b44df42 --- /dev/null +++ b/unittests/soap_over_udp/CMakeLists.txt @@ -0,0 +1,9 @@ +project(soap_over_udp) + +set(KSWSDL2CPP_OPTION -use-local-files-only) +set(WSDL_FILES wsdd-discovery-200901.wsdl) +set(soap_over_udp_SRCS test_soap_over_udp.cpp wsdl_wsdd-discovery-200901.cpp) + +set(EXTRA_LIBS ${QT_QTXML_LIBRARY}) + +add_unittest(${soap_over_udp_SRCS} ) diff --git a/unittests/soap_over_udp/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-schema-os.xsd b/unittests/soap_over_udp/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-schema-os.xsd new file mode 100644 index 000000000..3307efc1d --- /dev/null +++ b/unittests/soap_over_udp/docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-schema-os.xsd @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp new file mode 100644 index 000000000..53a35483b --- /dev/null +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -0,0 +1,173 @@ +/**************************************************************************** +** Copyright (C) 2019 Casper Meijn +** All rights reserved. +** +** This file is part of the KD Soap library. +** +** Licensees holding valid commercial KD Soap licenses may use this file in +** accordance with the KD Soap Commercial License Agreement provided with +** the Software. +** +** +** This file may be distributed and/or modified under the terms of the +** GNU Lesser General Public License version 2.1 and version 3 as published by the +** Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** Contact info@kdab.com if any conditions of this licensing are not +** clear to you. +** +**********************************************************************/ + +#include "httpserver_p.h" +#include "KDSoapUdpClient.h" +#include "KDSoapUdpClient_p.h" +#include "KDSoapMessage.h" +#include +#include +#include +#include "wsdl_wsdd-discovery-200901.h" + +Q_DECLARE_METATYPE(QHostAddress) + +class SoapOverUdpTest : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase() { + qRegisterMetaType("KDSoapMessage"); + qRegisterMetaType("KDSoapHeaders"); + qRegisterMetaType("QHostAddress"); + } + + void testExample() { + // This is the example from the KDSoapUdpClient documentation. It is + // here for compile testing. + + auto soapUdpClient = new KDSoapUdpClient(this); + connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage& message, const KDSoapHeaders& headers, const QHostAddress& address, quint16 port) { + if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { + TNS__ProbeMatchesType probeMatches; + probeMatches.deserialize(message); + qDebug() << "Received probe match from" << address; + } + }); + soapUdpClient->bind(3702); + + TNS__ProbeType probe; + + KDSoapMessage message; + message = probe.serialize(QStringLiteral("Probe")); + message.setUse(KDSoapMessage::LiteralUse); + message.setNamespaceUri(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01")); + + KDSoapMessageAddressingProperties addressing; + addressing.setAction(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe")); + addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString(QUuid::WithoutBraces)); + addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); + addressing.setReplyEndpointAddress(KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous)); + message.setMessageAddressingProperties(addressing); + + soapUdpClient->sendMessage(message, KDSoapHeaders(), QHostAddress("239.255.255.250"), 3702); + } + + void testSendMessage() { + QUdpSocket testSocket; + bool rc = testSocket.bind(); + QVERIFY(rc); + + KDSoapUdpClient udpClient; + + udpClient.sendMessage(exampleMessage(), KDSoapHeaders(), QHostAddress::LocalHost, testSocket.localPort()); + + QVERIFY(testSocket.hasPendingDatagrams()); + auto datagram = testSocket.receiveDatagram(); + + QVERIFY(KDSoapUnitTestHelpers::xmlBufferCompare(datagram.data(), exampleTextData())); + } + + void testReceiveMessage() { + QUdpSocket testSocket; + + KDSoapUdpClient udpClient; + bool rc = udpClient.bind(12345); + QVERIFY(rc); + + QSignalSpy spy(&udpClient, SIGNAL(receivedMessage(KDSoapMessage, KDSoapHeaders, QHostAddress, quint16))); + + auto data = exampleTextData(); + qint64 size = testSocket.writeDatagram(data, QHostAddress::LocalHost, 12345); + QCOMPARE(size, data.size()); + + QVERIFY(spy.wait(1000)); + QList arguments = spy.takeFirst(); + QVERIFY(KDSoapUnitTestHelpers::xmlBufferCompare(arguments.at(0).value().toXml(), exampleMessage().toXml())); + QCOMPARE(arguments.at(1).value().size(), 0); + QCOMPARE(arguments.at(2).value(), QHostAddress::LocalHost); + } + +private: + QByteArray exampleTextData() { + return QByteArray( + "" + "" + " " + " urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01" + " http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe" + " urn:uuid:0a6dc791-2be6-4991-9af1-454778a1917a" + " " + " " + " " + " i:PrintBasic" + " ldap:///ou=engineering,o=examplecom,c=us" + " " + " " + ""); + } + + KDSoapMessage exampleMessage() { + TNS__ProbeType probe; + + KDQName type("i:PrintBasic"); + type.setNameSpace("http://printer.example.org/2003/imaging"); + TNS__QNameListType types; + types.setEntries(QList() << type); + probe.setTypes(types); + + TNS__UriListType scopeValues; + scopeValues.setEntries(QStringList() << "ldap:///ou=engineering,o=examplecom,c=us"); + TNS__ScopesType scopes; + scopes.setValue(scopeValues); + scopes.setMatchBy("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ldap"); + probe.setScopes(scopes); + + KDSoapMessage message; + message = probe.serialize(QStringLiteral("Probe")); + message.setUse(KDSoapMessage::LiteralUse); + message.setNamespaceUri(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01")); + + KDSoapMessageAddressingProperties addressing; + addressing.setAddressingNamespace(KDSoapMessageAddressingProperties::Addressing200508); + addressing.setAction(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe")); + addressing.setMessageID(QStringLiteral("urn:uuid:0a6dc791-2be6-4991-9af1-454778a1917a")); + addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); + message.setMessageAddressingProperties(addressing); + + return message; + } +}; + +QTEST_MAIN(SoapOverUdpTest) + +#include "test_soap_over_udp.moc" diff --git a/unittests/soap_over_udp/wsdd-discovery-200901.wsdl b/unittests/soap_over_udp/wsdd-discovery-200901.wsdl new file mode 100644 index 000000000..e438a4d9e --- /dev/null +++ b/unittests/soap_over_udp/wsdd-discovery-200901.wsdl @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/unittests/soap_over_udp/www.w3.org/2006/03/addressing/ws-addr.xsd b/unittests/soap_over_udp/www.w3.org/2006/03/addressing/ws-addr.xsd new file mode 100644 index 000000000..47362edbe --- /dev/null +++ b/unittests/soap_over_udp/www.w3.org/2006/03/addressing/ws-addr.xsd @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9a8d51b1f5964554f152db9186c0750411777e3b Mon Sep 17 00:00:00 2001 From: anoy Date: Wed, 30 Oct 2019 11:18:21 +0100 Subject: [PATCH 107/679] changed some missing nullptr (#191) --- kdwsdl2cpp/libkode/printer.cpp | 4 ++-- kdwsdl2cpp/src/compiler.cpp | 2 +- kdwsdl2cpp/src/converter_clientstub.cpp | 2 +- src/KDSoapServer/KDSoapDelayedResponseHandle.cpp | 3 ++- src/KDSoapServer/KDSoapServer.cpp | 4 ++-- src/KDSoapServer/KDSoapServerAuthInterface.cpp | 2 +- .../KDSoapServerCustomVerbRequestInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerObjectInterface.cpp | 4 ++-- src/KDSoapServer/KDSoapServerRawXMLInterface.cpp | 2 +- src/KDSoapServer/KDSoapServerSocket.cpp | 10 +++++----- src/KDSoapServer/KDSoapServerThread.cpp | 6 +++--- src/KDSoapServer/KDSoapThreadPool.cpp | 6 +++--- 12 files changed, 24 insertions(+), 23 deletions(-) diff --git a/kdwsdl2cpp/libkode/printer.cpp b/kdwsdl2cpp/libkode/printer.cpp index 7d208b739..329a87034 100644 --- a/kdwsdl2cpp/libkode/printer.cpp +++ b/kdwsdl2cpp/libkode/printer.cpp @@ -377,7 +377,7 @@ QString Printer::Private::classImplementation( const Class &classObject, bool ne code.newLine(); code.indent(); code += "delete " + classObject.dPointerName() + ";"; - code += classObject.dPointerName() + " = 0;"; + code += classObject.dPointerName() + " = nullptr;"; code.unindent(); } code += '}'; @@ -600,7 +600,7 @@ QString Printer::functionSignature( const Function &function, if ( function.isConst() ) s += " const"; - + if ( function.virtualMode() == Function::Override && !forImplementation ) { s += " override"; } diff --git a/kdwsdl2cpp/src/compiler.cpp b/kdwsdl2cpp/src/compiler.cpp index d310cccc0..e0e4cbfe4 100644 --- a/kdwsdl2cpp/src/compiler.cpp +++ b/kdwsdl2cpp/src/compiler.cpp @@ -36,7 +36,7 @@ using namespace KWSDL; Compiler::Compiler() - : QObject(0) + : QObject(nullptr) { } diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index 03f9ac626..b4711b606 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -118,7 +118,7 @@ bool Converter::convertClientService() // Variables (which will go into the d pointer) KODE::MemberVariable clientInterfaceVar(QLatin1String("m_clientInterface"), QLatin1String("KDSoapClientInterface*")); - clientInterfaceVar.setInitializer(QLatin1String("NULL")); + clientInterfaceVar.setInitializer(QLatin1String("nullptr")); newClass.addMemberVariable(clientInterfaceVar); KODE::MemberVariable lastReply(QLatin1String("m_lastReply"), QLatin1String("KDSoapMessage")); diff --git a/src/KDSoapServer/KDSoapDelayedResponseHandle.cpp b/src/KDSoapServer/KDSoapDelayedResponseHandle.cpp index e44486ed2..f331f10a1 100644 --- a/src/KDSoapServer/KDSoapDelayedResponseHandle.cpp +++ b/src/KDSoapServer/KDSoapDelayedResponseHandle.cpp @@ -36,7 +36,8 @@ class KDSoapDelayedResponseHandleData : public QSharedData QPointer socket; }; -KDSoapDelayedResponseHandle::KDSoapDelayedResponseHandle() : data(new KDSoapDelayedResponseHandleData(0)) +KDSoapDelayedResponseHandle::KDSoapDelayedResponseHandle() + : data(new KDSoapDelayedResponseHandleData(nullptr)) { } diff --git a/src/KDSoapServer/KDSoapServer.cpp b/src/KDSoapServer/KDSoapServer.cpp index ce081481a..4eea7a303 100644 --- a/src/KDSoapServer/KDSoapServer.cpp +++ b/src/KDSoapServer/KDSoapServer.cpp @@ -36,8 +36,8 @@ class KDSoapServer::Private { public: Private() - : m_threadPool(0), - m_mainThreadSocketList(0), + : m_threadPool(nullptr), + m_mainThreadSocketList(nullptr), m_use(KDSoapMessage::LiteralUse), m_logLevel(KDSoapServer::LogNothing), m_path(QString::fromLatin1("/")), diff --git a/src/KDSoapServer/KDSoapServerAuthInterface.cpp b/src/KDSoapServer/KDSoapServerAuthInterface.cpp index 566d70316..9311954f5 100644 --- a/src/KDSoapServer/KDSoapServerAuthInterface.cpp +++ b/src/KDSoapServer/KDSoapServerAuthInterface.cpp @@ -25,7 +25,7 @@ #include KDSoapServerAuthInterface::KDSoapServerAuthInterface() - : d(0) + : d(nullptr) { } diff --git a/src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.cpp b/src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.cpp index 0b2818ff5..a1d6bd500 100644 --- a/src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.cpp +++ b/src/KDSoapServer/KDSoapServerCustomVerbRequestInterface.cpp @@ -24,7 +24,7 @@ #include "KDSoapServerCustomVerbRequestInterface.h" KDSoapServerCustomVerbRequestInterface::KDSoapServerCustomVerbRequestInterface() - : d(0) + : d(nullptr) { } diff --git a/src/KDSoapServer/KDSoapServerObjectInterface.cpp b/src/KDSoapServer/KDSoapServerObjectInterface.cpp index bcfe9a438..3b730a32c 100644 --- a/src/KDSoapServer/KDSoapServerObjectInterface.cpp +++ b/src/KDSoapServer/KDSoapServerObjectInterface.cpp @@ -30,7 +30,7 @@ class KDSoapServerObjectInterface::Private { public: Private() : - m_serverSocket(0) + m_serverSocket(nullptr) { } @@ -78,7 +78,7 @@ QIODevice *KDSoapServerObjectInterface::processFileRequest(const QString &path, { Q_UNUSED(path); Q_UNUSED(contentType); - return 0; + return nullptr; } void KDSoapServerObjectInterface::processRequestWithPath(const KDSoapMessage &request, KDSoapMessage &response, const QByteArray &soapAction, const QString &path) diff --git a/src/KDSoapServer/KDSoapServerRawXMLInterface.cpp b/src/KDSoapServer/KDSoapServerRawXMLInterface.cpp index 8407912e5..f6d1692d9 100644 --- a/src/KDSoapServer/KDSoapServerRawXMLInterface.cpp +++ b/src/KDSoapServer/KDSoapServerRawXMLInterface.cpp @@ -24,7 +24,7 @@ #include "KDSoapServerRawXMLInterface.h" KDSoapServerRawXMLInterface::KDSoapServerRawXMLInterface() - : d(0) + : d(nullptr) { } diff --git a/src/KDSoapServer/KDSoapServerSocket.cpp b/src/KDSoapServer/KDSoapServerSocket.cpp index 43f4c9d3d..a2be5abb5 100644 --- a/src/KDSoapServer/KDSoapServerSocket.cpp +++ b/src/KDSoapServer/KDSoapServerSocket.cpp @@ -79,9 +79,9 @@ static HeadersMap parseHeaders(const QByteArray &headerData) qDebug() << "Malformed HTTP request:" << firstLine; return headersMap; } - const QByteArray requestType = firstLine.at(0); + const QByteArray& requestType = firstLine.at(0); const QByteArray path = QDir::cleanPath(QString::fromLatin1(firstLine.at(1).constData())).toLatin1(); - const QByteArray httpVersion = firstLine.at(2); + const QByteArray& httpVersion = firstLine.at(2); headersMap.insert("_requestType", requestType); headersMap.insert("_path", path); headersMap.insert("_httpVersion", httpVersion); @@ -273,7 +273,7 @@ void KDSoapServerSocket::slotReadyRead() } m_requestBuffer.clear(); m_httpHeaders.clear(); - m_receivedData = 0; + m_receivedData = false; } void KDSoapServerSocket::handleRequest(const QMap &httpHeaders, const QByteArray &receivedData) @@ -316,7 +316,7 @@ void KDSoapServerSocket::handleRequest(const QMap &httpH if (!serverObjectInterface) { const QString error = QString::fromLatin1("Server object %1 does not implement KDSoapServerObjectInterface!").arg(QString::fromLatin1(m_serverObject->metaObject()->className())); handleError(replyMsg, "Server.ImplementationError", error); - sendReply(0, replyMsg); + sendReply(nullptr, replyMsg); return; } else { serverObjectInterface->setServerSocket(this); @@ -333,7 +333,7 @@ void KDSoapServerSocket::handleRequest(const QMap &httpH // We could implement it, but there's no SOAP request, just a query in the URL, // which we'd have to pass to a different virtual than processRequest. handleError(replyMsg, "Client.Data", QString::fromLatin1("Support for GET requests not implemented yet.")); - sendReply(0, replyMsg); + sendReply(nullptr, replyMsg); return; } diff --git a/src/KDSoapServer/KDSoapServerThread.cpp b/src/KDSoapServer/KDSoapServerThread.cpp index ac3115040..aff4aa2a0 100644 --- a/src/KDSoapServer/KDSoapServerThread.cpp +++ b/src/KDSoapServer/KDSoapServerThread.cpp @@ -28,7 +28,7 @@ #include KDSoapServerThread::KDSoapServerThread(QObject *parent) - : QThread(parent), d(0) + : QThread(parent), d(nullptr) { qRegisterMetaType("KDSoapServer*"); qRegisterMetaType("QSemaphore*"); @@ -44,7 +44,7 @@ void KDSoapServerThread::run() d = &impl; m_semaphore.release(); exec(); - d = 0; + d = nullptr; } int KDSoapServerThread::socketCount() const @@ -105,7 +105,7 @@ void KDSoapServerThread::handleIncomingConnection(int socketDescriptor, KDSoapSe //// KDSoapServerThreadImpl::KDSoapServerThreadImpl() - : QObject(0), m_incomingConnectionCount(0) + : QObject(nullptr), m_incomingConnectionCount(0) { } diff --git a/src/KDSoapServer/KDSoapThreadPool.cpp b/src/KDSoapServer/KDSoapThreadPool.cpp index 1510e6d25..f62f208dc 100644 --- a/src/KDSoapServer/KDSoapThreadPool.cpp +++ b/src/KDSoapServer/KDSoapThreadPool.cpp @@ -71,10 +71,10 @@ int KDSoapThreadPool::maxThreadCount() const KDSoapServerThread *KDSoapThreadPool::Private::chooseNextThread() { - KDSoapServerThread *chosenThread = 0; + KDSoapServerThread *chosenThread = nullptr; // Try to pick an existing thread int minSocketCount = 0; - KDSoapServerThread *bestThread = 0; + KDSoapServerThread *bestThread = nullptr; ThreadCollection::const_iterator it = m_threads.constBegin(); for (; it != m_threads.constEnd(); ++it) { KDSoapServerThread *thr = *it; @@ -103,7 +103,7 @@ KDSoapServerThread *KDSoapThreadPool::Private::chooseNextThread() // Create new thread if (!chosenThread) { - chosenThread = new KDSoapServerThread(0); + chosenThread = new KDSoapServerThread(nullptr); //qDebug() << "Creating KDSoapServerThread" << chosenThread; m_threads.append(chosenThread); chosenThread->startThread(); From c6616bf9c93f0a82fa5a98789e4b248b51a048e3 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Wed, 30 Oct 2019 11:25:31 +0100 Subject: [PATCH 108/679] add qmake support for soap over udp (#192) * fix trailing whitespaces * add qmake support for soap over udp was missing in e0a3bbce1e527f3a5734adb66628b264176faf70 which introduced soap over udp but neglected to add it to qmake * add missing include the private header previously was not self-sufficient, making moc angry --- src/KDSoapClient/KDSoapClient.pro | 7 +++++-- src/KDSoapClient/KDSoapUdpClient_p.h | 8 +++++--- unittests/soap_over_udp/soap_over_udp.pro | 10 ++++++++++ unittests/unittests.pro | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 unittests/soap_over_udp/soap_over_udp.pro diff --git a/src/KDSoapClient/KDSoapClient.pro b/src/KDSoapClient/KDSoapClient.pro index 0cd24fff0..9b2547955 100644 --- a/src/KDSoapClient/KDSoapClient.pro +++ b/src/KDSoapClient/KDSoapClient.pro @@ -24,14 +24,16 @@ INSTALLHEADERS = KDSoapMessage.h \ KDDateTime.h \ KDSoapFaultException.h \ KDSoapMessageAddressingProperties.cpp \ - KDSoapEndpointReference.cpp + KDSoapEndpointReference.cpp \ + KDSoapUdpClient.h PRIVATEHEADERS = KDSoapPendingCall_p.h \ KDSoapPendingCallWatcher_p.h \ KDSoapClientInterface_p.h \ KDSoapClientThread_p.h \ KDSoapMessageReader_p.h \ KDSoapMessageWriter_p.h \ - KDSoapNamespacePrefixes_p.h + KDSoapNamespacePrefixes_p.h \ + KDSoapUdpClient_p.h HEADERS = $$INSTALLHEADERS \ $$PRIVATEHEADERS \ KDSoapReplySslHandler_p.h \ @@ -56,6 +58,7 @@ SOURCES = KDSoapMessage.cpp \ KDSoapMessageAddressingProperties.cpp \ KDSoapEndpointReference.cpp \ KDQName.cpp \ + KDSoapUdpClient.cpp \ DEFINES += KDSOAP_BUILD_KDSOAP_LIB diff --git a/src/KDSoapClient/KDSoapUdpClient_p.h b/src/KDSoapClient/KDSoapUdpClient_p.h index 29e429554..dffd69957 100644 --- a/src/KDSoapClient/KDSoapUdpClient_p.h +++ b/src/KDSoapClient/KDSoapUdpClient_p.h @@ -21,6 +21,8 @@ #include #include +#include "KDSoapUdpClient.h" + class KDSoapUdpClientPrivate : public QObject { Q_OBJECT @@ -28,12 +30,12 @@ class KDSoapUdpClientPrivate : public QObject KDSoapUdpClientPrivate(KDSoapUdpClient *q) : q_ptr(q) {} - + void receivedDatagram(const QByteArray &messageData, const QHostAddress &senderAddress, quint16 senderPort); - + public Q_SLOTS: void readyRead(); - + public: QUdpSocket *socketIPv4; QUdpSocket *socketIPv6; diff --git a/unittests/soap_over_udp/soap_over_udp.pro b/unittests/soap_over_udp/soap_over_udp.pro new file mode 100644 index 000000000..0f1af0bb0 --- /dev/null +++ b/unittests/soap_over_udp/soap_over_udp.pro @@ -0,0 +1,10 @@ +KDWSDL_OPTIONS = -use-local-files-only +include( $${TOP_SOURCE_DIR}/unittests/unittests.pri ) +QT += xml +SOURCES = test_soap_over_udp.cpp +test.target = test +test.commands = ./$(TARGET) +test.depends = $(TARGET) +QMAKE_EXTRA_TARGETS += test + +KDWSDL = wsdd-discovery-200901.wsdl diff --git a/unittests/unittests.pro b/unittests/unittests.pro index 94d021abf..bb7c9e329 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -50,7 +50,8 @@ SUBDIRS = \ ws_addressing_support \ ws_usernametoken_support \ list_restriction \ - QSharedPointer_include + QSharedPointer_include \ + soap_over_udp # These need internet access SUBDIRS += webcalls webcalls_wsdl From 9cf8a4df84f2ef82957c2d59dad86545764a9835 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Wed, 30 Oct 2019 11:27:33 +0100 Subject: [PATCH 109/679] Fix WS-Addressing spec compliance (#193) as per https://www.w3.org/Submission/ws-addressing/ the only well-known uri in 2004/08 was anonymous and it has a role prefix. from the implicit reading I can find on earlier versions the same applies to them. so, when constructing the well-known URIs inject a role prefix when dealing with specs up to 2004/08 and raise a warning when attempting to use anything but anonymous same for /id/unspecified --- .../KDSoapMessageAddressingProperties.cpp | 51 +++++++++++++++---- .../wsaddressingtest.cpp | 12 +++-- 2 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp index cad3d68eb..1e0f506ed 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp @@ -217,20 +217,41 @@ KDSoapMessageAddressingProperties::~KDSoapMessageAddressingProperties() QString KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::KDSoapAddressingPredefinedAddress address, KDSoapAddressingNamespace addressingNamespace) { - const QString addressingNS = addressingNamespaceToString(addressingNamespace); + QString prefix = addressingNamespaceToString(addressingNamespace); + switch (addressingNamespace) { + case Addressing200303: + case Addressing200403: + case Addressing200408: { + switch (address) { + case Anonymous: + prefix += QLatin1String("/role"); + break; + case Unspecified: + prefix += QLatin1String("/id"); + break; + default: + qWarning("Anything but Anonymous or Unspecified has no meaning in ws-addressing 2004/08 and earlier"); + return QString(); + } + break; + } + default: + break; + } + switch (address) { case Anonymous: - return addressingNS + QLatin1String("/anonymous"); + return prefix + QLatin1String("/anonymous"); case None: - return addressingNS + QLatin1String("/none"); + return prefix + QLatin1String("/none"); case Reply: - return addressingNS + QLatin1String("/reply"); + return prefix + QLatin1String("/reply"); case Unspecified: - return addressingNS + QLatin1String("/unspecified"); - default: - Q_ASSERT(false); // should never happen - return QString(); + return prefix + QLatin1String("/unspecified"); } + + Q_ASSERT(false); // should never happen + return QString(); } bool KDSoapMessageAddressingProperties::isWSAddressingNamespace(const QString &namespaceUri) @@ -296,7 +317,19 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN Q_UNUSED(messageNamespace); Q_UNUSED(forceQualified); - if (d->destination == predefinedAddressToString(None, d->addressingNamespace)) { + bool supportsNoneAddressing = false; + switch (d->addressingNamespace) { + case Addressing200303: + case Addressing200403: + case Addressing200408: + supportsNoneAddressing = false; + break; + case Addressing200508: + supportsNoneAddressing = true; + break; + } + + if (supportsNoneAddressing && d->destination == predefinedAddressToString(None, d->addressingNamespace)) { return; } diff --git a/unittests/ws_addressing_support/wsaddressingtest.cpp b/unittests/ws_addressing_support/wsaddressingtest.cpp index 315a4212c..018ccdbc1 100644 --- a/unittests/ws_addressing_support/wsaddressingtest.cpp +++ b/unittests/ws_addressing_support/wsaddressingtest.cpp @@ -53,9 +53,15 @@ private Q_SLOTS: QString unspecified = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Unspecified); QCOMPARE(unspecified, QString("http://www.w3.org/2005/08/addressing/unspecified")); - - QString none200303 = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::None, KDSoapMessageAddressingProperties::Addressing200303); - QCOMPARE(none200303, QString("http://schemas.xmlsoap.org/ws/2003/03/addressing/none")); + + QString reply200303 = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Reply, KDSoapMessageAddressingProperties::Addressing200303); + QCOMPARE(reply200303, QString()); // Reply is not a thing in older than 2005/08 + + QString anon200303 = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous, KDSoapMessageAddressingProperties::Addressing200303); + QCOMPARE(anon200303, QString("http://schemas.xmlsoap.org/ws/2003/03/addressing/role/anonymous")); + + QString unspecified200303 = KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Unspecified, KDSoapMessageAddressingProperties::Addressing200303); + QCOMPARE(unspecified200303, QString("http://schemas.xmlsoap.org/ws/2003/03/addressing/id/unspecified")); } void shouldWriteAProperSoapMessageWithRightsAddressingProperties() From 9916aaf185c0f37ccb7324fa8aa11c69946b850c Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 30 Oct 2019 13:07:09 +0100 Subject: [PATCH 110/679] Fix compilation with Qt <= 5.11; disable UDP unittest for Qt4 --- src/KDSoapClient/KDSoapUdpClient.cpp | 14 ++++++++++++++ src/KDSoapClient/KDSoapUdpClient.h | 7 +++++-- unittests/CMakeLists.txt | 2 ++ unittests/soap_over_udp/test_soap_over_udp.cpp | 6 ++++++ unittests/unittests.pro | 5 +++-- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/KDSoapClient/KDSoapUdpClient.cpp b/src/KDSoapClient/KDSoapUdpClient.cpp index 82370e41f..4e5a539a0 100644 --- a/src/KDSoapClient/KDSoapUdpClient.cpp +++ b/src/KDSoapClient/KDSoapUdpClient.cpp @@ -50,15 +50,29 @@ KDSoapUdpClient::~KDSoapUdpClient() delete d_ptr; } + +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) bool KDSoapUdpClient::bind(quint16 port, QAbstractSocket::BindMode mode) { Q_D(KDSoapUdpClient); bool rc = true; // Workaround for lack of dual stack sockets in Qt4 // Qt5 supports binding to QHostAddress::Any, which will listen on both IPv4 and IPv6 interfaces. + // TODO: use a single socket once we drop Qt4 support rc = d->socketIPv4->bind(AnyIPv4, port, mode) && rc; rc = d->socketIPv6->bind(QHostAddress::AnyIPv6, port, mode) && rc; return rc; } +#else +bool KDSoapUdpClient::bind(quint16 port) { + Q_D(KDSoapUdpClient); + bool rc = true; + // Workaround for lack of dual stack sockets in Qt4 + // Qt5 supports binding to QHostAddress::Any, which will listen on both IPv4 and IPv6 interfaces. + rc = d->socketIPv4->bind(AnyIPv4, port) && rc; + rc = d->socketIPv6->bind(QHostAddress::AnyIPv6, port) && rc; + return rc; +} +#endif void KDSoapUdpClient::setSoapVersion(KDSoap::SoapVersion version) { Q_D(KDSoapUdpClient); diff --git a/src/KDSoapClient/KDSoapUdpClient.h b/src/KDSoapClient/KDSoapUdpClient.h index 5f127fa8b..3ca33ade9 100644 --- a/src/KDSoapClient/KDSoapUdpClient.h +++ b/src/KDSoapClient/KDSoapUdpClient.h @@ -63,7 +63,7 @@ QT_END_NAMESPACE * * KDSoapMessageAddressingProperties addressing; * addressing.setAction(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe")); - * addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString(QUuid::WithoutBraces)); + * addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString(QUuid::WithoutBraces)); // WithoutBraces requires Qt 5.11 * addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); * addressing.setReplyEndpointAddress(KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous)); * message.setMessageAddressingProperties(addressing); @@ -90,8 +90,11 @@ class KDSOAP_EXPORT KDSoapUdpClient : public QObject * \see receivedMessage() * \since 1.9 */ +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) bool bind(quint16 port = 0, QAbstractSocket::BindMode mode = QAbstractSocket::DefaultForPlatform); - +#else + bool bind(quint16 port = 0); +#endif /** * Sets the SOAP version to be used for any subsequent send message. * \param version #SOAP1_1 or #SOAP1_2 diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 3b73b4f06..3b3c6db50 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -74,7 +74,9 @@ add_subdirectory(ws_addressing_support) add_subdirectory(ws_usernametoken_support) add_subdirectory(empty_element_wsdl) add_subdirectory(ws_discovery_wsdl) +if (Qt5Core_FOUND) add_subdirectory(soap_over_udp) +endif() # These need internet access add_subdirectory(webcalls) diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp index 53a35483b..74624e027 100644 --- a/unittests/soap_over_udp/test_soap_over_udp.cpp +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -49,6 +49,8 @@ private Q_SLOTS: auto soapUdpClient = new KDSoapUdpClient(this); connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage& message, const KDSoapHeaders& headers, const QHostAddress& address, quint16 port) { + Q_UNUSED(headers); + Q_UNUSED(port); if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { TNS__ProbeMatchesType probeMatches; probeMatches.deserialize(message); @@ -66,7 +68,11 @@ private Q_SLOTS: KDSoapMessageAddressingProperties addressing; addressing.setAction(QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe")); +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString(QUuid::WithoutBraces)); +#else + addressing.setMessageID(QStringLiteral("urn:uuid:") + QUuid::createUuid().toString()); +#endif addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); addressing.setReplyEndpointAddress(KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous)); message.setMessageAddressingProperties(addressing); diff --git a/unittests/unittests.pro b/unittests/unittests.pro index bb7c9e329..5734a8986 100644 --- a/unittests/unittests.pro +++ b/unittests/unittests.pro @@ -50,8 +50,9 @@ SUBDIRS = \ ws_addressing_support \ ws_usernametoken_support \ list_restriction \ - QSharedPointer_include \ - soap_over_udp + QSharedPointer_include + +greaterThan(QT_MAJOR_VERSION, 4): SUBDIRS += soap_over_udp # These need internet access SUBDIRS += webcalls webcalls_wsdl From 0f977d5db4c30a58b02e749fd26b55211874759b Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 1 Nov 2019 12:28:35 -0400 Subject: [PATCH 111/679] CMakeLists.txt - set CMake policy CMP0025 this allows to build more llvm 9.0 --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87fa18bed..d62c92eef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ # cmake_minimum_required(VERSION 2.8.7) cmake_policy(SET CMP0020 NEW) +cmake_policy(SET CMP0025 NEW) if("${CMAKE_INSTALL_PREFIX}" STREQUAL "") set(USE_DEFAULT_INSTALL_LOCATION True) From 158a2ac8542879207ce7879a3bacff286dd118b8 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 1 Nov 2019 17:04:05 -0400 Subject: [PATCH 112/679] CMakeLists.txt - suggest-override warning supported by GNUCXX -Wsuggest-override is not supported by clang --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96503025c..92534299e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ if(MSVC) add_definitions(-D_SCL_SECURE_NO_WARNINGS) endif() -if (NOT MSVC) +if(CMAKE_COMPILER_IS_GNUCXX) add_compile_options(-Wsuggest-override) endif() From 2e2cf6e7d2704017258cae45b94d463a46522490 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Wed, 13 Nov 2019 11:36:14 -0300 Subject: [PATCH 113/679] Create conan package recipe --- conan/conanfile.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 conan/conanfile.py diff --git a/conan/conanfile.py b/conan/conanfile.py new file mode 100644 index 000000000..cbe166801 --- /dev/null +++ b/conan/conanfile.py @@ -0,0 +1,50 @@ +############################################################################# +## Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +## All rights reserved. +## +## This file is part of the KD Soap library. +## +## Licensees holding valid commercial KD Soap licenses may use this file in +## accordance with the KD Soap Commercial License Agreement provided with +## the Software. +## +## +## This file may be distributed and/or modified under the terms of the +## GNU Lesser General Public License version 2.1 and version 3 as published by the +## Free Software Foundation and appearing in the file LICENSE.LGPL.txt included. +## +## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +## +## Contact info@kdab.com if any conditions of this licensing are not +## clear to you. +## +######################################################################/ + +from conans import ConanFile, CMake, tools + + +class KdsoapConan(ConanFile): + name = "KDSoap" + version = "1.8.0" + license = "https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-1.8.0-release/LICENSE.txt" + author = "Renato Araujo Oliveira Filho renato.araujo@kdab.com" + url = "https://github.com/KDAB/KDSoap.git" + description = "KD Soap is a Qt-based client-side and server-side SOAP component." + generators = "cmake" + + def requirements(self): + self.requires("Qt/5.11.2@bincrafters/stable") + + def source(self): + git = tools.Git(folder="") + git.clone(self.url) + git.checkout("kdsoap-%s-release"%self.version) + + def build(self): + self.cmake = CMake(self) + self.cmake.configure() + self.cmake.build() + + def package(self): + self.cmake.install() From 2e746124f7a47e3550942cad8039bad4dd950bd8 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 2 Dec 2019 16:24:10 +0100 Subject: [PATCH 114/679] Remove trailing whitespace --- examples/holidays_gui/mainwindow.cpp | 28 +++++------ examples/holidays_gui/mainwindow.h | 8 ++-- .../KDSoapMessageAddressingProperties.cpp | 4 +- .../KDSoapMessageAddressingProperties.h | 14 +++--- src/KDSoapClient/KDSoapNamespacePrefixes.cpp | 2 +- src/KDSoapClient/KDSoapUdpClient.cpp | 8 ++-- src/KDSoapClient/KDSoapUdpClient.h | 48 +++++++++---------- src/KDSoapClient/KDSoapUdpClient_p.h | 2 +- unittests/builtinhttp/CMakeLists.txt | 2 +- unittests/list_restriction/CMakeLists.txt | 2 +- .../optionaltype_regular/testregularapi.cpp | 2 +- .../soap_over_udp/test_soap_over_udp.cpp | 44 ++++++++--------- .../wsaddressingtest.cpp | 12 ++--- 13 files changed, 88 insertions(+), 88 deletions(-) diff --git a/examples/holidays_gui/mainwindow.cpp b/examples/holidays_gui/mainwindow.cpp index 81e27a955..cc82af171 100644 --- a/examples/holidays_gui/mainwindow.cpp +++ b/examples/holidays_gui/mainwindow.cpp @@ -11,42 +11,42 @@ MainWindow::MainWindow( QWidget *parent ) : QWidget( parent ) { - + mBtnSync = new QPushButton(tr("Sync Call"), this); mBtnAsync = new QPushButton(tr("Async Call"), this); mLblResult = new QLabel(tr("Result: "), this); mLblAnim = new QLabel(this); - + mMovAnim = new QMovie(QString::fromLatin1(":/animations/anim.mng")); - + QVBoxLayout *centralLayout = new QVBoxLayout(this); QHBoxLayout *btnsLayout = new QHBoxLayout(); QHBoxLayout *lblsLayout = new QHBoxLayout(); - + btnsLayout->addWidget( mBtnSync ); btnsLayout->addWidget( mBtnAsync ); - + lblsLayout->addWidget( mLblAnim ); lblsLayout->addWidget( mLblResult ); - + centralLayout->addLayout( btnsLayout ); centralLayout->addLayout( lblsLayout ); - + mLblAnim->setMovie(mMovAnim); mMovAnim->start(); - + connect(mBtnSync, SIGNAL(clicked()), this, SLOT(syncCall())); connect(mBtnAsync, SIGNAL(clicked()), this, SLOT(asyncCall())); - + mHolidayDates = new USHolidayDates(); - connect(mHolidayDates, SIGNAL(getValentinesDayDone(const TNS__GetValentinesDayResponse&)), + connect(mHolidayDates, SIGNAL(getValentinesDayDone(const TNS__GetValentinesDayResponse&)), this, SLOT( done (const TNS__GetValentinesDayResponse&))); - + connect(mHolidayDates, SIGNAL(getValentinesDayError(const KDSoapMessage&)), this, SLOT (doneError(const KDSoapMessage&))); - + mYear = 1960; - mParameters.setYear(mYear++); + mParameters.setYear(mYear++); } void MainWindow::done(const TNS__GetValentinesDayResponse& response) @@ -58,7 +58,7 @@ void MainWindow::doneError(const KDSoapMessage& error) { QMessageBox::warning(this, tr("Error retrieving valentines day"), error.faultAsString()); } - + void MainWindow::syncCall() { TNS__GetValentinesDayResponse response = mHolidayDates->getValentinesDay(mParameters); diff --git a/examples/holidays_gui/mainwindow.h b/examples/holidays_gui/mainwindow.h index 4f8bc27da..cd19a1443 100644 --- a/examples/holidays_gui/mainwindow.h +++ b/examples/holidays_gui/mainwindow.h @@ -16,22 +16,22 @@ class MainWindow : public QWidget{ Q_OBJECT public: MainWindow(QWidget *parent = 0); - + private slots: void syncCall(); void asyncCall(); void done(const TNS__GetValentinesDayResponse& r); void doneError(const KDSoapMessage& error); - + private: QPushButton *mBtnAsync; QPushButton *mBtnSync; QLabel *mLblResult; QLabel *mLblAnim; QMovie *mMovAnim; - + unsigned int mYear; - + USHolidayDates *mHolidayDates; TNS__GetValentinesDay mParameters; }; diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp index 1e0f506ed..69e8f0bf1 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.cpp @@ -338,7 +338,7 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN } const QString addressingNS = addressingNamespaceToString(d->addressingNamespace); - + if (!d->destination.isEmpty()) { writer.writeStartElement(addressingNS, QLatin1String("To")); writer.writeCharacters(d->destination); @@ -406,7 +406,7 @@ void KDSoapMessageAddressingProperties::writeMessageAddressingProperties(KDSoapN void KDSoapMessageAddressingProperties::readMessageAddressingProperty(const KDSoapValue &value) { const QString addressingNS = addressingNamespaceToString(d->addressingNamespace); - + if (value.name() == QLatin1String("Action")) { d->action = value.value().toString(); } else if (value.name() == QLatin1String("MessageID")) { diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.h b/src/KDSoapClient/KDSoapMessageAddressingProperties.h index 585e71769..6d2dee8c8 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.h +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.h @@ -56,7 +56,7 @@ struct Relationship { * Relationship constructor * @param URI is supposed to represent a message ID of a previous message you want to make reference to * @param type represents the nature of the relation between messages, if none is provided, the following - * predefined address will be used wsa:Reply (which is dependent on the selected namespace, for example + * predefined address will be used wsa:Reply (which is dependent on the selected namespace, for example * http://www.w3.org/2005/08/addressing/reply) */ Relationship(const QString &URI, const QString &type = QString()) @@ -97,9 +97,9 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties Reply, Unspecified }; - + /** - * This enum contains all the namespaces that can be used to send out WS-Addressing messages. + * This enum contains all the namespaces that can be used to send out WS-Addressing messages. * This allows the application to select the WS-Addressing revision to be used. * \since 1.9 * \see setAddressingNamespace @@ -279,7 +279,7 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties * Add one metadata, if not null, to the list of metadata that will appear within soap header */ void addMetadata(const KDSoapValue &metadata); - + /** * Returns the selected WS-Addressing namespace * \since 1.9 @@ -287,13 +287,13 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties KDSoapAddressingNamespace addressingNamespace() const; /** - * Sets the WS-Addressing namespace to be used for sending out messages.This allows the + * Sets the WS-Addressing namespace to be used for sending out messages.This allows the * application to select the WS-Addressing revision to be used. * \since 1.9 * \see KDSoapAddressingNamespace */ void setAddressingNamespace(KDSoapAddressingNamespace addressingNamespace); - + /** * Helper function that takes the \p address enum and \p addressingNamespace to provide the QString equivalent */ @@ -303,7 +303,7 @@ class KDSOAP_EXPORT KDSoapMessageAddressingProperties * Helper function that compares \p namespaceUri with the known WS-Addressing namespaces */ static bool isWSAddressingNamespace(const QString& namespaceUri); - + /** * Helper function that takes the \p addressingNamespace enum to provide the QString equivalent * \since 1.9 diff --git a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp index ed6805e14..14e6ddc36 100644 --- a/src/KDSoapClient/KDSoapNamespacePrefixes.cpp +++ b/src/KDSoapClient/KDSoapNamespacePrefixes.cpp @@ -26,7 +26,7 @@ void KDSoapNamespacePrefixes::writeStandardNamespaces(QXmlStreamWriter &writer, KDSoap::SoapVersion version, - bool messageAddressingEnabled, + bool messageAddressingEnabled, KDSoapMessageAddressingProperties::KDSoapAddressingNamespace messageAddressingNamespace) { if (version == KDSoap::SOAP1_1) { diff --git a/src/KDSoapClient/KDSoapUdpClient.cpp b/src/KDSoapClient/KDSoapUdpClient.cpp index 4e5a539a0..4445d94be 100644 --- a/src/KDSoapClient/KDSoapUdpClient.cpp +++ b/src/KDSoapClient/KDSoapUdpClient.cpp @@ -34,7 +34,7 @@ static bool isMulticastAddress(const QHostAddress &address) { return false; } -KDSoapUdpClient::KDSoapUdpClient(QObject *parent) : +KDSoapUdpClient::KDSoapUdpClient(QObject *parent) : QObject(parent), d_ptr(new KDSoapUdpClientPrivate(this)) { @@ -84,7 +84,7 @@ bool KDSoapUdpClient::sendMessage(const KDSoapMessage &message, const KDSoapHead KDSoapMessageWriter msgWriter; msgWriter.setVersion(d->soapVersion); const QByteArray data = msgWriter.messageToXml(message, QString(), headers, QMap()); - + if (isMulticastAddress(address)) { bool anySuccess = false; const auto& allInterfaces = QNetworkInterface::allInterfaces(); @@ -122,13 +122,13 @@ void KDSoapUdpClientPrivate::readyRead() QUdpSocket *socket = qobject_cast(sender()); while (socket->hasPendingDatagrams()) { qint64 size = socket->pendingDatagramSize(); - + QByteArray buffer; buffer.resize(size); QHostAddress senderAddress; quint16 senderPort; socket->readDatagram(buffer.data(), buffer.size(), &senderAddress, &senderPort); - + receivedDatagram(buffer, senderAddress, senderPort); } } diff --git a/src/KDSoapClient/KDSoapUdpClient.h b/src/KDSoapClient/KDSoapUdpClient.h index 3ca33ade9..040f4284c 100644 --- a/src/KDSoapClient/KDSoapUdpClient.h +++ b/src/KDSoapClient/KDSoapUdpClient.h @@ -33,19 +33,19 @@ QT_END_NAMESPACE /** * \brief KDSoapUdpClient provides an interface for implementing a [SOAP-over-UDP](https://docs.oasis-open.org/ws-dd/soapoverudp/1.1/os/wsdd-soapoverudp-1.1-spec-os.html) client. - * + * * One-way SOAP-over-UDP can be send by simply using sendMessage(). - * - * Request-response SOAP-over-UDP is supported by bind()ing to a sender UDP + * + * Request-response SOAP-over-UDP is supported by bind()ing to a sender UDP * port. You can send the request using sendMessage() and the response will is - * signaled using receivedMessage(). receivedMessage() will signal any response, - * including those of other requests, there is no help with finding the correct - * response. The WS-Addressing properties of the message can be used to filter + * signaled using receivedMessage(). receivedMessage() will signal any response, + * including those of other requests, there is no help with finding the correct + * response. The WS-Addressing properties of the message can be used to filter * the received responses. - * + * * \code * auto soapUdpClient = new KDSoapUdpClient(this); - * connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port) { + * connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port) { * if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { * TNS__ProbeMatchesType probeMatches; * probeMatches.deserialize(message); @@ -53,7 +53,7 @@ QT_END_NAMESPACE * } * }); * soapUdpClient->bind(3702); - * + * * TNS__ProbeType probe; * * KDSoapMessage message; @@ -70,7 +70,7 @@ QT_END_NAMESPACE * * soapUdpClient->sendMessage(message, KDSoapHeaders(), QHostAddress("239.255.255.250"), 3702); * \endcode - * + * * \since 1.9 */ class KDSOAP_EXPORT KDSoapUdpClient : public QObject @@ -79,11 +79,11 @@ class KDSOAP_EXPORT KDSoapUdpClient : public QObject public: explicit KDSoapUdpClient(QObject *parent=nullptr); - + ~KDSoapUdpClient(); /** - * Bind UDP socket to port. This is needed to recieve messages. Both the + * Bind UDP socket to port. This is needed to recieve messages. Both the * IPv4 and IPv6 port will be bound. * \param port The UDP port to bind to. When port is 0, a random port is chosen. * \param mode This is passed directly to QUdpSocket::bind(). @@ -104,27 +104,27 @@ class KDSOAP_EXPORT KDSoapUdpClient : public QObject public Q_SLOTS: /** - * Send a SOAP-over-UDP message to IP address. - * \param message The actual message to be send. Use - * KDSoapMessage::setMessageAddressingProperties() to set the WS-Addressing + * Send a SOAP-over-UDP message to IP address. + * \param message The actual message to be send. Use + * KDSoapMessage::setMessageAddressingProperties() to set the WS-Addressing * properties of the message. * \param headers can be used to add additional SOAP headers. - * \param address The address to send to message to. Messages send to a + * \param address The address to send to message to. Messages send to a * multicast address will be send to to all interfaces. * \param port The UDP port to send the message to * \since 1.9 - */ + */ bool sendMessage(const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port); - + Q_SIGNALS: /** - * emitted when a SOAP-over-UDP message is received over a bound socket. - * KDSoapUdpClient doesn't do any filtering, so duplicate messages, spoofed - * or responses to other requests will all be received. For example, if a - * message is send via both IPv4 and IPv6, then the receivedMessage will be + * emitted when a SOAP-over-UDP message is received over a bound socket. + * KDSoapUdpClient doesn't do any filtering, so duplicate messages, spoofed + * or responses to other requests will all be received. For example, if a + * message is send via both IPv4 and IPv6, then the receivedMessage will be * emitted twice (with the same message, but with a different address) - * \param message The parsed message received over the socket. Use - * KDSoapMessage::messageAddressingProperties() to see who the recipient is + * \param message The parsed message received over the socket. Use + * KDSoapMessage::messageAddressingProperties() to see who the recipient is * and what SOAP action is requested. * \param headers The additional headers of the message * \param address The IP-address of the sender diff --git a/src/KDSoapClient/KDSoapUdpClient_p.h b/src/KDSoapClient/KDSoapUdpClient_p.h index dffd69957..084a7be18 100644 --- a/src/KDSoapClient/KDSoapUdpClient_p.h +++ b/src/KDSoapClient/KDSoapUdpClient_p.h @@ -27,7 +27,7 @@ class KDSoapUdpClientPrivate : public QObject { Q_OBJECT public: - KDSoapUdpClientPrivate(KDSoapUdpClient *q) + KDSoapUdpClientPrivate(KDSoapUdpClient *q) : q_ptr(q) {} diff --git a/unittests/builtinhttp/CMakeLists.txt b/unittests/builtinhttp/CMakeLists.txt index 120ff5992..00b835774 100644 --- a/unittests/builtinhttp/CMakeLists.txt +++ b/unittests/builtinhttp/CMakeLists.txt @@ -1,4 +1,4 @@ project(builtinhttp) -set(builtinhttp_SRCS builtinhttp.cpp) +set(builtinhttp_SRCS builtinhttp.cpp) set(EXTRA_LIBS kdsoap-server ${QT_QTXML_LIBRARY}) add_unittest(${builtinhttp_SRCS} ) diff --git a/unittests/list_restriction/CMakeLists.txt b/unittests/list_restriction/CMakeLists.txt index 37046e6e9..be58c00e6 100644 --- a/unittests/list_restriction/CMakeLists.txt +++ b/unittests/list_restriction/CMakeLists.txt @@ -2,4 +2,4 @@ project(list_restriction) set(list_restriction_SRCS test_list_restriction.cpp) set(EXTRA_LIBS kdwsdl2cpp_lib) -add_unittest(${list_restriction_SRCS}) +add_unittest(${list_restriction_SRCS}) diff --git a/unittests/optionaltype_regular/testregularapi.cpp b/unittests/optionaltype_regular/testregularapi.cpp index 4e84aa494..189891100 100644 --- a/unittests/optionaltype_regular/testregularapi.cpp +++ b/unittests/optionaltype_regular/testregularapi.cpp @@ -65,7 +65,7 @@ void TestRegularApi::testSerialize() { // TNS__TestOperationResponse1 has "out3" which is polymorphic AND non-optional // If "out3" is not initialized, then trying to serialize causes a crash. - // Verify it doesn't crash. + // Verify it doesn't crash. TNS__TestOperationResponse1 resp; resp.serialize("Test"); QCOMPARE(resp.out3().value(), QString()); diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp index 74624e027..92500d0dd 100644 --- a/unittests/soap_over_udp/test_soap_over_udp.cpp +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -42,13 +42,13 @@ private Q_SLOTS: qRegisterMetaType("KDSoapHeaders"); qRegisterMetaType("QHostAddress"); } - + void testExample() { - // This is the example from the KDSoapUdpClient documentation. It is + // This is the example from the KDSoapUdpClient documentation. It is // here for compile testing. - + auto soapUdpClient = new KDSoapUdpClient(this); - connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage& message, const KDSoapHeaders& headers, const QHostAddress& address, quint16 port) { + connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage& message, const KDSoapHeaders& headers, const QHostAddress& address, quint16 port) { Q_UNUSED(headers); Q_UNUSED(port); if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { @@ -58,7 +58,7 @@ private Q_SLOTS: } }); soapUdpClient->bind(3702); - + TNS__ProbeType probe; KDSoapMessage message; @@ -79,46 +79,46 @@ private Q_SLOTS: soapUdpClient->sendMessage(message, KDSoapHeaders(), QHostAddress("239.255.255.250"), 3702); } - + void testSendMessage() { QUdpSocket testSocket; bool rc = testSocket.bind(); QVERIFY(rc); - + KDSoapUdpClient udpClient; - + udpClient.sendMessage(exampleMessage(), KDSoapHeaders(), QHostAddress::LocalHost, testSocket.localPort()); - + QVERIFY(testSocket.hasPendingDatagrams()); auto datagram = testSocket.receiveDatagram(); - + QVERIFY(KDSoapUnitTestHelpers::xmlBufferCompare(datagram.data(), exampleTextData())); } - + void testReceiveMessage() { QUdpSocket testSocket; - + KDSoapUdpClient udpClient; bool rc = udpClient.bind(12345); QVERIFY(rc); - + QSignalSpy spy(&udpClient, SIGNAL(receivedMessage(KDSoapMessage, KDSoapHeaders, QHostAddress, quint16))); - + auto data = exampleTextData(); qint64 size = testSocket.writeDatagram(data, QHostAddress::LocalHost, 12345); QCOMPARE(size, data.size()); - + QVERIFY(spy.wait(1000)); QList arguments = spy.takeFirst(); QVERIFY(KDSoapUnitTestHelpers::xmlBufferCompare(arguments.at(0).value().toXml(), exampleMessage().toXml())); QCOMPARE(arguments.at(1).value().size(), 0); QCOMPARE(arguments.at(2).value(), QHostAddress::LocalHost); } - + private: QByteArray exampleTextData() { return QByteArray( - "" + "" "" ""); } - + KDSoapMessage exampleMessage() { TNS__ProbeType probe; - + KDQName type("i:PrintBasic"); - type.setNameSpace("http://printer.example.org/2003/imaging"); + type.setNameSpace("http://printer.example.org/2003/imaging"); TNS__QNameListType types; types.setEntries(QList() << type); probe.setTypes(types); @@ -157,7 +157,7 @@ private Q_SLOTS: scopes.setValue(scopeValues); scopes.setMatchBy("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ldap"); probe.setScopes(scopes); - + KDSoapMessage message; message = probe.serialize(QStringLiteral("Probe")); message.setUse(KDSoapMessage::LiteralUse); @@ -169,7 +169,7 @@ private Q_SLOTS: addressing.setMessageID(QStringLiteral("urn:uuid:0a6dc791-2be6-4991-9af1-454778a1917a")); addressing.setDestination(QStringLiteral("urn:docs-oasis-open-org:ws-dd:ns:discovery:2009:01")); message.setMessageAddressingProperties(addressing); - + return message; } }; diff --git a/unittests/ws_addressing_support/wsaddressingtest.cpp b/unittests/ws_addressing_support/wsaddressingtest.cpp index 018ccdbc1..6c6dee1f3 100644 --- a/unittests/ws_addressing_support/wsaddressingtest.cpp +++ b/unittests/ws_addressing_support/wsaddressingtest.cpp @@ -83,7 +83,7 @@ private Q_SLOTS: // THEN QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage200508())); } - + void shouldWriteAProperSoapMessageWithAlternativeNamespace() { // GIVEN @@ -188,24 +188,24 @@ private Q_SLOTS: return map; } - + static KDSoapMessageAddressingProperties addressingProperties200408() { KDSoapMessageAddressingProperties map = addressingProperties(); map.setAddressingNamespace(KDSoapMessageAddressingProperties::Addressing200408); return map; } - + static QByteArray expectedSoapMessage200408() { - return QByteArray(xmlEnvBegin11()) + + return QByteArray(xmlEnvBegin11()) + " xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"" + expectedSoapMessagePartial(); } - + static QByteArray expectedSoapMessage200508() { - return QByteArray(xmlEnvBegin11()) + + return QByteArray(xmlEnvBegin11()) + " xmlns:wsa=\"http://www.w3.org/2005/08/addressing\"" + expectedSoapMessagePartial(); } From 81799e2a9b71948b0578a7cefbd78fc3255d6f42 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 2 Dec 2019 16:38:07 +0100 Subject: [PATCH 115/679] Fix compilation with older Qt5 versions where QCOMPARE was strict --- unittests/soap_over_udp/test_soap_over_udp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp index 92500d0dd..7600ea8f3 100644 --- a/unittests/soap_over_udp/test_soap_over_udp.cpp +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -112,7 +112,7 @@ private Q_SLOTS: QList arguments = spy.takeFirst(); QVERIFY(KDSoapUnitTestHelpers::xmlBufferCompare(arguments.at(0).value().toXml(), exampleMessage().toXml())); QCOMPARE(arguments.at(1).value().size(), 0); - QCOMPARE(arguments.at(2).value(), QHostAddress::LocalHost); + QCOMPARE(arguments.at(2).value(), QHostAddress(QHostAddress::LocalHost)); } private: From 29d84baadd40aa37cf4ea6e1111e3d8e69230ee6 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 2 Dec 2019 22:49:02 +0100 Subject: [PATCH 116/679] Add missing include for Qt 5.8 compilation --- unittests/soap_over_udp/test_soap_over_udp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp index 7600ea8f3..bbe1ff880 100644 --- a/unittests/soap_over_udp/test_soap_over_udp.cpp +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "wsdl_wsdd-discovery-200901.h" Q_DECLARE_METATYPE(QHostAddress) From c095f178af092c1e1b490b8ea97ec6a172cd80b1 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Tue, 3 Dec 2019 15:38:29 +0100 Subject: [PATCH 117/679] set the cmake install interface directories on the library targets (#196) the cmake package gets imported targets generated for use by API consumers. so they can do ``` target_link_libraries(myapp KDSoap::kdsoap) ``` in their cmake code and because KDSoap::kdsoap is an imported target cmake automatically knows where to find the library. alas, since we didn't set an interface directory cmake did not know where to find the relevant headers. this isn't a problem so long as they are in one of the standard search paths (e.g. /usr/include), but when the are installed elsewhere (e.g. /opt/kdsoap/include) they will not be found. by explicitly setting the INSTALL_INTERFACE to INSTALL_INCLUDE_DIR the generated KDSoapTargets.cmake will set the relevant path on the target and thus allow idiomatic use of the imported target without having to mess with include dirs manually. --- src/KDSoapClient/CMakeLists.txt | 1 + src/KDSoapServer/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/KDSoapClient/CMakeLists.txt b/src/KDSoapClient/CMakeLists.txt index 7fdd642f1..25af3e300 100644 --- a/src/KDSoapClient/CMakeLists.txt +++ b/src/KDSoapClient/CMakeLists.txt @@ -35,6 +35,7 @@ set(SOURCES add_library(kdsoap ${KDSoap_LIBRARY_MODE} ${SOURCES}) target_link_libraries(kdsoap ${QT_LIBRARIES}) set_target_properties(kdsoap PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}) +target_include_directories(kdsoap INTERFACE "$") # append d to debug libraries for windows builds if(WIN32) diff --git a/src/KDSoapServer/CMakeLists.txt b/src/KDSoapServer/CMakeLists.txt index 56b1f28cf..5609917c7 100644 --- a/src/KDSoapServer/CMakeLists.txt +++ b/src/KDSoapServer/CMakeLists.txt @@ -30,6 +30,7 @@ set_source_files_properties(KDSoapServerObjectInterface.cpp PROPERTIES SKIP_AUTO add_library(kdsoap-server ${KDSoap_LIBRARY_MODE} ${SOURCES}) target_link_libraries(kdsoap-server kdsoap ${QT_LIBRARIES}) set_target_properties(kdsoap-server PROPERTIES VERSION ${${PROJECT_NAME}_VERSION}) +target_include_directories(kdsoap-server INTERFACE "$") # append d to debug libraries for windows builds if(WIN32) From 2bc7508fea40d3505649422b18d626edb8ebe233 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 3 Dec 2019 11:39:41 -0300 Subject: [PATCH 118/679] Update conan recipe (#195) * Add cmake package info into conan recipe * Update conanfile - Add missing license - Update author - Use kdab default qt flags --- conan/conanfile.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/conan/conanfile.py b/conan/conanfile.py index cbe166801..0df6f16ba 100644 --- a/conan/conanfile.py +++ b/conan/conanfile.py @@ -27,20 +27,32 @@ class KdsoapConan(ConanFile): name = "KDSoap" version = "1.8.0" - license = "https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-1.8.0-release/LICENSE.txt" - author = "Renato Araujo Oliveira Filho renato.araujo@kdab.com" + license = ("https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-{0}-release/LICENSE.txt," + "https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-{0}-release/LICENSE.AGPL3-modified.txt," + "https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-{0}-release/LICENSE.GPL.txt," + "https://raw.githubusercontent.com/KDAB/KDSoap/kdsoap-{0}-release/LICENSE.LGPL.txt").format(version) + author = "Klaralvdalens Datakonsult AB (KDAB) info@kdab.com" url = "https://github.com/KDAB/KDSoap.git" description = "KD Soap is a Qt-based client-side and server-side SOAP component." generators = "cmake" def requirements(self): - self.requires("Qt/5.11.2@bincrafters/stable") + self.requires("qt/5.13.2@kdab/stable") def source(self): git = tools.Git(folder="") git.clone(self.url) git.checkout("kdsoap-%s-release"%self.version) + def configure(self): + # Use same qt configuration for all kdab packages + # ~$ conan create -ks -o qt:qttools=True -o qt:qtsvg=True -o qt:qtdeclarative=True -o qt:qtremoteobjects=True -o qt:qtscxml=True . 5.13.2@kdab/stable + self.options["qt"].qtsvg = True + self.options["qt"].qtdeclarative = True + self.options["qt"].qtremoteobjects = True + self.options["qt"].qtscxml = True + self.options["qt"].qttools = True + def build(self): self.cmake = CMake(self) self.cmake.configure() @@ -48,3 +60,6 @@ def build(self): def package(self): self.cmake.install() + + def package_info(self): + self.env_info.CMAKE_PREFIX_PATH.append(self.package_folder) From de0e7a410d58296bf5feceaf0c7f5489d20e67f9 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sun, 15 Dec 2019 12:22:10 -0500 Subject: [PATCH 119/679] various - update README and EULA --- CMakeLists.txt | 2 +- LICENSE.US.txt | 148 ------------------------------ LICENSE.txt | 198 ++++++++++++++++++++--------------------- README-commercial.txt | 47 ---------- README.txt | 18 ++-- autogen/cpack.cmake.in | 1 - kdsoap.pro | 2 +- 7 files changed, 110 insertions(+), 306 deletions(-) delete mode 100644 LICENSE.US.txt delete mode 100644 README-commercial.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d62c92eef..8f23b14d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,7 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) set(CMAKE_INSTALL_RPATH ${INSTALL_LIBRARY_DIR}) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - install(FILES LICENSE.GPL.txt LICENSE.US.txt LICENSE.txt README.txt kdsoap.pri kdwsdl2cpp.pri DESTINATION ${INSTALL_DOC_DIR}) + install(FILES LICENSE.GPL.txt LICENSE.txt README.txt kdsoap.pri kdwsdl2cpp.pri DESTINATION ${INSTALL_DOC_DIR}) if(CMAKE_VERSION VERSION_LESS 2.8.8) include("${CMAKE_SOURCE_DIR}/cmake/CMakePackageConfigHelpers.cmake") diff --git a/LICENSE.US.txt b/LICENSE.US.txt deleted file mode 100644 index d9aed5e09..000000000 --- a/LICENSE.US.txt +++ /dev/null @@ -1,148 +0,0 @@ -KD Soap COMMERCIAL LICENSE AGREEMENT -FOR COMMERCIAL VERSIONS -March 27, 2002 - - -IMPORTANT-READ CAREFULLY: This Klaralvdalens Datakonsult AB End-User -License Agreement ("EULA") is a legal agreement between you (either an -individual or a legal entity) and Klaralvdalens Datakonsult AB -("KDAB") for the Klaralvdalens Datakonsult AB software product(s) -accompanying this EULA, which include(s) computer software and may -include "online" or electronic documentation, associated media, and -printed materials ("Licensed Product"). - -The Licensed Product is protected by copyright laws and international -copyright treaties, as well as other intellectual property laws and -treaties. The Licensed Product is licensed, not sold. - -By installing, copying, or otherwise using the Licensed Product, you -agree to be bound by the terms of this EULA. If you do not agree to -the terms of this EULA, do not install, copy, or otherwise use the -Licensed Product; you may, however, return it to your place of -purchase for a full refund. In addition, by installing, copying, or -otherwise using any updates or other components of the Licensed -Product that you receive separately as part of the Licensed Product -("Updates"), you agree to be bound by any additional license terms -that accompany such Updates. If you do not agree to the additional -license terms that accompany such Updates, you may not install, copy, -or otherwise use such Updates. - -Upon your acceptance of the terms and conditions of this EULA, KDAB -grants you the right to use the Licensed Product in the manner -provided below. - -KDAB grants to you as an individual a personal, nonexclusive, -nontransferable license to make and use copies of the Licensed Product -for the sole purposes of designing, developing, and testing your -software product(s) ("Applications"). You may install copies of the -Licensed Product on an unlimited number of computers provided that you -are the only individual using the Licensed Product. If you are an -entity, KDAB grants you the right to designate one, and only one, -individual within your organization who shall have the sole right to -use the Licensed Product in the manner provided above. You may at any -time, but not more frequently that once every six (6) months, -designate another individual to replace the current designated user by -notifying KDAB, so long as there is no more than one designated user -at any given time. - - -GENERAL TERMS THAT APPLY TO APPLICATIONS AND REDISTRIBUTABLES -KDAB grants you a nonexclusive, royalty-free right to reproduce and -distribute the object code form of any portion of the Licensed Product -("Redistributables") for execution on any operating system of a type -listed in the License Certificate ("Platforms"). Copies of -Redistributables may only be distributed with and for the sole purpose -of executing Applications permitted under this License Agreement that -you have created using the Licensed Product. Under no circumstances -may any copies of Redistributables be distributed separately. - -The license granted in this EULA for you to create your own -Applications and distribute them and the Redistributables (if any) to -your customers is subject to all of the following conditions: (i) all -copies of the Applications you create must bear a valid copyright -notice, either your own or the copyright notice that appears on the -Licensed Product; (ii) you may not remove or alter any copyright, -trademark or other proprietary rights notice contained in any portion -of the Licensed Product; (iii) Redistributables, if any, shall be -licensed to your customer "as is" (KDAB MAKES NO WARRANTIES OR -REPRESENTATIONS VIS-A-VIS YOUR CUSTOMER WITH RESPECT TO -REDISTRIBUTABLES, AND KDAB EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES -VIS-A-VIS YOUR CUSTOMER, WHETHER EXPRESS OR IMPLIED, ORAL OR WRITTEN, -INCLUDING, BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF MERCHANTABILITY -OR FITNESS FOR ANY PARTICULAR PURPOSE, WHETHER OR NOT KDAB KNOWS, HAS -REASON TO KNOW, HAS BEEN ADVISED OR IS OTHERWISE AWARE OF SUCH -PURPOSE); (iv) you will indemnify and hold KDAB, its related companies -and its suppliers, harmless from and against any claims or liabilities -arising out of the use, reproduction or distribution of your -Applications; (v) your Applications must be written using a licensed, -registered copy of the Licensed Product; (vi) your Applications must -add primary and substantial functionality to the Licensed Product; -(vii) your Applications may not pass on functionality which in any way -makes it possible for others to create Applications with the Software; -(viii) your Applications may not compete with the Licensed Product; -(ix)) you may not use KDAB's or any of its suppliers' names, logos, or -trademarks to market your programs, except to state that your program -was written using the Licensed Product. - -LICENSEE'S BREACH OF CONTRACT -In addition to penalties, other sanctions and the like as stated in -the Swedish Copyright Act (1960:729), or successive legislation as it -may appear, the Licensee agrees to pay a Contractual Fine in case of -his/her/their breach of any of the above mentioned obligations, -including but not limited to, the Licensee's obligation to let only -one person per license use the Software as stated under above. The -Contractual Fine is EUR 5000 and is payable by the Licensee to the -Licenser immediately upon the Licenser having reasonably demonstrated -that the Licensee is in breach of his obligations in this Agreement. - -WARRANTY DISCLAIMER -THE LICENSED PRODUCT IS LICENSED TO YOU "AS IS". TO THE MAXIMUM -EXTENT PERMITTED BY APPLICABLE LAW, KDAB ON BEHALF OF ITSELF AND ITS -SUPPLIERS, DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR -IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND -NON-INFRINGEMENT WITH REGARD TO THE LICENSED PRODUCT. THIS WARRANTY -DISCLAIMER NOTWITHSTANDING, YOU MAY HAVE SPECIFIC LEGAL RIGHTS WHICH -MAY VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION. - - -LIMITATION OF LIABILITY -IF, KDAB'S WARRANTY DISCLAIMER NOTWITHSTANDING, KDAB IS HELD LIABLE TO -YOU, WHETHER IN CONTRACT, TORT OR ANY OTHER LEGAL THEORY, BASED ON THE -LICENSED PRODUCT, KDAB'S ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE -REMEDY SHALL BE, AT KDAB'S OPTION, EITHER (A) RETURN OF THE PRICE YOU -PAID FOR THE LICENSED PRODUCT, OR (B) REPAIR OR REPLACEMENT OF THE -LICENSED PRODUCT, PROVIDED YOU RETURN TO KDAB ALL COPIES OF THE -LICENSED PRODUCT AS ORIGINALLY DELIVERED TO YOU. KDAB SHALL NOT UNDER -ANY CIRCUMSTANCES BE LIABLE TO YOU BASED ON FAILURE OF THE LICENSED -PRODUCT IF THE FAILURE RESULTED FROM ACCIDENT, ABUSE OR -MISAPPLICATION, NOR SHALL KDAB UNDER ANY CIRCUMSTANCES BE LIABLE FOR -SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF -PROFITS OR INTERRUPTION OF BUSINESS OR FOR LOSS OR CORRUPTION OF DATA. -ANY AWARD OF DAMAGES FROM KDAB TO YOU SHALL NOT EXCEED THE TOTAL AMOUNT -YOU HAVE PAID TO KDAB IN CONNECTION WITH THIS EULA. - - -SUPPORT AND UPDATES -You will receive email based, software developer support and access to -Updates to the Licensed Product for one year from the date of initial -delivery, in accordance with KDAB support policies and procedures. -Such policies and procedures may be changed from time to time. - - -GENERAL PROVISIONS -This EULA may only be modified in writing signed by you and an -authorized officer of KDAB. All terms of any purchase order or other -ordering document shall be superseded by this EULA. If any provision -of the EULA is found void or unenforceable, the remainder will remain -valid and enforceable according to its terms. If any remedy provided -is determined to have failed for its essential purpose, all -limitations of liability and exclusions of damages set forth in this -EULA shall remain in effect. - -This EULA shall be construed, interpreted and governed by the laws of -Sweden, the venue to be Sunne Tingsratt. The EULA gives you specific -legal rights; you may have others, which vary from state to state and -from country to country. KDAB reserves all rights not specifically -granted in this EULA. - diff --git a/LICENSE.txt b/LICENSE.txt index 66afc1b15..c8394ab54 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,104 +1,100 @@ -KD Soap COMMERCIAL LICENSE AGREEMENT -FOR COMMERCIAL VERSIONS -Version 1.0 - -Copyright of this license text (C) 2001 Trolltech AS and (C) 2002-2010 -Klaralvdalens Datakonsult AB. All rights reserved. License text used -with kind permission of Trolltech AS. The software and accompanying -material is Copyright (C) 2010-2019 Klaralvdalens Datakonsult AB. - -This non-exclusive non-transferable License Agreement ("Agreement") is -between you ("Licensee") and Klaralvdalens Datakonsult AB (KDAB), and -pertains to the Klaralvdalens Datakonsult AB software product(s) -accompanying this Agreement, which include(s) computer software and -may include "online" or electronic documentation, associated media, -and printed materials, including the source code, example programs and -the documentation ("Software"). - - - COPYRIGHT AND RESTRICTIONS - -1. All intellectual property rights in the Software are owned by KDAB -and are protected by Swedish copyright laws, other applicable -copyright laws, and international treaty provisions. KDAB retains all -rights not expressly granted. No title, property rights or copyright -in the Software or in any modifications to the Software shall pass to -the Licensee under any circumstances. The Software is licensed, not -sold. - -2. By installing, copying, or otherwise using the Software, you agree -to be bound by the terms of this agreement. If you do not agree to the -terms of this Agreement, do not install, copy, or otherwise use the -Software. - -3. Upon your acceptance of the terms and conditions of this Agreement, -KDAB grants you the right to use the Software in the manner provided -below. - -4. KDAB grants to you as an individual a personal, nonexclusive, -non-transferable license to make and use copies of the Software for -the sole purposes of designing, developing, testing and distributing -your software product(s) ("Applications"). You may install copies of -the Software on an unlimited number of computers provided that you are -the only individual using the Software. If you are an entity, KDAB -grants you the right to designate one, and only one, individual within -your organization who shall have the sole right to use the Software in -the manner provided above. - -5. The license granted in this Agreement for you to create and -distribute your own Applications is subject to all of the following -conditions: (i) all copies of the Applications you create must bear a -valid copyright notice, either your own or the copyright notice that -appears on the Software; (ii) you may not remove or alter any -copyright, trademark or other proprietary rights notice contained in -any portion of the Software; (iii) you will indemnify and hold KDAB, its -related companies and its suppliers, harmless from and against any -claims or liabilities arising out of the use and/or reproduction of -your Applications; (iv) your Applications must be written using a -licensed, registered copy of the Software; (v) your Applications must -add primary and substantial functionality to the Software; (vi) your -Applications may not pass on functionality which in any way makes it -possible for others to create Applications with the Software; (vii) -your Applications may not compete with the Software; (viii) you may -not use KDAB's or any of its suppliers' names, logos, or trademarks to -market your programs, except to state that your program was written -using the Software. - -6. LICENSEE'S BREACH OF CONTRACT -In addition to penalties, other sanctions and the like as stated in -the Swedish Copyright Act (1960:729), or successive legislation as it -may appear, the Licensee agrees to pay a Contractual Fine in case of -his/her/their breach of any of the above mentioned obligations, -including but not limited to, the Licensee's obligation to let only -one person per license use the Software as stated under above. The -Contractual Fine is EUR 5000 and is payable by the Licensee to the -Licenser immediately upon the Licenser having reasonably demonstrated -that the Licensee is in breach of his obligations in this Agreement. - -7. WARRANTY DISCLAIMER -THE SOFTWARE IS LICENSED TO YOU "AS IS". TO THE MAXIMUM EXTENT -PERMITTED BY APPLICABLE LAW, KDAB ON BEHALF OF ITSELF AND ITS SUPPLIERS, -DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR IMPLIED, -INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT WITH -REGARD TO THE SOFTWARE. - -8. LIMITATION OF LIABILITY +KD Soap END-USER LICENSE AGREEMENT (EULA) +November 1, 2019 + +IMPORTANT-READ CAREFULLY: This Klarälvdalens Datakonsult AB End-User +License Agreement ("EULA") is a legal agreement between you (either an +individual or a legal entity) and Klarälvdalens Datakonsult AB +("KDAB") for the Klarälvdalens Datakonsult AB software product +“KD Soap” ("Licensed Product"). + +By installing, copying, or downloading the Licensed Product, you agree +to be bound by the terms of this EULA. If you do not agree to the +terms of this EULA, do not install, copy, or download the Licensed +Product; you may, however, return it to your place of purchase for a +full refund. + +Upon your acceptance of the terms and conditions of this EULA, KDAB +grants you the right to use the Licensed Product as provided below. + +GRANT OF RIGHTS + +Under the condition of Your payment of all license fees KDAB grants to +you a nonexclusive, nontransferable, royalty-bearing, perpetual and +worldwide license to copy the Licensed Product for the purpose of designing, +developing, and testing your software product(s) ("Applications"). + +If you are an individual, you may install copies of the Licensed +Product on all of your computers provided that you are the only +individual using the Licensed Product. + +If you are a legal entity, you may provide as many staff members +("Designated User") with copies of the Licensed Product as you have +licensed. Any Designated User is permitted to install copies of the +Licensed Product on all of the Designated User’s computers provided +that the respective Designated User is the only individual using the +Licensed Product. If you are a legal entity, You may at any time +designate another individual to replace the current Designated User, +so long as there is no more than one Designated User per license at +any given time. + +To the extent that the Licensed Product includes software code +("Included Code") in your Applications for the intended purpose of +designing, developing, and testing your Applications you are permitted +to create a derivative or combined work consisting of your +Applications and the Included Code and to use the derivative or +combined work internally for the intended purpose. However, KDAB does +not grant the right to redistribute the combination of your +Application with the Included Code to third parties without prior +written consent of KDAB. + +Nothing in this License is intended to reduce, limit, or restrict your +rights arising from limitations or exceptions that are provided for in +connection with the copyright protection under copyright law or other +applicable laws. + +WARRANTY DISCLAIMER + +THE LICENSED PRODUCT IS LICENSED TO YOU "AS IS". TO THE MAXIMUM +EXTENT PERMITTED BY APPLICABLE LAW, KDAB ON BEHALF OF ITSELF AND ITS +SUPPLIERS, DISCLAIMS ALL WARRANTIES AND CONDITIONS, EITHER EXPRESS OR +IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND +NON-INFRINGEMENT WITH REGARD TO THE LICENSED PRODUCT. THIS WARRANTY +DISCLAIMER NOTWITHSTANDING, YOU MAY HAVE SPECIFIC LEGAL RIGHTS WHICH +MAY VARY FROM STATE/JURISDICTION TO STATE/JURISDICTION. + +LIMITATION OF LIABILITY + IF, KDAB'S WARRANTY DISCLAIMER NOTWITHSTANDING, KDAB IS HELD LIABLE TO -YOU BASED ON THE SOFTWARE, KDAB'S ENTIRE LIABILITY TO YOU AND YOUR -EXCLUSIVE REMEDY SHALL BE, AT REPAIR OR REPLACEMENT OF THE SOFTWARE, -PROVIDED YOU RETURN TO KDAB ALL COPIES OF THE SOFTWARE AS ORIGINALLY -DELIVERED TO YOU. KDAB SHALL NOT UNDER ANY CIRCUMSTANCES BE LIABLE TO -YOU BASED ON FAILURE OF THE SOFTWARE IF THE FAILURE RESULTED FROM -ACCIDENT, ABUSE OR MISAPPLICATION, NOR SHALL KDAB UNDER ANY -CIRCUMSTANCES BE LIABLE FOR SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY -DAMAGES, DAMAGES FOR LOSS OF PROFITS OR INTERRUPTION OF BUSINESS OR -FOR LOSS OR CORRUPTION OF DATA. - -9. This Agreement may only be modified in writing signed by you and an -authorized officer of KDAB. All terms of any purchase order or other -ordering document shall be superseded by this Agreement. +YOU, WHETHER IN CONTRACT, TORT OR ANY OTHER LEGAL THEORY, BASED ON THE +LICENSED PRODUCT, KDAB'S ENTIRE LIABILITY TO YOU AND YOUR EXCLUSIVE +REMEDY SHALL BE, AT KDAB'S OPTION, EITHER (A) RETURN OF THE PRICE YOU +PAID FOR THE LICENSED PRODUCT, OR (B) REPAIR OR REPLACEMENT OF THE +LICENSED PRODUCT, PROVIDED YOU RETURN TO KDAB ALL COPIES OF THE +LICENSED PRODUCT AS ORIGINALLY DELIVERED TO YOU. KDAB SHALL NOT UNDER +ANY CIRCUMSTANCES BE LIABLE TO YOU BASED ON FAILURE OF THE LICENSED +PRODUCT IF THE FAILURE RESULTED FROM ACCIDENT, ABUSE OR +MISAPPLICATION, NOR SHALL KDAB UNDER ANY CIRCUMSTANCES BE LIABLE FOR +SPECIAL DAMAGES, PUNITIVE OR EXEMPLARY DAMAGES, DAMAGES FOR LOSS OF +PROFITS OR INTERRUPTION OF BUSINESS OR FOR LOSS OR CORRUPTION OF DATA. -10. This Agreement shall be construed, interpreted and governed by the -laws of Sweden, the venue to be Sunne Tingsratt. +ANY AWARD OF DAMAGES FROM KDAB TO YOU SHALL NOT EXCEED THE TOTAL +AMOUNT YOU HAVE PAID TO KDAB IN CONNECTION WITH THIS EULA. +SUPPORT AND UPDATES + +You will receive software developer support and access to Updates to +the Licensed Product in accordance with KDAB support policies and +procedures as agreed upon in your support agreement with KDAB. + +GENERAL PROVISIONS + +This EULA may only be modified in writing signed by you and an +authorized officer of KDAB. All terms of any purchase order or other +ordering document shall be superseded by this EULA. If any provision +of the EULA is found void or unenforceable, the remainder will remain +valid and enforceable according to its terms. If any remedy provided +is determined to have failed for its essential purpose, all limitations +of liability and exclusions of damages set forth in this EULA shall +remain in effect. This EULA shall be construed, interpreted and governed +by the laws of Sweden, the venue to be Sunne Tingsratt. diff --git a/README-commercial.txt b/README-commercial.txt deleted file mode 100644 index 72f69697e..000000000 --- a/README-commercial.txt +++ /dev/null @@ -1,47 +0,0 @@ -Introduction -============ -KD Soap is a Qt-based client-side and server-side SOAP component. - -It can be used to create client applications for web services and also provides -the means to create web services without the need for any further component such -as a dedicated web server. - -For more information, see http://www.kdab.com/kdab-products/kd-soap - -Contributing -============ -KDAB will happily accept external contributions, but substantial -contributions will require a signed Copyright Assignment Agreement. -Contact info@kdab.com for more information. - -Licensing -========= -Copyright (C) 2010-2019 Klarälvdalens Datakonsult AB, a KDAB Group company, - -Commercial licensing terms are available in the included file - LICENSE.txt (for non-US customers) -or - LICENSE.US.txt (for US customers) -, respectively. - -For terms of redistribution, refer to the license agreement. - -About KDAB -========== -KD Soap is supported and maintained by Klarälvdalens Datakonsult AB (KDAB). - -The KDAB Group is the global No.1 software consultancy for Qt, C++ and -OpenGL applications across desktop, embedded and mobile platforms. - -The KDAB Group provides consulting and mentoring for developing Qt applications -from scratch and in porting from all popular and legacy frameworks to Qt. -We continue to help develop parts of Qt and are one of the major contributors -to the Qt Project. We can give advanced or standard trainings anywhere -around the globe on Qt as well as C++, OpenGL, 3D and more. - -Please visit http://www.kdab.com to meet the people who write code like this. - - -KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB -in the European Union, the United States, and/or other countries. Other product and -company names and logos may be trademarks or registered trademarks of their respective companies. diff --git a/README.txt b/README.txt index 89fa02896..2a09489e0 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -# KD Soap [![Logo](https://github.com/KDAB/KDSoap/blob/master/images/kdsoap-medium.png)](http://www.kdab.com/products/kd-soap) +# KD Soap [![Logo](https://github.com/KDAB/KDSoap/blob/master/images/kdsoap-medium.png)](https://www.kdab.com/products/kd-soap) Introduction ============ KD Soap is a Qt-based client-side and server-side SOAP component. @@ -9,7 +9,7 @@ as a dedicated web server. KD Soap targets C++ programmers who use Qt in their applications. -For more information, see http://www.kdab.com/kdab-products/kd-soap +For more information, see https://www.kdab.com/kdab-products/kd-soap Using KD Soap ============= @@ -22,20 +22,22 @@ After reading the introductory overview files in doc/ you will find more information at three places: detailed browsable API reference: doc/refman/index.html - or: http://docs.kdab.com/kdsoap + or: https://docs.kdab.com/kdsoap programmers manual with examples: doc/manual/kdsoap.pdf our sorted example programs: examples/ Contact ======= * Join our mailing list: https://mail.kdab.com/mailman/listinfo/kdsoap-interest -* See our official home page: http://www.kdab.com/products/kd-soap +* See our official home page: https://www.kdab.com/products/kd-soap * Visit us on GitHub: https://github.com/KDAB/KDSoap Get Involved ============ KDAB will happily accept external contributions, but substantial -contributions will require a signed Copyright Assignment Agreement. +contributions will require a signed Copyright Assignment Agreement +(see doc/KDSoap-CopyrightAssignmentForm.docx). + Contact info@kdab.com for more information. Please submit your contributions or issue reports from our GitHub space at @@ -50,7 +52,9 @@ under the terms of: * the GPL (see LICENSE.GPL.txt for details) (except libkdsoap-server, see LICENSE.AGPL3-modified.txt) * the KDAB commercial license, provided that you buy a license. - please contact sales@kdab.com if you are interested in buying commercial licenses. + please contact info@kdab.com if you are interested in buying commercial licenses. + +Commercial licensing terms are available in the included file LICENSE.txt. About KDAB ========== @@ -65,7 +69,7 @@ We continue to help develop parts of Qt and are one of the major contributors to the Qt Project. We can give advanced or standard trainings anywhere around the globe on Qt as well as C++, OpenGL, 3D and more. -Please visit http://www.kdab.com to meet the people who write code like this. +Please visit https://www.kdab.com to meet the people who write code like this. KD SOAP and the KD SOAP logo are registered trademarks of Klaralvdalens Datakonsult AB diff --git a/autogen/cpack.cmake.in b/autogen/cpack.cmake.in index 08ed1c2ba..66a4bd88e 100644 --- a/autogen/cpack.cmake.in +++ b/autogen/cpack.cmake.in @@ -24,7 +24,6 @@ IF(WIN32) SET(CPACK_NSIS_MENU_LINKS "LICENSE.txt" "License" "LICENSE.@PRODUCT_LICENSE_FREE@.txt" "License (@PRODUCT_LICENSE_FREE@)" - "LICENSE.US.txt" "License (US)" "README.txt" "Readme") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME_AND_VERSION}") ELSEIF(APPLE) diff --git a/kdsoap.pro b/kdsoap.pro index 981bd4042..210b4843b 100644 --- a/kdsoap.pro +++ b/kdsoap.pro @@ -102,7 +102,7 @@ QMAKE_EXTRA_TARGETS += test INSTALL_DOC_DIR = $$INSTALL_PREFIX/share/doc/KDSoap # install licenses: -licenses.files = LICENSE.GPL.txt LICENSE.US.txt LICENSE.txt +licenses.files = LICENSE.GPL.txt LICENSE.txt licenses.path = $$INSTALL_DOC_DIR INSTALLS += licenses From 12d339bf5d4d3b34d2243b6b02911436a7a7b259 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sun, 15 Dec 2019 12:23:56 -0500 Subject: [PATCH 120/679] doc/KDSoap-CopyrightAssignmentForm.docx - add CLA template --- doc/KDSoap-CopyrightAssignmentForm.docx | Bin 0 -> 8558 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/KDSoap-CopyrightAssignmentForm.docx diff --git a/doc/KDSoap-CopyrightAssignmentForm.docx b/doc/KDSoap-CopyrightAssignmentForm.docx new file mode 100644 index 0000000000000000000000000000000000000000..50f8eae6da7bb3696cc8f01bf1349b558357dc34 GIT binary patch literal 8558 zcmc(EWmFvNwk_@!Xj}uqg9LYX2=4BI0F65YcPD6Ym*DOif=gq;C0HZDT_5D!b9c^u z@9y#b-PL1sRgcl@tNP}uHP@&)6=k7e01yZW2oT)a}MSdny!zrc~4T0EcnN(f6(v`qmBTVU-&_20?61I2t#c8k2 z6_oq=jLB<@;_R0ju2Othva{aJ%zhluX@#o4le*{R@W82g6G&yQU#MGI%f*N-?`{e* z%yTcXzxl|Ph~lPa@!*-mg)(-m!X`N`T;YDA#iiNMm`GEgBjNgF$!6;{+}3Xm(*GGT zn%g^1c%G#w3y%PvfTWmz-Y-8C1cc)MhzQ2>KTK^+6di2s9GQ&l>=@l_tTW<Zi1lBFYYegdagGNht8!4DBOsX<6GLu0UyoEZ-O% zSeKsMF8ImREYE^|8Iroz?45%8sv-JVy>@s?MGxogaPPh?N+I{4r2w%_9e3tc7II5b ztu=F%!uT~D{ySQU7|G?*lZ5rxkv8I}enoX@hP?Y~Yx!h>>uKf+QO6?R&uP5`QswbT z*xGm_kgT>0v#TJlDT;C7%;4CYOL?#(bW!g-0mTB(Y|Mgn&T$N337{ ziM5HXgV_t%-pa%Bz04SGXV`H^VZQ)$q4BCv(^!eI3rOEa=N6}9xsrZy{94_3^L{8# z>F8S5JXrkeb`)7DJD(q zC>P*R`6U0CB##e6V?uT)l&ab3eQdecWzL3lo+l#xUMlL7#O%5WXq&|Xn%qcfg<)T$ zsV^Q>?pxfnUGjpJ>lOMSw{}b70tpS##MV&bJC?fI=4AJF24gfe>IyrE_`gc2r#Vn3t9))-xL{)449NeG__@ zch%&JN~}hG@Dz6_@>8KLcPj9nz>*nEM>scpd9;<_qSoJLvv{~7=-c|K@ZCxE=ZZiQ zk{&@)mM5r}I=NVZC@i1rwDga4B6_ZqtF416)4!dt<{w-)w#CfV7aBSHKI&MA=d5kXQLR2bF|*Pp&sMpH z7Pr%1GY@k^7kL%vsT}{f*_dZ%Dhe1x#*?;$(IJj45JW>>!3?U#DAumRWF_q?NM4Yn zr%kMWC0r`cK_=n;iSj37fWlRZwK_K6Sn2BzXKKEyRo;45uvhvQI7Gy;7*h1mDWNPJ zLa4GTCn`{zQ|D3+ZPbxnsBG4J{aY3L5UG{u+ez5!o3 zZ_HX;ESSd#=n4&DW^f#nQBr$jp!JYZx-$N{SgT|+78jf|189TE{Q&HmajQk zEjZ$IkzrISd#k@N1_MSza{Qg2OVmS%Y`GaVN$NSV#ezs71Pn;yq^hQt)Jyo1slEO1 z({HLMG}Z(!J#U=n8J_={mNEYgjkzt*N!7^M`Zrh9D+>RME0Bg=_v+vSa|_idzad@- z4MR5^7FL^9QdCNVkL;JlL}H;uw#<)4#zw{*9@fji%vC3dIAO<+gB`I*cjUrIe(tk5bgP@m&QIo*S`!IG!ha z#EMj4IH--FDZg@4C8@-#E__dtqSsTb6JLtc>{o=D?W)}Tre_X9b`KBGR^&YxfWPXc z6D+?D);4jD_|$p4gGXt$uI@G5J3!(9V)5*G9qGKMOj~UUtQ_=pqnoQQ@(E|t7kmKtjnH-=lGr^YtJj=sMGR;aG~w1PWPokunNI%ywjx zYTVIO0(nW+<`cT{&&?(yY&nfS`#n-(#m-+q;og-MOs&Ujr+393AV zRIdI=)bw>80tbLr#%kjrGE#MSZ@R(1&d+x>DAwDio691D13*Yi;QijG+g=AjPA#2) zOQ`Yev&bl`b8G=-j&%^>_F4wM?!Is*@WJEz0Z_f{Q;ze;7=wb*`Si*3ctJR|S! zLT0|}*7_`lcad|p?!8X~k7sCIeccZmQ39*uurbwwdpd-Uj*@mJfx`;m{=t*0z|W$w zOKL}(vUD{I1UGVFS56)=os?8Bai6r~PGrJI-5WJn%Q@wvr z|Ee`#alFThEzHAtnns;-<6;|c`l7&j>{f^1{l*}O-ro94qT1PH1cmCbF8nZmUs|r7 zHy@e)`sc(A1&}PFlk#G-rRT>w*CwqNxsm`7Av-i7UsMy+*YHdsq!)Q_uiBD)TX2U5)F(C7=DYnEoPb2LkQx*=m=!&t7}H+rX%!E)P<)X zB6OJyQ&&l#BZ&WYmns~FkW*Y7g_?RyNGHq~ITSQa55ilL2p@`MT)_B+LbW3-jy+i10Z9IyFGiLea{APBt}ph2wYb zV?jeYT8JM7-S3(Bw1{mU!Zg1$41t7Tn&4Q1V9LJbmfJBk*ZVf1&Yv`|xUHG^p>shj zR}&qOCPXQ?QSGJ<7nZ2v=+uUa6d`H>VqX*KIJlhsbq(rROfCamZ0+BH>85BV5 zOOv2LGsXP_|Jz8gGMiE^87l+>cvn;arxaZGbLcoH39z$ljt3Cm*BL?K(aWdc?XwO5 zuJoXn*C1UbUBeKD31A(vLAdN5OinrOW@KQpdSfx-X1F4E+{+sX1|aFUXK?0kG7+~j zD#DG3Zi$qJPfkq8?W=G%7&WXXSYKnC#w(*2rwx_eHXxLiL&@+}X+?v0KJ#$sa-7x7 zUHKZ74+C3RCxkihO$y_(ynhU!ph-l*)~&%tqGi}RA~b0QRTISJw!sh@5Lj$VEhMG{ z#O!KUHZ9A4*hC#zHL4m12utE)5U5l}`;-BESF0 zN#0Ut!aNChm4Evx(s1h^DJz));f$=phu1Ms%*4$gtA9R8imt)Go>l+7Pp& zW;d)v>~!x>ybUspbmb{>oim=m2zh)h`Cdh~M?}TQn2tp4aclEn?_!IMc!Qt!_OPBy z5W9cp!_@HL*T$){VM)g)mJ!3y5^0cn;zUg_F{r+k;A^oXSJPK}yKR#=S@aye#AtBN zMLrG3ui9bbAP_s)d*d6U*NTvhr3Ok6+PfoO~kvpa>Vn* zSXO1R(Z18*(}f7%D%R={cZ1ZFANcqqBDXcIn)%TK=}~**`p*>``Lr zHO6;`C1yR(2W=yso~xJ`Lf)*;6i@fw9HY96Zg;(j4~uu+F)<*~6*>7xpx&0fJ%JId+oG=LRXaH>vu{H!0dyarE(q-#-zIpx$A( zYn|K1E8R+%Bu`_73v`8O8SiRx<1@AM&EGULzK+2!w8&i#q4iDeyelU-hX+t;?*yO9 z?@Cp!x8sh9_IiU3nwtpYUyz6TR{{Pv4%hcGhvgBHljFMfQQhyMb-5S4Csunu=U6a8 zkNFlsU$1+V0PVdVm-|5Tyu$QGAqADPRm?i5usIpe^DfCP;_I(qwX7~sh$ckyw}^te z3ViHRxG2|*pn6zcT_6PIisDe~S!1$QlpEH^oX7jA)g{GTpQZB9qH{hOzk(iqKbV>pNFTaiP~&)~o1XR-$;=AZiaSqVb~litCs6$MknwSex6NsU51|o7 z{9Y#`pgghA_+lt$CWK`?r{Q7LVS=>kNpVq-csChoLk)ObojcIPZd$G5^_6HYan#YMLD6cxrP@T+w)zpW z_wJIDnwkSb?3r}ujIxP|#^k0h<)bzJUT7xo=F5(nQ3W{c`u0JA3?d~oXZth|X}aqmXm^vN6CY$rAUaiCy9S|`pD;`$bb?5jw&=$Re=8E9LWbY1a?Db z?N>7nQ>}gFIbIW=fMk|x-uPLDfqg^#WS?P>qtis@ff(TfU?mTcmo03iR@ulIzT4VA zM^K%&ilW07gzeMS9bLkF_x>)a3HM8F$r_?}CIUPe(w0GZzY|;P2E{zy)#OF83#I#Y zJ$oMRnM|W^Fll9)pi!-9t=!;Sg9EZ_Z#)X*gV|yl@Q3D5VY<5$^?bSl_AkL>5!DDvLB>LISJGwN7UyLM zlDuD4aV~s$y2kOwc=(&D#8gzNL;`clNoNXc??$q;cbgvuRe%)5K+!4(s`c&BWwznmzNe73gV=|5uG-}3BqSZb>zuR6-pe{;?U%mpK$kEN_ zDSjU%JlQ{jrvQ?|R?eSu$zECjJ2{cnj@0pN)+vuDs>?-}SOzi#bBE16V4e}~EvFGG zEANo2n(NqCi1r$$Y zY~jbt`@-wqUABO8zkZaTdF6MEH(N6nhqY(MK&+n}VkYKEsaw9o zFAORy1KJO$tbf-#!u(9BZ;l2YRSaZ0ZX8&WaSbEP8^1w=wRL}Y1q1{2qudx=CcnE^)RUcef=^9ZI-h-NGA7H zX69|27akjJ7t7xdl|R_T3syWJA8u=Am6f7iUuCxl;+`_Z4)2?@PyJ?-ld_knV-IxS9O zM=mmy40-G9Igd}SU^yZ>0uusZBa~A+#YBB0wTlY9mHMC?bqdj^T|}{}@g^AND@7a> zXNS}Pj8$!dtROCnTme~j0%8_(=jyLd7g%!Kr9J0xQ9_86$~3QbDabJm#9mP<2C^)A zF8^dSQu7ULgOl>#qLbyN(hq0XQG zmIT~Y@7q$gD{u1(#Li(8Vr_x2>_I+U_RW9AQsFi-gT>e-6NB9c+2YH4&wB=B)|eGe zm?twXZKod+4fpa)@nFvM9D$lXQcnsiwF#K~&TOF0;k?>>)8IKFx|BLnZYeApKv$Tt z`~0#=Ozo3p+0sduIo~p?-L)2Ofu@pC~58ztvhUDHDTyJKx?2G*-s=1QS&VxKbX zb9MYRgXn6p?xR)V;No0bxTT)*-h>*8%;NpB)#XtqyCJzOKgGWvKBZ+@91#e6e;WqZ z{P}^F69>&h;-*vyI&q4=?J;QpbwyN?#FSex16<63fv}L&1A^nEe zWn}kCoui9UalI`--Nx-l-M}p;4`K%6=pLkX%m;6%NUz3DWo0m4?B zyUJHby{`pR+~eJ~wsVth!AFB4?tpkDG(pxoZog3kkul>qG*HqQ z(^oGVTAkr?*p(r(MmLvWFV;l{L>|BvOi=?3fe`(jY)fN;JNxbEh_8E6N{fmDpc(rf zReVJ|x$ZuzSR-amwBXAr#w-KHq_&`3p(|B;i%O9XqH%=(GB;Y4rqs9fuo$3_NwV@6!W5)bw zL7*NS^Lo9eDu=tL<&S8b~dTCyF(xz=#)) zWDv^7q3wo6?6-8>SiAeVSoX?0|7WYcvC82XTg8(kD5EX}#*8LS!F#qh`{e7iB?U?_(k?3c%{x5gx@9BS94lka~Ur_@0 zU+Mqh;QT%R&$;uTmxn?4ulzr4iod7-*=;Yw>8}tZ`1jra_o(`N@}G~zOGEw@p~U~s Y_EeOGecluV1mg3D@3~Awq%Xhz4}o?(hX4Qo literal 0 HcmV?d00001 From 4e2b2875771e714f353779fc91f56ccb6ff25c09 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sun, 15 Dec 2019 12:25:11 -0500 Subject: [PATCH 121/679] KDSoapValue.h - fix compile against namespaced Qt build --- src/KDSoapClient/KDSoapValue.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/KDSoapClient/KDSoapValue.h b/src/KDSoapClient/KDSoapValue.h index cf80e0bcb..6e1c16b41 100644 --- a/src/KDSoapClient/KDSoapValue.h +++ b/src/KDSoapClient/KDSoapValue.h @@ -306,7 +306,9 @@ class KDSOAP_EXPORT KDSoapValue QSharedDataPointer d; }; +QT_BEGIN_NAMESPACE Q_DECLARE_TYPEINFO(KDSoapValue, Q_MOVABLE_TYPE); +QT_END_NAMESPACE KDSOAP_EXPORT QDebug operator <<(QDebug dbg, const KDSoapValue &value); From b404603a28c67b0cb0f14a6dbee9cf3cd66d1a65 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Mon, 16 Dec 2019 12:24:38 -0500 Subject: [PATCH 122/679] KDSoapUdpClient.[c,h],test_soap_over_udp.cpp - KDAB copyright --- src/KDSoapClient/KDSoapUdpClient.h | 2 +- src/KDSoapClient/KDSoapUdpClient_p.h | 4 ++-- unittests/soap_over_udp/test_soap_over_udp.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/KDSoapClient/KDSoapUdpClient.h b/src/KDSoapClient/KDSoapUdpClient.h index 040f4284c..2a6247f39 100644 --- a/src/KDSoapClient/KDSoapUdpClient.h +++ b/src/KDSoapClient/KDSoapUdpClient.h @@ -83,7 +83,7 @@ class KDSOAP_EXPORT KDSoapUdpClient : public QObject ~KDSoapUdpClient(); /** - * Bind UDP socket to port. This is needed to recieve messages. Both the + * Bind UDP socket to port. This is needed to receive messages. Both the * IPv4 and IPv6 port will be bound. * \param port The UDP port to bind to. When port is 0, a random port is chosen. * \param mode This is passed directly to QUdpSocket::bind(). diff --git a/src/KDSoapClient/KDSoapUdpClient_p.h b/src/KDSoapClient/KDSoapUdpClient_p.h index 084a7be18..522bbad79 100644 --- a/src/KDSoapClient/KDSoapUdpClient_p.h +++ b/src/KDSoapClient/KDSoapUdpClient_p.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 Casper Meijn + * Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ class KDSoapUdpClientPrivate : public QObject { Q_OBJECT public: - KDSoapUdpClientPrivate(KDSoapUdpClient *q) + explicit KDSoapUdpClientPrivate(KDSoapUdpClient *q) : q_ptr(q) {} diff --git a/unittests/soap_over_udp/test_soap_over_udp.cpp b/unittests/soap_over_udp/test_soap_over_udp.cpp index bbe1ff880..c832a695a 100644 --- a/unittests/soap_over_udp/test_soap_over_udp.cpp +++ b/unittests/soap_over_udp/test_soap_over_udp.cpp @@ -1,5 +1,6 @@ /**************************************************************************** -** Copyright (C) 2019 Casper Meijn +** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com. +** ** All rights reserved. ** ** This file is part of the KD Soap library. @@ -103,7 +104,7 @@ private Q_SLOTS: bool rc = udpClient.bind(12345); QVERIFY(rc); - QSignalSpy spy(&udpClient, SIGNAL(receivedMessage(KDSoapMessage, KDSoapHeaders, QHostAddress, quint16))); + QSignalSpy spy(&udpClient, SIGNAL(receivedMessage(KDSoapMessage,KDSoapHeaders,QHostAddress,quint16))); auto data = exampleTextData(); qint64 size = testSocket.writeDatagram(data, QHostAddress::LocalHost, 12345); @@ -134,7 +135,7 @@ private Q_SLOTS: " " " " " " - " i:PrintBasic" + " i:PrintBasic" " ldap:///ou=engineering,o=examplecom,c=us" @@ -147,7 +148,7 @@ private Q_SLOTS: TNS__ProbeType probe; KDQName type("i:PrintBasic"); - type.setNameSpace("http://printer.example.org/2003/imaging"); + type.setNameSpace("https://printer.example.org/2003/imaging"); TNS__QNameListType types; types.setEntries(QList() << type); probe.setTypes(types); From ed11db50575aa3ce832efbfdcacc2f5804cc3942 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 16:35:27 +0100 Subject: [PATCH 123/679] Port QString::null to QString() to fix a deprecation warning --- kdwsdl2cpp/src/converter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdwsdl2cpp/src/converter.h b/kdwsdl2cpp/src/converter.h index 41c718bd8..907a18d4d 100644 --- a/kdwsdl2cpp/src/converter.h +++ b/kdwsdl2cpp/src/converter.h @@ -44,7 +44,7 @@ class Converter struct DefaultAttributeValue { - DefaultAttributeValue(bool isBuiltin = false, const QString& value = QString::null): + DefaultAttributeValue(bool isBuiltin = false, const QString& value = QString()): mIsBuiltin(isBuiltin), mValue(value) { } From e666746900f276de245ba43842613a74a37d57ee Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 19:18:08 +0100 Subject: [PATCH 124/679] Repair unittests by switching to another WSDL service Fixes: KDSDEV-49 --- unittests/webcalls/webcalls.cpp | 42 +- unittests/webcalls_wsdl/CMakeLists.txt | 2 +- unittests/webcalls_wsdl/holidays.wsdl | 1811 --------------------- unittests/webcalls_wsdl/webcalls_wsdl.cpp | 51 +- unittests/webcalls_wsdl/webcalls_wsdl.pro | 2 +- 5 files changed, 35 insertions(+), 1873 deletions(-) delete mode 100644 unittests/webcalls_wsdl/holidays.wsdl diff --git a/unittests/webcalls/webcalls.cpp b/unittests/webcalls/webcalls.cpp index e91967136..2030cc645 100644 --- a/unittests/webcalls/webcalls.cpp +++ b/unittests/webcalls/webcalls.cpp @@ -83,16 +83,17 @@ private slots: QCOMPARE(ret.arguments().first().value().toInt(), 85); } - void testHolidays() + void testAsyncLiteralUse() { - const int year = 2009; - const QString endPoint = QString::fromLatin1("http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx"); - const QString messageNamespace = QString::fromLatin1("http://www.27seconds.com/Holidays/US/Dates/"); + const QString endPoint = QString::fromLatin1("http://www.thomas-bayer.com/axis2/services/BLZService"); + const QString messageNamespace = QString::fromLatin1("http://thomas-bayer.com/blz/"); KDSoapClientInterface client(endPoint, messageNamespace); KDSoapMessage message; + message.setUse(KDSoapMessage::LiteralUse); + message.setNamespaceUri(messageNamespace); message.setQualified(true); - message.addArgument(QLatin1String("year"), year); - KDSoapPendingCall pendingCall = client.asyncCall(QLatin1String("GetValentinesDay"), message/*, action*/); + message.addArgument("blz", "20130600"); + KDSoapPendingCall pendingCall = client.asyncCall(QLatin1String("getBank"), message/*, action*/); KDSoapPendingCallWatcher *watcher = new KDSoapPendingCallWatcher(pendingCall, this); connect(watcher, SIGNAL(finished(KDSoapPendingCallWatcher*)), this, SLOT(slotFinished(KDSoapPendingCallWatcher*))); @@ -101,30 +102,8 @@ private slots: qDebug() << m_returnMessage.faultAsString(); QVERIFY(!m_returnMessage.isFault()); } - QCOMPARE(m_returnMessage.arguments().first().value(), QVariant(QString::fromLatin1("2009-02-14T00:00:00"))); - } - - void testHolidaysv2() - { - const int year = 2009; - const QString endPoint = QString::fromLatin1("http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx"); - const QString messageNamespace = QString::fromLatin1("http://www.holidaywebservice.com/HolidayService_v2/"); - KDSoapClientInterface client(endPoint, messageNamespace); - KDSoapMessage message; - message.setQualified(true); - message.addArgument(QLatin1String("countryCode"), QLatin1String("UnitedStates")); // http://www.holidaywebservice.com/ServicesAvailable_HolidayService2_Country-Enum.aspx - message.addArgument(QLatin1String("holidayCode"), QLatin1String("VALENTINES-DAY")); // http://www.holidaywebservice.com/ServicesAvailable_HolidayService2_HolidayCode-Object.aspx - message.addArgument(QLatin1String("year"), year); - KDSoapPendingCall pendingCall = client.asyncCall(QLatin1String("GetHolidayDate"), message/*, action*/); - KDSoapPendingCallWatcher *watcher = new KDSoapPendingCallWatcher(pendingCall, this); - connect(watcher, SIGNAL(finished(KDSoapPendingCallWatcher*)), - this, SLOT(slotFinished(KDSoapPendingCallWatcher*))); - m_eventLoop.exec(); - if (m_returnMessage.isFault()) { - qDebug() << m_returnMessage.faultAsString(); - QVERIFY(!m_returnMessage.isFault()); - } - QCOMPARE(m_returnMessage.arguments().first().value(), QVariant(QString::fromLatin1("2009-02-14T00:00:00"))); + KDSoapValue response = m_returnMessage.arguments().first(); + QCOMPARE(response.childValues().child("ort").value().toString(), QString::fromLatin1("Hamburg")); } void testConnectionError() @@ -160,9 +139,6 @@ private slots: QCOMPARE(retVal, QString::fromLatin1("Berlin;Berlstedt")); } - // TODO: a great example for complex returned structures: - // http://www.holidaywebservice.com/Holidays/HolidayService.asmx?op=GetHolidaysForYear - private: QEventLoop m_eventLoop; KDSoapMessage m_returnMessage; diff --git a/unittests/webcalls_wsdl/CMakeLists.txt b/unittests/webcalls_wsdl/CMakeLists.txt index 2e4dc17c1..6b09decf3 100644 --- a/unittests/webcalls_wsdl/CMakeLists.txt +++ b/unittests/webcalls_wsdl/CMakeLists.txt @@ -1,6 +1,6 @@ project(webcalls_wsdl) -set(WSDL_FILES BFGlobalService.wsdl holidays.wsdl OrteLookup.wsdl soapresponder.wsdl) +set(WSDL_FILES BFGlobalService.wsdl BLZService.wsdl OrteLookup.wsdl soapresponder.wsdl) set(webcalls_wsdl_SRCS webcalls_wsdl.cpp) set(EXTRA_LIBS ${QT_QTXML_LIBRARY}) diff --git a/unittests/webcalls_wsdl/holidays.wsdl b/unittests/webcalls_wsdl/holidays.wsdl deleted file mode 100644 index 7825bcc68..000000000 --- a/unittests/webcalls_wsdl/holidays.wsdl +++ /dev/null @@ -1,1811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web service that calculates specific national holidays for the US. - - - - - - - - - - - \ No newline at end of file diff --git a/unittests/webcalls_wsdl/webcalls_wsdl.cpp b/unittests/webcalls_wsdl/webcalls_wsdl.cpp index 6a312e6ea..b8a3aa3ad 100644 --- a/unittests/webcalls_wsdl/webcalls_wsdl.cpp +++ b/unittests/webcalls_wsdl/webcalls_wsdl.cpp @@ -23,7 +23,7 @@ #include "KDSoapClientInterface.h" #include "wsdl_soapresponder.h" -#include "wsdl_holidays.h" +#include "wsdl_BLZService.h" #include "wsdl_BFGlobalService.h" #include "wsdl_OrteLookup.h" #include @@ -63,32 +63,32 @@ private slots: // Soap in Document mode. - void testHolidays_wsdl_soap() + void testBLZService_wsdl_soap() { - const int year = 2009; - USHolidayDates holidays; - TNS__GetValentinesDay parameters; - parameters.setYear(year); - TNS__GetValentinesDayResponse response = holidays.getValentinesDay(parameters); - qDebug() << response.getValentinesDayResult(); - const QString dateString = response.getValentinesDayResult().date().toString(Qt::ISODate); - QCOMPARE(dateString, QString::fromLatin1("2009-02-14")); + BLZService::BLZServiceSOAP11Binding service; + TNS__GetBankType getBankType; + getBankType.setBlz("20130600"); // found on http://www.thebankcodes.com/blz/bybankname.php + TNS__GetBankResponseType response = service.getBank(getBankType); + QCOMPARE(response.details().bic(), QString::fromLatin1("BARCDEH1XXX")); + QCOMPARE(response.details().bezeichnung(), QString::fromLatin1("Barclaycard Barclays Bank")); + QCOMPARE(response.details().ort(), QString::fromLatin1("Hamburg")); + QCOMPARE(response.details().plz(), QString::fromLatin1("22702")); } void testParallelAsyncRequests() { - USHolidayDates holidays; - QStringList expectedResults; - for (int year = 2007; year < 2010; ++year) { - TNS__GetValentinesDay parameters; - parameters.setYear(year); - holidays.asyncGetValentinesDay(parameters); - expectedResults += QString::fromLatin1("%1-02-14T00:00:00").arg(year); + BLZService::BLZServiceSOAP11Binding service; + const QStringList expectedResults = {"BARCDEH1XXX", "BEBEDEBBXXX", "BEVODEBBXXX"}; + + for (const char* blz : { "10020000", "20130600", "10090000" }) { + TNS__GetBankType getBankType; + getBankType.setBlz(QString::fromLatin1(blz)); + service.asyncGetBank(getBankType); } - connect(&holidays, SIGNAL(getValentinesDayDone(TNS__GetValentinesDayResponse)), - this, SLOT(slotGetValentinesDayDone(TNS__GetValentinesDayResponse))); - connect(&holidays, SIGNAL(getValentinesDayError(KDSoapMessage)), - this, SLOT(slotGetValentinesDayError(KDSoapMessage))); + connect(&service, SIGNAL(getBankDone(TNS__GetBankResponseType)), + this, SLOT(slotGetBankDone(TNS__GetBankResponseType))); + connect(&service, SIGNAL(getBankError(KDSoapMessage)), + this, SLOT(slotGetBankError(KDSoapMessage))); m_eventLoop.exec(); //qDebug() << m_resultsReceived; @@ -135,19 +135,16 @@ private slots: QCOMPARE(resp.orteStartWithResult(), QString::fromLatin1("Berlin;Berlstedt")); } - // TODO: a great example for complex returned structures: - // http://www.holidaywebservice.com/Holidays/HolidayService.asmx?op=GetHolidaysForYear - protected slots: - void slotGetValentinesDayDone(const TNS__GetValentinesDayResponse &response) + void slotGetBankDone(const TNS__GetBankResponseType &response) { - m_resultsReceived << response.getValentinesDayResult().toString(Qt::ISODate); + m_resultsReceived << response.details().bic(); if (m_resultsReceived.count() == 3) { m_eventLoop.quit(); } } - void slotGetValentinesDayError(const KDSoapMessage &msg) + void slotGetBankError(const KDSoapMessage &msg) { m_resultsReceived << msg.faultAsString(); if (m_resultsReceived.count() == 3) { diff --git a/unittests/webcalls_wsdl/webcalls_wsdl.pro b/unittests/webcalls_wsdl/webcalls_wsdl.pro index 5a24dcd1a..4f11f2994 100644 --- a/unittests/webcalls_wsdl/webcalls_wsdl.pro +++ b/unittests/webcalls_wsdl/webcalls_wsdl.pro @@ -9,4 +9,4 @@ test.commands = ./$(TARGET) test.depends = $(TARGET) QMAKE_EXTRA_TARGETS += test -KDWSDL = soapresponder.wsdl holidays.wsdl BFGlobalService.wsdl OrteLookup.wsdl +KDWSDL = soapresponder.wsdl BLZService.wsdl BFGlobalService.wsdl OrteLookup.wsdl From 6df3315d71fdd4c9112ef9bc69c985162c85937f Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 19:21:10 +0100 Subject: [PATCH 125/679] Add missing WSDL file --- unittests/webcalls_wsdl/BLZService.wsdl | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 unittests/webcalls_wsdl/BLZService.wsdl diff --git a/unittests/webcalls_wsdl/BLZService.wsdl b/unittests/webcalls_wsdl/BLZService.wsdl new file mode 100644 index 000000000..33a7b0a20 --- /dev/null +++ b/unittests/webcalls_wsdl/BLZService.wsdl @@ -0,0 +1,86 @@ + + BLZService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From b834746d33afa4a14ac30f39071fb272ff726153 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 19:31:51 +0100 Subject: [PATCH 126/679] Replace holidays_wsdl with bank_wsdl Fixes: KDSDEV-49 --- doc/CHANGES_1_9.txt | 4 + examples/CMakeLists.txt | 2 +- examples/bank_wsdl/BLZService.wsdl | 86 + examples/bank_wsdl/CMakeLists.txt | 8 + examples/bank_wsdl/bank_wsdl.cpp | 25 + .../bank_wsdl.pro} | 4 +- examples/examples.pro | 2 +- examples/holidays_wsdl/CMakeLists.txt | 9 - examples/holidays_wsdl/holidays.cpp | 24 - examples/holidays_wsdl/holidays.wsdl | 1811 ----------------- 10 files changed, 127 insertions(+), 1848 deletions(-) create mode 100644 examples/bank_wsdl/BLZService.wsdl create mode 100644 examples/bank_wsdl/CMakeLists.txt create mode 100644 examples/bank_wsdl/bank_wsdl.cpp rename examples/{holidays_wsdl/holidays_wsdl.pro => bank_wsdl/bank_wsdl.pro} (57%) delete mode 100644 examples/holidays_wsdl/CMakeLists.txt delete mode 100644 examples/holidays_wsdl/holidays.cpp delete mode 100644 examples/holidays_wsdl/holidays.wsdl diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt index c17bd1e82..694117ad1 100644 --- a/doc/CHANGES_1_9.txt +++ b/doc/CHANGES_1_9.txt @@ -13,3 +13,7 @@ WSDL parser / code generator changes, applying to both client and server side: ================================================================ * Add override indicator to generated files. This requires c++11 for users of generated files. * Remove all special handling of soap/encoding namespace, which fixes the use of soapenc:string and soapenc:integer for instance (#179). + +Examples: +======== +* The holidays examples have been replaced with bank-lookup examples. Less fun, but the holidays web service no longer exists... diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1f22818b5..a32e7d5a9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,4 +15,4 @@ if(Qt5Widgets_FOUND) add_subdirectory(holidays_gui) endif() add_subdirectory(holidays_sync) -add_subdirectory(holidays_wsdl) +add_subdirectory(bank_wsdl) diff --git a/examples/bank_wsdl/BLZService.wsdl b/examples/bank_wsdl/BLZService.wsdl new file mode 100644 index 000000000..33a7b0a20 --- /dev/null +++ b/examples/bank_wsdl/BLZService.wsdl @@ -0,0 +1,86 @@ + + BLZService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bank_wsdl/CMakeLists.txt b/examples/bank_wsdl/CMakeLists.txt new file mode 100644 index 000000000..6bd1f7ce0 --- /dev/null +++ b/examples/bank_wsdl/CMakeLists.txt @@ -0,0 +1,8 @@ +project( bank_wsdl ) + +set(bank_wsdl_SRCS bank_wsdl.cpp) + +KDSOAP_GENERATE_WSDL(bank_wsdl_SRCS BLZService.wsdl) + +add_executable(bank_wsdl ${bank_wsdl_SRCS}) +target_link_libraries(bank_wsdl ${QT_QTCORE_LIBRARY} kdsoap) diff --git a/examples/bank_wsdl/bank_wsdl.cpp b/examples/bank_wsdl/bank_wsdl.cpp new file mode 100644 index 000000000..573546c31 --- /dev/null +++ b/examples/bank_wsdl/bank_wsdl.cpp @@ -0,0 +1,25 @@ +#include +#include "KDSoapClientInterface.h" +#include "KDSoapMessage.h" + +#include + +#include "wsdl_BLZService.h" + +int main(int argc, char **argv) +{ + QCoreApplication app(argc, argv); + + const QString blz = QString::fromLatin1("20130600"); + std::cout << "Looking up the bank with BLZ code " << qPrintable(blz) << "..." << std::endl; + + BLZService::BLZServiceSOAP11Binding service; + TNS__GetBankType getBankType; + getBankType.setBlz(blz); + TNS__GetBankResponseType response = service.getBank(getBankType); + + std::cout << "\"" << qPrintable(response.details().bezeichnung()) << "\" in " + << qPrintable(response.details().ort()) << std::endl; + + return 0; +} diff --git a/examples/holidays_wsdl/holidays_wsdl.pro b/examples/bank_wsdl/bank_wsdl.pro similarity index 57% rename from examples/holidays_wsdl/holidays_wsdl.pro rename to examples/bank_wsdl/bank_wsdl.pro index 9af7f6d64..f45960441 100644 --- a/examples/holidays_wsdl/holidays_wsdl.pro +++ b/examples/bank_wsdl/bank_wsdl.pro @@ -1,7 +1,7 @@ include( $${TOP_SOURCE_DIR}/examples/examples.pri ) HEADERS = -SOURCES = holidays.cpp +SOURCES = bank_wsdl.cpp -KDWSDL = holidays.wsdl +KDWSDL = BLZService.wsdl diff --git a/examples/examples.pro b/examples/examples.pro index fadc3ea9d..ee1eaa9b7 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = helloworld_client helloworld_server holidays_sync holidays_gui holidays_wsdl +SUBDIRS = helloworld_client helloworld_server holidays_sync holidays_gui bank_wsdl diff --git a/examples/holidays_wsdl/CMakeLists.txt b/examples/holidays_wsdl/CMakeLists.txt deleted file mode 100644 index 44e49ab17..000000000 --- a/examples/holidays_wsdl/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -project( holidays_wsdl ) - - -set(holidays_wsdl_SRCS holidays.cpp ) - -KDSOAP_GENERATE_WSDL(holidays_wsdl_SRCS holidays.wsdl) - -add_executable(holidays_wsdl ${holidays_wsdl_SRCS}) -target_link_libraries(holidays_wsdl ${QT_QTCORE_LIBRARY} kdsoap ) diff --git a/examples/holidays_wsdl/holidays.cpp b/examples/holidays_wsdl/holidays.cpp deleted file mode 100644 index 556b33a29..000000000 --- a/examples/holidays_wsdl/holidays.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include "KDSoapClientInterface.h" -#include "KDSoapMessage.h" - -#include - -#include "wsdl_holidays.h" - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - const int year = 2009; - qDebug("Looking up the date of Valentine's Day in %i...", year); - - USHolidayDates holidays; - TNS__GetValentinesDay parameters; - parameters.setYear(year); - TNS__GetValentinesDayResponse response = holidays.getValentinesDay(parameters); - - qDebug("%s", qPrintable(response.getValentinesDayResult().toString())); - - return 0; -} diff --git a/examples/holidays_wsdl/holidays.wsdl b/examples/holidays_wsdl/holidays.wsdl deleted file mode 100644 index 7825bcc68..000000000 --- a/examples/holidays_wsdl/holidays.wsdl +++ /dev/null @@ -1,1811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web service that calculates specific national holidays for the US. - - - - - - - - - - - \ No newline at end of file From 8a46df43db11621eb3228915a97f42df853c0804 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 19:32:46 +0100 Subject: [PATCH 127/679] Remove holidays_sync example. WSDL-generated code is strongly recommended instead. --- examples/CMakeLists.txt | 1 - examples/examples.pro | 2 +- examples/holidays_sync/CMakeLists.txt | 9 ------- examples/holidays_sync/holidays.cpp | 30 ------------------------ examples/holidays_sync/holidays_sync.pro | 4 ---- 5 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 examples/holidays_sync/CMakeLists.txt delete mode 100644 examples/holidays_sync/holidays.cpp delete mode 100644 examples/holidays_sync/holidays_sync.pro diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a32e7d5a9..877bfd2d6 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,5 +14,4 @@ if(Qt5Widgets_FOUND) add_subdirectory(helloworld_server) add_subdirectory(holidays_gui) endif() -add_subdirectory(holidays_sync) add_subdirectory(bank_wsdl) diff --git a/examples/examples.pro b/examples/examples.pro index ee1eaa9b7..464574f7f 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = helloworld_client helloworld_server holidays_sync holidays_gui bank_wsdl +SUBDIRS = helloworld_client helloworld_server holidays_gui bank_wsdl diff --git a/examples/holidays_sync/CMakeLists.txt b/examples/holidays_sync/CMakeLists.txt deleted file mode 100644 index a3586fefc..000000000 --- a/examples/holidays_sync/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -project( holidays_sync ) - - -set(holidays_sync_SRCS holidays.cpp ) - -add_executable(holidays_sync ${holidays_sync_SRCS}) -target_link_libraries(holidays_sync ${QT_QTCORE_LIBRARY} kdsoap) - - diff --git a/examples/holidays_sync/holidays.cpp b/examples/holidays_sync/holidays.cpp deleted file mode 100644 index 26bf44ae0..000000000 --- a/examples/holidays_sync/holidays.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include "KDSoapClientInterface.h" -#include "KDSoapMessage.h" - -#include - -int main(int argc, char **argv) -{ - QCoreApplication app(argc, argv); - - const int year = 2009; - - const QString endPoint = QLatin1String("http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx"); - const QString messageNamespace = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/"); - KDSoapClientInterface client(endPoint, messageNamespace); - - KDSoapMessage message; - message.setQualified(true); - message.addArgument(QLatin1String("year"), year); - - qDebug("Looking up the date of Valentine's Day in %i...", year); - - KDSoapMessage response = client.call(QLatin1String("GetValentinesDay"), message); - if (response.isFault()) - printf("%s\n", qPrintable(response.faultAsString())); - else - printf("%s\n", qPrintable(response.arguments()[0].value().toString())); - - return 0; -} diff --git a/examples/holidays_sync/holidays_sync.pro b/examples/holidays_sync/holidays_sync.pro deleted file mode 100644 index 620a0efc8..000000000 --- a/examples/holidays_sync/holidays_sync.pro +++ /dev/null @@ -1,4 +0,0 @@ -include( $${TOP_SOURCE_DIR}/examples/examples.pri ) - -HEADERS = -SOURCES = holidays.cpp From b0564abdb9e4ea662f6ec34ef527c425efa85916 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 19:44:15 +0100 Subject: [PATCH 128/679] Replace holidays_gui example with bank_gui example --- examples/CMakeLists.txt | 2 +- examples/bank_gui/BLZService.wsdl | 86 + examples/bank_gui/CMakeLists.txt | 12 + examples/{holidays_gui => bank_gui}/anim.mng | Bin .../bank_gui.cpp} | 0 .../bank_gui.pro} | 4 +- .../{holidays_gui => bank_gui}/mainwindow.cpp | 38 +- .../{holidays_gui => bank_gui}/mainwindow.h | 12 +- .../{holidays_gui => bank_gui}/resources.qrc | 0 examples/examples.pro | 2 +- examples/holidays_gui/CMakeLists.txt | 12 - examples/holidays_gui/holidays.wsdl | 1811 ----------------- 12 files changed, 132 insertions(+), 1847 deletions(-) create mode 100644 examples/bank_gui/BLZService.wsdl create mode 100644 examples/bank_gui/CMakeLists.txt rename examples/{holidays_gui => bank_gui}/anim.mng (100%) rename examples/{holidays_gui/holidays_gui.cpp => bank_gui/bank_gui.cpp} (100%) rename examples/{holidays_gui/holidays_gui.pro => bank_gui/bank_gui.pro} (80%) rename examples/{holidays_gui => bank_gui}/mainwindow.cpp (55%) rename examples/{holidays_gui => bank_gui}/mainwindow.h (73%) rename examples/{holidays_gui => bank_gui}/resources.qrc (100%) delete mode 100644 examples/holidays_gui/CMakeLists.txt delete mode 100644 examples/holidays_gui/holidays.wsdl diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 877bfd2d6..9cc4b1228 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -12,6 +12,6 @@ include_directories(../src/ ../src/KDSoapClient/ ../src/KDSoapServer/) if(Qt5Widgets_FOUND) add_subdirectory(helloworld_client) add_subdirectory(helloworld_server) - add_subdirectory(holidays_gui) + add_subdirectory(bank_gui) endif() add_subdirectory(bank_wsdl) diff --git a/examples/bank_gui/BLZService.wsdl b/examples/bank_gui/BLZService.wsdl new file mode 100644 index 000000000..33a7b0a20 --- /dev/null +++ b/examples/bank_gui/BLZService.wsdl @@ -0,0 +1,86 @@ + + BLZService + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/bank_gui/CMakeLists.txt b/examples/bank_gui/CMakeLists.txt new file mode 100644 index 000000000..4fd18e57b --- /dev/null +++ b/examples/bank_gui/CMakeLists.txt @@ -0,0 +1,12 @@ +project(bank_gui) + +include_directories(${QT_QTGUI_INCLUDE_DIR}) + +set(bank_gui_SRCS bank_gui.cpp mainwindow.cpp) + +KDSOAP_GENERATE_WSDL(bank_gui_SRCS BLZService.wsdl) + +qt4_add_resources(bank_gui_SRCS resources.qrc) + +add_executable(bank_gui ${bank_gui_SRCS}) +target_link_libraries(bank_gui ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTWIDGETS_LIBRARY} kdsoap) diff --git a/examples/holidays_gui/anim.mng b/examples/bank_gui/anim.mng similarity index 100% rename from examples/holidays_gui/anim.mng rename to examples/bank_gui/anim.mng diff --git a/examples/holidays_gui/holidays_gui.cpp b/examples/bank_gui/bank_gui.cpp similarity index 100% rename from examples/holidays_gui/holidays_gui.cpp rename to examples/bank_gui/bank_gui.cpp diff --git a/examples/holidays_gui/holidays_gui.pro b/examples/bank_gui/bank_gui.pro similarity index 80% rename from examples/holidays_gui/holidays_gui.pro rename to examples/bank_gui/bank_gui.pro index 6c074402c..dbab212f6 100644 --- a/examples/holidays_gui/holidays_gui.pro +++ b/examples/bank_gui/bank_gui.pro @@ -1,9 +1,9 @@ include( $${TOP_SOURCE_DIR}/examples/examples.pri ) HEADERS = mainwindow.h -SOURCES = holidays_gui.cpp mainwindow.cpp +SOURCES = bank_gui.cpp mainwindow.cpp RESOURCES = resources.qrc -KDWSDL = holidays.wsdl +KDWSDL = BLZService.wsdl # This is our only GUI program :) greaterThan(QT_MAJOR_VERSION, 4) { diff --git a/examples/holidays_gui/mainwindow.cpp b/examples/bank_gui/mainwindow.cpp similarity index 55% rename from examples/holidays_gui/mainwindow.cpp rename to examples/bank_gui/mainwindow.cpp index cc82af171..05c57f996 100644 --- a/examples/holidays_gui/mainwindow.cpp +++ b/examples/bank_gui/mainwindow.cpp @@ -11,7 +11,6 @@ MainWindow::MainWindow( QWidget *parent ) : QWidget( parent ) { - mBtnSync = new QPushButton(tr("Sync Call"), this); mBtnAsync = new QPushButton(tr("Async Call"), this); mLblResult = new QLabel(tr("Result: "), this); @@ -38,37 +37,46 @@ MainWindow::MainWindow( QWidget *parent ) : QWidget( parent ) connect(mBtnSync, SIGNAL(clicked()), this, SLOT(syncCall())); connect(mBtnAsync, SIGNAL(clicked()), this, SLOT(asyncCall())); - mHolidayDates = new USHolidayDates(); - connect(mHolidayDates, SIGNAL(getValentinesDayDone(const TNS__GetValentinesDayResponse&)), - this, SLOT( done (const TNS__GetValentinesDayResponse&))); + mService = new BLZService::BLZServiceSOAP11Binding(this); + + connect(mService, SIGNAL(getBankDone(TNS__GetBankResponseType)), + this, SLOT(done(const TNS__GetBankResponseType&))); - connect(mHolidayDates, SIGNAL(getValentinesDayError(const KDSoapMessage&)), + connect(mService, SIGNAL(getBankError(const KDSoapMessage&)), this, SLOT (doneError(const KDSoapMessage&))); - mYear = 1960; - mParameters.setYear(mYear++); + nextBank(); } -void MainWindow::done(const TNS__GetValentinesDayResponse& response) +void MainWindow::done(const TNS__GetBankResponseType &response) { - mLblResult->setText(tr("Valentine's day: %1").arg(response.getValentinesDayResult().toString())); + mLblResult->setText(tr("Bank found: \"%1\"").arg(response.details().bezeichnung())); } void MainWindow::doneError(const KDSoapMessage& error) { - QMessageBox::warning(this, tr("Error retrieving valentines day"), error.faultAsString()); + QMessageBox::warning(this, tr("Error making the SOAP call"), error.faultAsString()); +} + +void MainWindow::nextBank() +{ + // found on http://www.thebankcodes.com/blz/bybankname.php + static const char* blzList[] = { "10020000", "20130600", "10090000" }; + static const int numEntries = sizeof(blzList) / sizeof(*blzList); + mIndex = (mIndex + 1) % numEntries; + mParameters.setBlz(blzList[mIndex]); } void MainWindow::syncCall() { - TNS__GetValentinesDayResponse response = mHolidayDates->getValentinesDay(mParameters); - mLblResult->setText( tr("Valentine's day: %1").arg(response.getValentinesDayResult().toString())); - mParameters.setYear( mYear++ ); + auto response = mService->getBank(mParameters); + mLblResult->setText( tr("Bank found: %1").arg(response.details().bezeichnung())); + nextBank(); } void MainWindow::asyncCall() { - mHolidayDates->asyncGetValentinesDay(mParameters); - mParameters.setYear( mYear++ ); + mService->asyncGetBank(mParameters); + nextBank(); } diff --git a/examples/holidays_gui/mainwindow.h b/examples/bank_gui/mainwindow.h similarity index 73% rename from examples/holidays_gui/mainwindow.h rename to examples/bank_gui/mainwindow.h index cd19a1443..0dfae8f15 100644 --- a/examples/holidays_gui/mainwindow.h +++ b/examples/bank_gui/mainwindow.h @@ -4,7 +4,7 @@ #include #include "KDSoapClientInterface.h" #include "KDSoapMessage.h" -#include "wsdl_holidays.h" +#include "wsdl_BLZService.h" QT_BEGIN_NAMESPACE class QPushButton; @@ -20,20 +20,22 @@ class MainWindow : public QWidget{ private slots: void syncCall(); void asyncCall(); - void done(const TNS__GetValentinesDayResponse& r); + void done(const TNS__GetBankResponseType& response); void doneError(const KDSoapMessage& error); private: + void nextBank(); + QPushButton *mBtnAsync; QPushButton *mBtnSync; QLabel *mLblResult; QLabel *mLblAnim; QMovie *mMovAnim; - unsigned int mYear; + int mIndex = 0; - USHolidayDates *mHolidayDates; - TNS__GetValentinesDay mParameters; + BLZService::BLZServiceSOAP11Binding *mService; + TNS__GetBankType mParameters; }; #endif diff --git a/examples/holidays_gui/resources.qrc b/examples/bank_gui/resources.qrc similarity index 100% rename from examples/holidays_gui/resources.qrc rename to examples/bank_gui/resources.qrc diff --git a/examples/examples.pro b/examples/examples.pro index 464574f7f..d8d529647 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = helloworld_client helloworld_server holidays_gui bank_wsdl +SUBDIRS = helloworld_client helloworld_server bank_gui bank_wsdl diff --git a/examples/holidays_gui/CMakeLists.txt b/examples/holidays_gui/CMakeLists.txt deleted file mode 100644 index 70615ee5d..000000000 --- a/examples/holidays_gui/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -project( holidays_gui ) - -include_directories(${QT_QTGUI_INCLUDE_DIR}) - -set(holidays_gui_SRCS holidays_gui.cpp mainwindow.cpp) - -KDSOAP_GENERATE_WSDL(holidays_gui_SRCS holidays.wsdl) - -qt4_add_resources(holidays_gui_SRCS resources.qrc) - -add_executable(holidays_gui ${holidays_gui_SRCS}) -target_link_libraries(holidays_gui ${QT_QTCORE_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTWIDGETS_LIBRARY} kdsoap) diff --git a/examples/holidays_gui/holidays.wsdl b/examples/holidays_gui/holidays.wsdl deleted file mode 100644 index 7825bcc68..000000000 --- a/examples/holidays_gui/holidays.wsdl +++ /dev/null @@ -1,1811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - Get the date of New Year. - - - - - Get the date of Martin Luther King Day. - - - - - Get the date of President's Day. - - - - - Get the date of Abraham Lincoln's Birthday. - - - - - Get the date of Valentines Day. - - - - - Get the date of George Washington's Birthday. - - - - - Get the date of Good Friday. - - - - - Get the date of Easter. - - - - - Get the date of Saint Patrick's Day. - - - - - Get the date of April Fool's Day. - - - - - Get the date of Mother's Day. - - - - - Get the date of Memorial Day. - - - - - Get the date of Cinco de Mayo. - - - - - Get the date of Father's Day. - - - - - Get the date of Flag Day. - - - - - Get the date of Independence Day. - - - - - Get the date of Labor Day. - - - - - Get the date of Columbus Day. - - - - - Get the date of Halloween Day. - - - - - Get the date of Thanksgiving Day. - - - - - Get the date of Black Friday. - - - - - Get the date of Veteran's Day. - - - - - Get the date of Christmas. - - - - - Get the date of New Year's Eve. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web service that calculates specific national holidays for the US. - - - - - - - - - - - \ No newline at end of file From 1a5bf52ebfa1fe7eb3d4f99667fb2d6b3a0f5436 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 20:02:58 +0100 Subject: [PATCH 129/679] List all revelant changes between 1.8 and 1.9 --- doc/CHANGES_1_9.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/CHANGES_1_9.txt b/doc/CHANGES_1_9.txt index 694117ad1..6cc6a87cb 100644 --- a/doc/CHANGES_1_9.txt +++ b/doc/CHANGES_1_9.txt @@ -1,10 +1,14 @@ General: ======== +* C++11 is now required. Qt4 is still supported, but this is the last release with support for Qt4. +* Fix rpath for Unix/Linux/macOS (#181). +* Improve cmake usage by setting the install interface directories on the library targets (#196). You can just link to KDSoap::kdsoap and you'll get the correct include paths now. Client-side: ============ -* Add support for selecting WS-Addressing namespace for send messages -* Add support for implementing SOAP-over-UDP clients (see KDSoapUdpClient) +* Add support for selecting WS-Addressing namespace for send messages (#176). +* Fix WS-Addressing spec compliance (#193) +* Add support for implementing SOAP-over-UDP clients (see KDSoapUdpClient). Server-side: ============ @@ -12,7 +16,9 @@ Server-side: WSDL parser / code generator changes, applying to both client and server side: ================================================================ * Add override indicator to generated files. This requires c++11 for users of generated files. +* Add option for loading PKCS12 certificates (#190). * Remove all special handling of soap/encoding namespace, which fixes the use of soapenc:string and soapenc:integer for instance (#179). +* Fix compilation error due to missing QSharedPointer include in generated code (#170). Examples: ======== From 7f647a2ccd6ec68ed876fa4e14904c7ddf1ed70c Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 19 Dec 2019 20:28:09 +0100 Subject: [PATCH 130/679] Fix compilation --- examples/bank_gui/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bank_gui/mainwindow.cpp b/examples/bank_gui/mainwindow.cpp index 05c57f996..e873b6678 100644 --- a/examples/bank_gui/mainwindow.cpp +++ b/examples/bank_gui/mainwindow.cpp @@ -64,7 +64,7 @@ void MainWindow::nextBank() static const char* blzList[] = { "10020000", "20130600", "10090000" }; static const int numEntries = sizeof(blzList) / sizeof(*blzList); mIndex = (mIndex + 1) % numEntries; - mParameters.setBlz(blzList[mIndex]); + mParameters.setBlz(QString::fromLatin1(blzList[mIndex])); } void MainWindow::syncCall() From aecdc53a38efff74eba9f7b30c44cb93c5fb8921 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 20 Dec 2019 16:01:19 +0100 Subject: [PATCH 131/679] Fix krazy warning: don't construct global object at startup --- src/KDSoapClient/KDSoapUdpClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KDSoapClient/KDSoapUdpClient.cpp b/src/KDSoapClient/KDSoapUdpClient.cpp index 4445d94be..eb6492ac2 100644 --- a/src/KDSoapClient/KDSoapUdpClient.cpp +++ b/src/KDSoapClient/KDSoapUdpClient.cpp @@ -23,8 +23,6 @@ #include "KDSoapMessageWriter_p.h" #include -static const QHostAddress AnyIPv4(QLatin1String("0.0.0.0")); - static bool isMulticastAddress(const QHostAddress &address) { if (address.protocol() == QAbstractSocket::IPv4Protocol) { return address.isInSubnet(QHostAddress (QLatin1String("224.0.0.0")), 4); @@ -54,6 +52,7 @@ KDSoapUdpClient::~KDSoapUdpClient() #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) bool KDSoapUdpClient::bind(quint16 port, QAbstractSocket::BindMode mode) { Q_D(KDSoapUdpClient); + const QHostAddress AnyIPv4(QLatin1String("0.0.0.0")); bool rc = true; // Workaround for lack of dual stack sockets in Qt4 // Qt5 supports binding to QHostAddress::Any, which will listen on both IPv4 and IPv6 interfaces. @@ -65,6 +64,7 @@ bool KDSoapUdpClient::bind(quint16 port, QAbstractSocket::BindMode mode) { #else bool KDSoapUdpClient::bind(quint16 port) { Q_D(KDSoapUdpClient); + const QHostAddress AnyIPv4(QLatin1String("0.0.0.0")); bool rc = true; // Workaround for lack of dual stack sockets in Qt4 // Qt5 supports binding to QHostAddress::Any, which will listen on both IPv4 and IPv6 interfaces. From f4539723adc67358866dc5ae110ba7de3406b192 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 20 Dec 2019 09:42:52 -0500 Subject: [PATCH 132/679] kdsoap.spec - make consistent with qt5-kdsoap.spec --- kdsoap.spec | 15 ++++++++------- qt5-kdsoap.spec | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/kdsoap.spec b/kdsoap.spec index 0db288b07..5bf0b62d7 100644 --- a/kdsoap.spec +++ b/kdsoap.spec @@ -1,11 +1,12 @@ Name: kdsoap Version: 1.8.0 Release: 1 -Summary: A Qt-based client-side and server-side SOAP component -Source: %{name}-%{version}.tar.gz +Summary: A Qt4-based client-side and server-side SOAP component +Source0: %{name}-%{version}.tar.gz +Source1: %{name}-%{version}.tar.gz.asc Url: http://github.com/KDAB/KDSoap -Group: System Environment/Libraries -License: LGPL-2.1+ +Group: System/Libraries +License: GPL-2.0+ BuildRoot: %{_tmppath}/%{name}-%{version}-build Vendor: Klaralvdalens Datakonsult AB (KDAB) Packager: Klaralvdalens Datakonsult AB (KDAB) @@ -36,7 +37,7 @@ Authors: %package devel Summary: Development files for %{name} -Group: Development/System +Group: Development/Libraries/C and C++ Requires: %{name} = %{version} %description devel @@ -44,7 +45,7 @@ This package contains header files and associated tools and libraries to develop programs which need to access web services using the SOAP protocol. %prep -%setup -q +%autosetup %build touch .license.accepted @@ -82,7 +83,7 @@ QMAKE_ARGS="LIB_SUFFIX=64" ./configure.sh -shared -release -prefix %{buildroot}/ %changelog * Fri May 17 2019 Allen Winter 1.8.0 1.8.0 -* Mon Mar 01 2018 Allen Winter 1.7.0 +* Thu Mar 01 2018 Allen Winter 1.7.0 1.7.0 * Mon May 01 2017 Allen Winter 1.6.0 1.6.0 diff --git a/qt5-kdsoap.spec b/qt5-kdsoap.spec index 976b84735..5ed3cd847 100644 --- a/qt5-kdsoap.spec +++ b/qt5-kdsoap.spec @@ -3,7 +3,7 @@ Version: 1.8.0 Release: 1 Summary: A Qt5-based client-side and server-side SOAP component Source0: %{name}-%{version}.tar.gz -Source1: %{name}-%{version}.tar.gz.asc +Source1: %{name}-%{version}.tar.gz.asc Url: http://github.com/KDAB/KDSoap Group: System/Libraries License: GPL-2.0+ From a81d8dfa704b6ba7cd55ce8b38ba318e5fc07571 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 20 Dec 2019 11:16:59 -0500 Subject: [PATCH 133/679] various - use https: instead of http: in comments not changing any urls in non-comment C++ yet --- LICENSE.AGPL3-modified.txt | 6 +++--- LICENSE.GPL.txt | 8 ++++---- autogen/cpack.cmake.in | 2 +- doc/CHANGES_1_3.txt | 4 ++-- doc/config/footer.html | 4 ++-- examples/bank_gui/mainwindow.cpp | 2 +- images/footer.html | 4 ++-- kdsoap.spec | 2 +- kdwsdl2cpp/libkode/README | 2 +- kdwsdl2cpp/schema/attribute.cpp | 2 +- kdwsdl2cpp/schema/parser.cpp | 13 ++++++------- kdwsdl2cpp/src/converter_clientstub.cpp | 2 +- kdwsdl2cpp/src/namemapper.cpp | 2 +- kdwsdl2cpp/src/typemap.cpp | 5 ++--- kdwsdl2cpp/wsdl/operation.cpp | 1 - kdwsdl2cpp/wsdl/soapbinding.cpp | 2 +- qt5-kdsoap.spec | 2 +- src/KDSoapClient/KDDateTime.h | 2 +- src/KDSoapClient/KDSoapClientInterface.h | 16 ++++++++-------- src/KDSoapClient/KDSoapEndpointReference.h | 2 +- .../KDSoapMessageAddressingProperties.h | 6 +++--- src/KDSoapClient/KDSoapMessageWriter.cpp | 3 +-- src/KDSoapClient/KDSoapUdpClient.cpp | 2 +- src/KDSoapClient/KDSoapUdpClient.h | 4 ++-- src/KDSoapClient/KDSoapUdpClient_p.h | 2 +- src/KDSoapClient/KDSoapValue.cpp | 4 ++-- src/KDSoapClient/KDSoapValue.h | 6 +++--- src/KDSoapServer/KDSoapServer.h | 2 +- src/KDSoapServer/KDSoapServerObjectInterface.h | 6 +++--- src/KDSoapServer/KDSoapServerSocket.cpp | 4 ++-- .../onvif.org/www.w3.org/2003/05/soap-envelope | 8 ++++---- unittests/onvif.org/www.w3.org/2005/05/xmlmime | 6 +++--- 32 files changed, 66 insertions(+), 70 deletions(-) diff --git a/LICENSE.AGPL3-modified.txt b/LICENSE.AGPL3-modified.txt index d9ef01b87..019764271 100644 --- a/LICENSE.AGPL3-modified.txt +++ b/LICENSE.AGPL3-modified.txt @@ -17,7 +17,7 @@ version 3. GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -659,7 +659,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -674,5 +674,5 @@ specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see -. +. diff --git a/LICENSE.GPL.txt b/LICENSE.GPL.txt index 1a92f1b50..895de36a5 100644 --- a/LICENSE.GPL.txt +++ b/LICENSE.GPL.txt @@ -355,7 +355,7 @@ Public License instead of this License. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -999,7 +999,7 @@ Public License instead of this License. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -1018,13 +1018,13 @@ Public License instead of this License. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see - . + . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read - . + . ------------------------------------------------------------------------- diff --git a/autogen/cpack.cmake.in b/autogen/cpack.cmake.in index 66a4bd88e..e80fe7d87 100644 --- a/autogen/cpack.cmake.in +++ b/autogen/cpack.cmake.in @@ -20,7 +20,7 @@ IF(WIN32) SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_NAME_AND_VERSION}") SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME_AND_VERSION}") SET(CPACK_NSIS_INSTALL_ROOT "C:\\KDAB") # use "$PROGRAMFILES" to get "C:\Program Files" or similar - SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kdab.com") + SET(CPACK_NSIS_URL_INFO_ABOUT "https://www.kdab.com") SET(CPACK_NSIS_MENU_LINKS "LICENSE.txt" "License" "LICENSE.@PRODUCT_LICENSE_FREE@.txt" "License (@PRODUCT_LICENSE_FREE@)" diff --git a/doc/CHANGES_1_3.txt b/doc/CHANGES_1_3.txt index 25f2bca87..384b856d2 100644 --- a/doc/CHANGES_1_3.txt +++ b/doc/CHANGES_1_3.txt @@ -20,7 +20,7 @@ Client-side: * Fix namespace of the main element in messages being sent, the NS from the schema must be used rather than the NS from the WSDL, when both exist (github issue4). * Fix assert when the response message is empty (github issue1). -* Set attribute xsi:nil="true" in empty elements, as per http://www.w3.org/TR/xmlschema-1/#xsi_nil +* Set attribute xsi:nil="true" in empty elements, as per https://www.w3.org/TR/xmlschema-1/#xsi_nil * Fix missing setters for headers, when generating multiple classes * Fix job classes to be per-binding, when multiple bindings are generated. @@ -41,7 +41,7 @@ Server-side: Code generator changes, applying to both client and server side: ================================================================ -* Support for SOAP-1.2 encoding namespace (http://www.w3.org/2003/05/soap-encoding) +* Support for SOAP-1.2 encoding namespace (https://www.w3.org/2003/05/soap-encoding) * Improve parsing of soap-enc:array restrictions, to use the correct element names, when specified * Fix parsing of , which sometimes didn't encode the parameters. * Fix generation of classes with nested namespaces (A::B::C) diff --git a/doc/config/footer.html b/doc/config/footer.html index 5af7138a0..803ad0ba9 100644 --- a/doc/config/footer.html +++ b/doc/config/footer.html @@ -1,8 +1,8 @@
- - + +
Copyright © 2010-2019, Klarälvdalens Datakonsult ABKD SoapCopyright © 2010-2019, Klarälvdalens Datakonsult ABKD Soap
diff --git a/examples/bank_gui/mainwindow.cpp b/examples/bank_gui/mainwindow.cpp index e873b6678..d24f1b491 100644 --- a/examples/bank_gui/mainwindow.cpp +++ b/examples/bank_gui/mainwindow.cpp @@ -60,7 +60,7 @@ void MainWindow::doneError(const KDSoapMessage& error) void MainWindow::nextBank() { - // found on http://www.thebankcodes.com/blz/bybankname.php + // found on https://www.thebankcodes.com/blz/bybankname.php static const char* blzList[] = { "10020000", "20130600", "10090000" }; static const int numEntries = sizeof(blzList) / sizeof(*blzList); mIndex = (mIndex + 1) % numEntries; diff --git a/images/footer.html b/images/footer.html index d353340b3..b50bf56b1 100644 --- a/images/footer.html +++ b/images/footer.html @@ -2,11 +2,11 @@
Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
- http://www.kdab.com/ + https://www.kdab.com/
diff --git a/kdsoap.spec b/kdsoap.spec index 5bf0b62d7..995e0de18 100644 --- a/kdsoap.spec +++ b/kdsoap.spec @@ -4,7 +4,7 @@ Release: 1 Summary: A Qt4-based client-side and server-side SOAP component Source0: %{name}-%{version}.tar.gz Source1: %{name}-%{version}.tar.gz.asc -Url: http://github.com/KDAB/KDSoap +Url: https://github.com/KDAB/KDSoap Group: System/Libraries License: GPL-2.0+ BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/kdwsdl2cpp/libkode/README b/kdwsdl2cpp/libkode/README index 52888dad8..2da3b1b62 100644 --- a/kdwsdl2cpp/libkode/README +++ b/kdwsdl2cpp/libkode/README @@ -1,4 +1,4 @@ -This is a copy of libkode from http://github.com/cornelius/kode.git, last updated 18 August 2010 +This is a copy of libkode from https://github.com/cornelius/kode.git, last updated 18 August 2010 Changes: * Removed automakefile.* * Ported to qmake diff --git a/kdwsdl2cpp/schema/attribute.cpp b/kdwsdl2cpp/schema/attribute.cpp index cccb18345..ead26ade5 100644 --- a/kdwsdl2cpp/schema/attribute.cpp +++ b/kdwsdl2cpp/schema/attribute.cpp @@ -125,7 +125,7 @@ bool Attribute::isQualified() const return d->mQualified; } -// http://www.w3.org/TR/xmlschema-0/#ref36 +// https://www.w3.org/TR/xmlschema-0/#ref36 void Attribute::setAttributeUse(AttributeUse use) { d->mUse = use; diff --git a/kdwsdl2cpp/schema/parser.cpp b/kdwsdl2cpp/schema/parser.cpp index 87be84dbc..2e1dcf86f 100644 --- a/kdwsdl2cpp/schema/parser.cpp +++ b/kdwsdl2cpp/schema/parser.cpp @@ -212,7 +212,7 @@ bool Parser::parseSchemaTag(ParserContext *context, const QDomElement &root) void Parser::parseImport(ParserContext *context, const QDomElement &element) { - // http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#layer2 + // https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#layer2 // The actual value of its namespace [attribute] indicates that the containing schema document may contain qualified references to schema components in that namespace (via one or more prefixes declared with namespace declarations in the normal way). QString expectedNamespace = element.attribute(QLatin1String("namespace")); @@ -435,7 +435,7 @@ Element Parser::parseElement(ParserContext *context, qDebug() << "newElement namespace=" << nameSpace << "name=" << newElement.name() << "defaultQualified=" << d->mDefaultQualifiedElements; } - // http://www.w3.org/TR/xmlschema-0/#NS + // https://www.w3.org/TR/xmlschema-0/#NS if (element.hasAttribute(QLatin1String("form"))) { newElement.setIsQualified(element.attribute(QLatin1String("form")) == QLatin1String("qualified")); } else { @@ -534,7 +534,6 @@ void Parser::setSubstitutionElementName(const QName &typeName, const QName &elem XSD::ComplexType::List::iterator ctit = d->mComplexTypes.findComplexType(typeName); if (ctit != d->mComplexTypes.end()) { // If this type already has an element name associated, they are aliases, any one will do. - // (see http://www.w3schools.com/schema/schema_complex_subst.asp) (*ctit).setSubstitutionElementName(elemName); } else { XSD::SimpleType::List::iterator stit = d->mSimpleTypes.findSimpleType(typeName); @@ -592,7 +591,7 @@ Attribute Parser::parseAttribute(ParserContext *context, newAttribute.setType(typeName); } - // http://www.w3.org/TR/xmlschema-0/#NS + // https://www.w3.org/TR/xmlschema-0/#NS if (element.hasAttribute(QLatin1String("form"))) { newAttribute.setIsQualified(element.attribute(QLatin1String("form")) == QLatin1String("qualified")); } else { @@ -641,7 +640,7 @@ Attribute Parser::parseAttribute(ParserContext *context, } if (newAttribute.type().isEmpty() && !element.hasAttribute(QLatin1String("ref"))) { - // http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-attribute + // https://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-attribute // says "otherwise the simple ur-type definition", which is anySimpleType newAttribute.setType(QName(XMLSchemaURI, QLatin1String("anySimpleType"))); qDebug() << "found attribute" << newAttribute.name() << "without type and without ref, set to default" << newAttribute.type(); @@ -980,7 +979,7 @@ AttributeGroup Parser::parseAttributeGroup(ParserContext *context, const QDomEle return group; } -// http://www.w3.org/TR/xmlschema-0/#ref17 +// https://www.w3.org/TR/xmlschema-0/#ref17 Group Parser::parseGroup(ParserContext *context, const QDomElement &element, const QString &nameSpace) { Element::List elements; @@ -1033,7 +1032,7 @@ static QUrl urlForLocation(ParserContext *context, const QString &location) return url; } -// Note: http://www.w3.org/TR/xmlschema-0/#schemaLocation paragraph 3 (for ) says +// Note: https://www.w3.org/TR/xmlschema-0/#schemaLocation paragraph 3 (for ) says // "schemaLocation is only a hint" void Parser::importSchema(ParserContext *context, const QString &location) { diff --git a/kdwsdl2cpp/src/converter_clientstub.cpp b/kdwsdl2cpp/src/converter_clientstub.cpp index b4711b606..3d9417868 100644 --- a/kdwsdl2cpp/src/converter_clientstub.cpp +++ b/kdwsdl2cpp/src/converter_clientstub.cpp @@ -572,7 +572,7 @@ void Converter::addMessageArgument(KODE::Code &code, const SoapBinding::Style &b { const QString partname = varIsMember ? QLatin1Char('m') + upperlize(localVariableName) : mNameMapper.escape(lowerlize(localVariableName)); // In document style, the "part" is directly added as arguments - // See http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ + // See https://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ if (bindingStyle == SoapBinding::DocumentStyle) { code.addBlock(serializePart(part, partname, messageName, false)); } else { diff --git a/kdwsdl2cpp/src/namemapper.cpp b/kdwsdl2cpp/src/namemapper.cpp index 93e154b54..0ef8d6e34 100644 --- a/kdwsdl2cpp/src/namemapper.cpp +++ b/kdwsdl2cpp/src/namemapper.cpp @@ -24,7 +24,7 @@ using namespace KWSDL; NameMapper::NameMapper() { - // From http://www.cppreference.com/wiki/keywords/start + // From https://en.cppreference.com/w/cpp/keyword mKeyWords << "and" << "and_eq" << "asm" << "auto" << "bitand" << "bitor" << "bool" << "break" << "case" << "catch" << "char" << "class" << "compl" << "const" << "const_cast" << "continue" << "default" diff --git a/kdwsdl2cpp/src/typemap.cpp b/kdwsdl2cpp/src/typemap.cpp index 9949c5f06..0e8a0aabe 100644 --- a/kdwsdl2cpp/src/typemap.cpp +++ b/kdwsdl2cpp/src/typemap.cpp @@ -61,8 +61,7 @@ static QString correctSyntaxCpp(const QString &str) TypeMap::TypeMap() : mNSManager(nullptr) { - // see http://www.w3.org/TR/xmlschema-2 - // or http://www.datypic.com/sc/xsd/s-datatypes.xsd.html + // see https://www.w3.org/TR/xmlschema-2 addBuiltinType("any", "KDSoapValue"); addBuiltinType("anySimpleType", "QVariant"); addBuiltinType("anyType", "KDSoapValue"); @@ -87,7 +86,7 @@ TypeMap::TypeMap() addBuiltinType("Name", "QString"); addBuiltinType("NCName", "QString"); addBuiltinType("negativeInteger", "qint64"); // unbounded (-inf to -1) - addBuiltinType("NMTOKEN", "QString"); // http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#NMTOKEN + addBuiltinType("NMTOKEN", "QString"); // https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#NMTOKEN addBuiltinType("NOTATION", "QString"); addBuiltinType("nonNegativeInteger", "quint64"); // unbounded (0 to inf) addBuiltinType("nonPositiveInteger", "qint64"); // unbounded (-inf to 0) diff --git a/kdwsdl2cpp/wsdl/operation.cpp b/kdwsdl2cpp/wsdl/operation.cpp index 31cad5f84..be4a96272 100644 --- a/kdwsdl2cpp/wsdl/operation.cpp +++ b/kdwsdl2cpp/wsdl/operation.cpp @@ -101,7 +101,6 @@ void Operation::loadXML(ParserContext *context, const QDomElement &element) context->messageHandler()->warning(QLatin1String("Operation: 'name' required")); } - //http://www.roguewave.com/portals/0/products/hydraexpress/docs/4.6.0/html/rwsfwsdevug/9-2.html // input only = OneWayOperation // output only = NotificationOperation // input+output = RequestResponseOperation diff --git a/kdwsdl2cpp/wsdl/soapbinding.cpp b/kdwsdl2cpp/wsdl/soapbinding.cpp index 310c9656f..3ca670002 100644 --- a/kdwsdl2cpp/wsdl/soapbinding.cpp +++ b/kdwsdl2cpp/wsdl/soapbinding.cpp @@ -296,7 +296,7 @@ QString SoapBinding::Body::nameSpace() const void SoapBinding::Body::loadXML(ParserContext *context, const QDomElement &element) { #if 0 - // ## Seems to be set to a namespace, always http://schemas.xmlsoap.org/soap/encoding/ ... unused here. + // ## Seems to be set to a namespace, always https://schemas.xmlsoap.org/soap/encoding/ ... unused here. if (element.hasAttribute("encodingStyle")) { mEncodingStyle = element.attribute("encodingStyle"); } else { diff --git a/qt5-kdsoap.spec b/qt5-kdsoap.spec index 5ed3cd847..8e8aff514 100644 --- a/qt5-kdsoap.spec +++ b/qt5-kdsoap.spec @@ -4,7 +4,7 @@ Release: 1 Summary: A Qt5-based client-side and server-side SOAP component Source0: %{name}-%{version}.tar.gz Source1: %{name}-%{version}.tar.gz.asc -Url: http://github.com/KDAB/KDSoap +Url: https://github.com/KDAB/KDSoap Group: System/Libraries License: GPL-2.0+ BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/KDSoapClient/KDDateTime.h b/src/KDSoapClient/KDDateTime.h index 800718474..5faac246c 100644 --- a/src/KDSoapClient/KDDateTime.h +++ b/src/KDSoapClient/KDDateTime.h @@ -34,7 +34,7 @@ class KDDateTimeData; /** * A DateTime class with an additional (optional) timezone. * - * As specified in http://www.w3.org/TR/xmlschema-2/#dateTime, the timezone + * As specified in https://www.w3.org/TR/xmlschema-2/#dateTime, the timezone * can be empty (local time), "Z" (for UTC) or an offset from UTC like "+05:00" or "-03:00" */ class KDSOAP_EXPORT KDDateTime : public QDateTime diff --git a/src/KDSoapClient/KDSoapClientInterface.h b/src/KDSoapClient/KDSoapClientInterface.h index 6ae6d3fea..39beaffe0 100644 --- a/src/KDSoapClient/KDSoapClientInterface.h +++ b/src/KDSoapClient/KDSoapClientInterface.h @@ -46,8 +46,8 @@ QT_END_NAMESPACE * \code * const int year = 2009; * - * const QString endPoint = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx"); - * const QString messageNamespace = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/"); + * const QString endPoint = QLatin1String("https://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx"); + * const QString messageNamespace = QLatin1String("https://www.27seconds.com/Holidays/US/Dates/"); * KDSoapClientInterface client(endPoint, messageNamespace); * * KDSoapMessage message; @@ -78,9 +78,9 @@ class KDSOAP_EXPORT KDSoapClientInterface * Creates a KDSoapClientInterface object associated with the end point \p endPoint. * \note No connection is done yet at this point, the parameters are simply stored for later use. * \param endPoint the URL of the SOAP service, including http or https scheme, port number - * if needed, and path. Example: http://server/path/soap.php + * if needed, and path. Example: https://server/path/soap.php * \param messageNamespace the namespace URI used for the message and its arguments. - * Example: http://server/path, but could be any URI, it doesn't have to exist + * Example: https://server/path, but could be any URI, it doesn't have to exist * or even to be http, this is really just a namespace, which is part of the * specification of the SOAP service. */ @@ -112,8 +112,8 @@ class KDSOAP_EXPORT KDSoapClientInterface * \code * const int year = 2009; * - * const QString endPoint = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx"); - * const QString messageNamespace = QLatin1String("http://www.27seconds.com/Holidays/US/Dates/"); + * const QString endPoint = QLatin1String("https://www.27seconds.com/Holidays/US/Dates/USHolidayDates.asmx"); + * const QString messageNamespace = QLatin1String("https://www.27seconds.com/Holidays/US/Dates/"); * KDSoapClientInterface* client= new KDSoapClientInterface(endPoint, messageNamespace); * * KDSoapMessage message; @@ -208,7 +208,7 @@ class KDSOAP_EXPORT KDSoapClientInterface /** * Sets the end point of the SOAP service. * \param endPoint the URL of the SOAP service, including http or https scheme, port number - * if needed, and path. Example: http://server/path/soap.php + * if needed, and path. Example: https://server/path/soap.php * \since 1.2 */ void setEndPoint(const QString &endPoint); @@ -252,7 +252,7 @@ class KDSOAP_EXPORT KDSoapClientInterface /** * WSDL style. See the "style" attribute for soap:binding, in the WSDL file. - * See http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ for a discussion + * See https://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ for a discussion * on the pros and cons of both styles. * * In RPC style, the method name passed to call() or asyncCall() is sent as an xml element diff --git a/src/KDSoapClient/KDSoapEndpointReference.h b/src/KDSoapClient/KDSoapEndpointReference.h index 7786dbaeb..ac020547d 100644 --- a/src/KDSoapClient/KDSoapEndpointReference.h +++ b/src/KDSoapClient/KDSoapEndpointReference.h @@ -34,7 +34,7 @@ class KDSoapEndpointReferenceData; * KDSoapEndpointReference is the abstraction class to hold * an Endpoint Reference properties. * - * \see: http://www.w3.org/TR/ws-addr-core/#eprinfoset + * \see: https://www.w3.org/TR/ws-addr-core/#eprinfoset * \since 1.5 */ class KDSOAP_EXPORT KDSoapEndpointReference diff --git a/src/KDSoapClient/KDSoapMessageAddressingProperties.h b/src/KDSoapClient/KDSoapMessageAddressingProperties.h index 6d2dee8c8..090a31dd9 100644 --- a/src/KDSoapClient/KDSoapMessageAddressingProperties.h +++ b/src/KDSoapClient/KDSoapMessageAddressingProperties.h @@ -40,7 +40,7 @@ class KDSoapMessageAddressingPropertiesData; * Relationship between two soap messages. * This class is composed of two QStrings: one represents the type of the relation, the other represents the message ID of the message it refers to. * - * \see http://www.w3.org/TR/ws-addr-core/#msgaddrpropsinfoset + * \see https://www.w3.org/TR/ws-addr-core/#msgaddrpropsinfoset * \since 1.5 */ namespace KDSoapMessageRelationship @@ -57,7 +57,7 @@ struct Relationship { * @param URI is supposed to represent a message ID of a previous message you want to make reference to * @param type represents the nature of the relation between messages, if none is provided, the following * predefined address will be used wsa:Reply (which is dependent on the selected namespace, for example - * http://www.w3.org/2005/08/addressing/reply) + * https://www.w3.org/TR/2006/REC-ws-addr-core-20060509) */ Relationship(const QString &URI, const QString &type = QString()) : uri(URI), relationshipType(type) {} @@ -75,7 +75,7 @@ struct Relationship { * to have in the soap header and associate to a given message using * \see KDSoapMessage::setMessageAddressingProperties * - * \see http://www.w3.org/TR/ws-addr-core/#abstractmaps + * \see https://www.w3.org/TR/ws-addr-core/#abstractmaps * Important: This class does not ensure any kind of validation to the data being passed to it * \since 1.5 */ diff --git a/src/KDSoapClient/KDSoapMessageWriter.cpp b/src/KDSoapClient/KDSoapMessageWriter.cpp index 14361f2c6..2baa88e50 100644 --- a/src/KDSoapClient/KDSoapMessageWriter.cpp +++ b/src/KDSoapClient/KDSoapMessageWriter.cpp @@ -66,7 +66,7 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const writer.writeStartElement(soapEnvelope, QLatin1String("Envelope")); - // This has been removed, see http://msdn.microsoft.com/en-us/library/ms995710.aspx for details + // This has been removed, see https://msdn.microsoft.com/en-us/library/ms995710.aspx for details //writer.writeAttribute(soapEnvelope, QLatin1String("encodingStyle"), soapEncoding); QString messageNamespace = m_messageNamespace; @@ -111,7 +111,6 @@ QByteArray KDSoapMessageWriter::messageToXml(const KDSoapMessage &message, const } } else { // Note that the message itself is always qualified. - // http://www.ibm.com/developerworks/webservices/library/ws-tip-namespace/index.html // isQualified() is only for child elements. if (!message.isFault()) { writer.writeStartElement(messageNamespace, elementName); diff --git a/src/KDSoapClient/KDSoapUdpClient.cpp b/src/KDSoapClient/KDSoapUdpClient.cpp index eb6492ac2..3c9347703 100644 --- a/src/KDSoapClient/KDSoapUdpClient.cpp +++ b/src/KDSoapClient/KDSoapUdpClient.cpp @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #include "KDSoapUdpClient.h" diff --git a/src/KDSoapClient/KDSoapUdpClient.h b/src/KDSoapClient/KDSoapUdpClient.h index 2a6247f39..b5fbfbc65 100644 --- a/src/KDSoapClient/KDSoapUdpClient.h +++ b/src/KDSoapClient/KDSoapUdpClient.h @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #ifndef KDSOAPUDPCLIENT_H @@ -46,7 +46,7 @@ QT_END_NAMESPACE * \code * auto soapUdpClient = new KDSoapUdpClient(this); * connect(soapUdpClient, &KDSoapUdpClient::receivedMessage, [=](const KDSoapMessage &message, const KDSoapHeaders &headers, const QHostAddress &address, quint16 port) { - * if(message.messageAddressingProperties().action() == QStringLiteral("http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { + * if(message.messageAddressingProperties().action() == QStringLiteral("https://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/ProbeMatches")) { * TNS__ProbeMatchesType probeMatches; * probeMatches.deserialize(message); * qDebug() << "Received probe match from" << address; diff --git a/src/KDSoapClient/KDSoapUdpClient_p.h b/src/KDSoapClient/KDSoapUdpClient_p.h index 522bbad79..d780b1829 100644 --- a/src/KDSoapClient/KDSoapUdpClient_p.h +++ b/src/KDSoapClient/KDSoapUdpClient_p.h @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ #ifndef KDSOAPUDPCLIENT_P_H diff --git a/src/KDSoapClient/KDSoapValue.cpp b/src/KDSoapClient/KDSoapValue.cpp index f73f727b7..5e6d7ef2d 100644 --- a/src/KDSoapClient/KDSoapValue.cpp +++ b/src/KDSoapClient/KDSoapValue.cpp @@ -209,7 +209,7 @@ static QString variantToTextValue(const QVariant &value, const QString &typeNs, } case QVariant::Date: return value.toDate().toString(Qt::ISODate); - case QVariant::DateTime: // http://www.w3.org/TR/xmlschema-2/#dateTime + case QVariant::DateTime: // https://www.w3.org/TR/xmlschema-2/#dateTime return KDDateTime(value.toDateTime()).toDateString(); case QVariant::Invalid: qDebug() << "ERROR: Got invalid QVariant in a KDSoapValue"; @@ -311,7 +311,7 @@ void KDSoapValue::writeElementContents(KDSoapNamespacePrefixes &namespacePrefixe } if (use == EncodedUse) { - // use=encoded means writing out xsi:type attributes. http://www.eherenow.com/soapfight.htm taught me that. + // use=encoded means writing out xsi:type attributes QString type; if (!this->type().isEmpty()) { type = namespacePrefixes.resolve(this->typeNs(), this->type()); diff --git a/src/KDSoapClient/KDSoapValue.h b/src/KDSoapClient/KDSoapValue.h index 6e1c16b41..974496214 100644 --- a/src/KDSoapClient/KDSoapValue.h +++ b/src/KDSoapClient/KDSoapValue.h @@ -149,7 +149,7 @@ class KDSOAP_EXPORT KDSoapValue /** * Write out xsi:nil if the KDSoapValue has no content. - * See http://www.w3.org/TR/xmlschema-1/#xsi_nil + * See https://www.w3.org/TR/xmlschema-1/#xsi_nil */ void setNillable(bool nillable); @@ -222,7 +222,7 @@ class KDSOAP_EXPORT KDSoapValue * * For instance * \code - * setType("http://www.w3.org/2001/XMLSchema-instance", "string") + * setType("https://www.w3.org/2001/XMLSchema-instance", "string") * \endcode * will send \c xsi:type="xsd:string" in the message XML. * @@ -232,7 +232,7 @@ class KDSOAP_EXPORT KDSoapValue void setType(const QString &nameSpace, const QString &type); /** * Returns the namespace of the type. - * Example: "http://www.w3.org/2001/XMLSchema-instance". + * Example: "https://www.w3.org/2001/XMLSchema-instance". */ QString typeNs() const; /** diff --git a/src/KDSoapServer/KDSoapServer.h b/src/KDSoapServer/KDSoapServer.h index 73cd35914..a8f254905 100644 --- a/src/KDSoapServer/KDSoapServer.h +++ b/src/KDSoapServer/KDSoapServer.h @@ -227,7 +227,7 @@ class KDSOAPSERVER_EXPORT KDSoapServer : public QTcpServer * Sets the .wsdl file that users can download from the soap server. * \param file relative or absolute path to the .wsdl file (including the filename), on disk * \param pathInUrl that clients can use in order to download the file: - * for instance "/files/myservice.wsdl" for "http://myserver.example.com/files/myservice.wsdl" as final URL. + * for instance "/files/myservice.wsdl" for "https://myserver.example.com/files/myservice.wsdl" as final URL. */ void setWsdlFile(const QString &file, const QString &pathInUrl); diff --git a/src/KDSoapServer/KDSoapServerObjectInterface.h b/src/KDSoapServer/KDSoapServerObjectInterface.h index cf61173f9..34698a9bd 100644 --- a/src/KDSoapServer/KDSoapServerObjectInterface.h +++ b/src/KDSoapServer/KDSoapServerObjectInterface.h @@ -120,7 +120,7 @@ class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface * * Note that a GET request with Accept="application/soap+xml" will trigger a call to this method with an empty * incoming soap request, in order to make it possible to return SOAP responses. This is as documented in - * http://www.ibm.com/developerworks/xml/library/x-tipgetr/. + * https://www.ibm.com/developerworks/xml/library/x-tipgetr/. * * The default implementation in this base class is to simply return * a fault "method not found". Subclasses must implement the dispatching @@ -190,7 +190,7 @@ class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface * \param faultActor Information about who caused the fault to happen * \param detail Holds application-specific error information related to the Body element * - * See http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 for more details. + * See https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 for more details. */ void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor = QString(), const QString &detail = QString()); @@ -203,7 +203,7 @@ class KDSOAPSERVER_EXPORT KDSoapServerObjectInterface * \param faultActor Information about who caused the fault to happen * \param detail Holds application-specific error information related to the Body element, it is given as a KDSoapValue and hence can be parsed * - * See http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 for more details. + * See https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383507 for more details. */ void setFault(const QString &faultCode, const QString &faultString, const QString &faultActor, const KDSoapValue &detail); diff --git a/src/KDSoapServer/KDSoapServerSocket.cpp b/src/KDSoapServer/KDSoapServerSocket.cpp index a2be5abb5..e6909ad13 100644 --- a/src/KDSoapServer/KDSoapServerSocket.cpp +++ b/src/KDSoapServer/KDSoapServerSocket.cpp @@ -127,7 +127,7 @@ static QByteArray httpResponseHeaders(bool fault, const QByteArray &contentType, QByteArray httpResponse; httpResponse.reserve(50); if (fault) { - // http://www.w3.org/TR/2007/REC-soap12-part0-20070427 and look for 500 + // https://www.w3.org/TR/2007/REC-soap12-part0-20070427 and look for 500 httpResponse += "HTTP/1.1 500 Internal Server Error\r\n"; } else if (responseDataSize == 0) { httpResponse += "HTTP/1.1 204 No Content\r\n"; @@ -329,7 +329,7 @@ void KDSoapServerSocket::handleRequest(const QMap &httpH return; } - // See http://www.ibm.com/developerworks/xml/library/x-tipgetr/ + // See https://www.ibm.com/developerworks/xml/library/x-tipgetr/ // We could implement it, but there's no SOAP request, just a query in the URL, // which we'd have to pass to a different virtual than processRequest. handleError(replyMsg, "Client.Data", QString::fromLatin1("Support for GET requests not implemented yet.")); diff --git a/unittests/onvif.org/www.w3.org/2003/05/soap-envelope b/unittests/onvif.org/www.w3.org/2003/05/soap-envelope index 85a6d8e0d..e585841a6 100644 --- a/unittests/onvif.org/www.w3.org/2003/05/soap-envelope +++ b/unittests/onvif.org/www.w3.org/2003/05/soap-envelope @@ -1,18 +1,18 @@ @@ -46,4 +46,4 @@ - \ No newline at end of file + From f3def5fccc1fc1acf5360f2854534f32e8e26e1b Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 20 Dec 2019 17:23:14 -0500 Subject: [PATCH 134/679] .clazy - add clazy config file --- .clazy | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .clazy diff --git a/.clazy b/.clazy new file mode 100644 index 000000000..dfd19e4bd --- /dev/null +++ b/.clazy @@ -0,0 +1,8 @@ +#do not report clazy results for these subdirs +#SKIP whatever + +#clazy checks specification +CHECKS level2 + +#Turn-on Qt4 compatibility +QT4 From 54fd4274c8f9155c450764b1b2253bb2a71f6da5 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 20 Dec 2019 17:41:23 -0500 Subject: [PATCH 135/679] Doxyfile - upgrade --- Doxyfile | 2450 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 2419 insertions(+), 31 deletions(-) diff --git a/Doxyfile b/Doxyfile index a36172835..74eb3767d 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,71 +1,2459 @@ +# Doxyfile 1.8.14 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + PROJECT_NAME = "KD SOAP" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + PROJECT_NUMBER = 1.8.50 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + OUTPUT_DIRECTORY = doc -HTML_OUTPUT = refman + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + INHERIT_DOCS = NO -DISTRIBUTE_GROUP_DOC = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. + +ALIASES = "inv=\invariant" \ + "since_l=\nThis library was introduced in KD SOAP " \ + "since_c=\nThis class was introduced in KD SOAP " \ + "since_d=\nThis macro was introduced in KD SOAP " \ + "since_f=\nThis function was introduced in KD SOAP " \ + "since_e=\nThis enumeration was introduced in KD SOAP " \ + "since_p=\nThis property was introduced in KD SOAP " \ + "since_v=\nThis enumeration value was introduced in KD SOAP " \ + "since_t=\nThis typedef was introduced in KD SOAP " \ + "reimp=\internal" + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = YES + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + HIDE_FRIEND_COMPOUNDS = YES + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = NO + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + WARN_IF_UNDOCUMENTED = NO + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = YES + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + WARN_LOGFILE = doxygen.log + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + INPUT = src -ALIASES = "inv=\invariant" \ - "since_l=\nThis library was introduced in KD SOAP " \ - "since_c=\nThis class was introduced in KD SOAP " \ - "since_d=\nThis macro was introduced in KD SOAP " \ - "since_f=\nThis function was introduced in KD SOAP " \ - "since_e=\nThis enumeration was introduced in KD SOAP " \ - "since_p=\nThis property was introduced in KD SOAP " \ - "since_v=\nThis enumeration value was introduced in KD SOAP " \ - "since_t=\nThis typedef was introduced in KD SOAP " \ - "reimp=\internal" -FILE_PATTERNS = [a-zA-Z]*.cpp [a-zA-Z]*.h *.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = [a-zA-Z]*.cpp \ + [a-zA-Z]*.h \ + *.dox + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + RECURSIVE = YES -EXCLUDE = -EXCLUDE_PATTERNS = moc_*.cpp ui_*.h qrc_*.cpp + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = moc_*.cpp \ + ui_*.h \ + qrc_*.cpp + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + EXAMPLE_PATH = examples -EXAMPLE_PATTERNS = [a-z]*.cpp [a-z]*.h + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = [a-z]*.cpp \ + [a-z]*.h + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + IMAGE_PATH = images + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = refman + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = images/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /