Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c8cc9c6
Remove unused includes from tests
caspermeijn Jan 2, 2019
1c53d38
Move internal call to be private
caspermeijn Jan 3, 2019
e70dd41
Add support for WS-UsernameToken
caspermeijn Jan 3, 2019
cd831cc
Fix if a referenced type name has an extra space in it. E.g. allow th…
ryanenzo Feb 1, 2019
65cf2fe
- Add support for setting request headers for KDSoapJob
ryanenzo Feb 1, 2019
ef914df
Merge pull request #149 from ryanenzo/fixnamewithspaces
dfaure-kdab Feb 1, 2019
57d6259
Merge pull request #147 from caspermeijn/ws_addressing_reader
dfaure-kdab Feb 1, 2019
da6979c
Add changelog entry for last merge
dfaure-kdab Feb 1, 2019
4a76cc0
- Add ability to generate both .h and .cpp file in one run of kdwsdl2cpp
ryanenzo Feb 1, 2019
6f72635
Fix compilation with Qt <= 5.9
dfaure-kdab Feb 1, 2019
48ed024
- Add \since for new functions
ryanenzo Feb 1, 2019
d4370fc
- Fix for coding style, as requested by David
ryanenzo Feb 1, 2019
9c37ab6
- Remove dead code
ryanenzo Feb 1, 2019
b8622a3
- Add check that parameters (-o) and (-both) are not specified at the…
ryanenzo Feb 1, 2019
409aa8e
- Remove "const" change from SoapClientInterface (it is added in a di…
ryanenzo Feb 1, 2019
5eeef86
- Code style change, as requested by David
ryanenzo Feb 1, 2019
5106ed0
- Make KODE::Printer a member variable instead of a parent class
ryanenzo Feb 1, 2019
87e8d82
- Make a sanity check into a Q_ASSERT
ryanenzo Feb 1, 2019
940e191
Merge pull request #152 from ryanenzo/mix
dfaure-kdab Feb 1, 2019
1ea73bf
Merge pull request #151 from ryanenzo/headers
dfaure-kdab Feb 1, 2019
c451cda
- Fix memory leak
ryanenzo Feb 1, 2019
6f96602
- Update docs
ryanenzo Feb 1, 2019
d30d491
Merge pull request #155 from ryanenzo/memfix
dfaure-kdab Feb 1, 2019
b280e09
KDSoapAuthentication: Added documentation link and simplified functio…
caspermeijn Feb 2, 2019
6299621
Merge branch 'master' into ws_usernametoken
caspermeijn Feb 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/CHANGES_1_8.txt
Original file line number Diff line number Diff line change
@@ -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:
============
Expand All @@ -12,6 +13,8 @@ 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
* Add support for WS-UsernameToken, see KDSoapAuthentication

Server-side:
============
Expand Down
2 changes: 2 additions & 0 deletions kdwsdl2cpp/libkode/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ QString Style::lowerFirst( const QString &str )

QString Style::makeIdentifier( const QString &str )
{
Q_ASSERT(!str.isEmpty());

QString identifier = str;
identifier.replace( "-", "_" );
identifier.replace( ".", "_" );
Expand Down
2 changes: 1 addition & 1 deletion kdwsdl2cpp/schema/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
15 changes: 13 additions & 2 deletions kdwsdl2cpp/src/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ void Compiler::parse(const QDomElement &element)

definitions.fixUpDefinitions(/*&context, element*/);

KODE::Code::setDefaultIndentation(4);

WSDL wsdl;
wsdl.setDefinitions(definitions);
Expand All @@ -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 {
Expand Down
21 changes: 21 additions & 0 deletions kdwsdl2cpp/src/converter_clientstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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"));
Expand Down Expand Up @@ -385,6 +405,7 @@ bool Converter::convertClientService()
if (hasAction) {
callLine += QLatin1String(", action");
}
callLine += QLatin1String(", requestHeaders()");
callLine += QLatin1String(");");
doStartCode += callLine;

Expand Down
6 changes: 5 additions & 1 deletion kdwsdl2cpp/src/converter_complextype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -643,6 +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;
}
const QString variableName = QLatin1String("d_ptr->") + KODE::MemberVariable::memberVariableName(attrName);

demarshalCode.addBlock(demarshalNameTest(attribute.type(), attrName, &first));
Expand Down
64 changes: 37 additions & 27 deletions kdwsdl2cpp/src/creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,53 @@ 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());
_printer.setCreationWarning(true);
_printer.setGenerator(QLatin1String("KDAB's kdwsdl2cpp"));

// Qt-like coding style
printer.setLabelsDefineIndent(false);
printer.setIndentLabels(false);
_printer.setLabelsDefineIndent(false);
_printer.setIndentLabels(false);

//qDebug() << "Create server=" << Settings::self()->generateServerCode() << "impl=" << Settings::self()->generateImplementation();
_file.setLicense(KODE::License::GeneratedNoRestriction);
}

KODE::File file;
void Creator::setOutputDirectory(const QString &outputDirectory)
{
_printer.setOutputDirectory(outputDirectory);
}

if (Settings::self()->generateImplementation()) {
file.setImplementationFilename(Settings::self()->outputFileName());
file.setHeaderFilename(Settings::self()->headerFile());
} else {
file.setHeaderFilename(Settings::self()->outputFileName());
}
void Creator::setSourceFile(const QString &sourceFile)
{
_printer.setSourceFile(sourceFile);
}

file.setLicense(KODE::License::GeneratedNoRestriction);
void Creator::setHeaderFileName(const QString &headerFileName)
{
_file.setHeaderFilename(headerFileName);
}

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()
{
_printer.printHeader(_file);
}

void Creator::createImplementation()
{
_printer.printImplementation(_file);
}
17 changes: 16 additions & 1 deletion kdwsdl2cpp/src/creator.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#define KWSDL_CREATOR_H

#include <libkode/class.h>
#include <libkode/file.h>
#include <libkode/license.h>
#include <libkode/printer.h>

namespace KWSDL
{
Expand All @@ -30,7 +33,19 @@ class Creator
public:
Creator();

void create(const KODE::Class::List &list);
void setOutputDirectory(const QString &outputDirectory);
void setSourceFile(const QString &sourceFile);

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;
KODE::Printer _printer;
};

}
Expand Down
Loading