Skip to content

Commit c87a18a

Browse files
committed
Add job support for one way operations.
1 parent 66b96e3 commit c87a18a

File tree

5 files changed

+127
-1
lines changed

5 files changed

+127
-1
lines changed

kdwsdl2cpp/src/converter_clientstub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ bool Converter::convertClientService()
376376
// for each operation, create a job class
377377
for (const Operation &operation : std::as_const(operations)) {
378378
Operation::OperationType opType = operation.operationType();
379-
if (opType != Operation::SolicitResponseOperation && opType != Operation::RequestResponseOperation) {
379+
if (opType == Operation::NotificationOperation) {
380380
continue;
381381
}
382382

unittests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ add_subdirectory(ws_usernametoken_support)
9797
add_subdirectory(empty_element_wsdl)
9898
add_subdirectory(ws_discovery_wsdl)
9999
add_subdirectory(soap_over_udp)
100+
add_subdirectory(kdwsdl2cpp_jobs)
100101

101102
# These need internet access
102103
add_subdirectory(webcalls)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file is part of the KD Soap project.
2+
#
3+
# SPDX-FileCopyrightText: 2014 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
4+
#
5+
# SPDX-License-Identifier: MIT
6+
#
7+
8+
set(kdwsdl2cpp_jobs_SRCS test_jobs.cpp)
9+
set(WSDL_FILES jobs.wsdl)
10+
add_unittest(${kdwsdl2cpp_jobs_SRCS})
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
3+
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
4+
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
5+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
6+
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
7+
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
8+
targetNamespace="http://example.com/example/"
9+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
10+
xmlns:example="http://example.com/example/">
11+
<wsdl:types>
12+
<xsd:schema elementFormDefault="qualified" targetNamespace="http://example.com/example/">
13+
<xsd:element name="test">
14+
<xsd:complexType>
15+
<xsd:sequence>
16+
<xsd:element name="test" type="xsd:unsignedInt" default="30000"/>
17+
</xsd:sequence>
18+
</xsd:complexType>
19+
</xsd:element>
20+
21+
<xsd:element name="testResponse">
22+
<xsd:complexType>
23+
<xsd:sequence>
24+
<xsd:element name="response" type="xsd:boolean" default="false" />
25+
</xsd:sequence>
26+
</xsd:complexType>
27+
</xsd:element>
28+
</xsd:schema>
29+
</wsdl:types>
30+
31+
<wsdl:message name="testIn">
32+
<wsdl:part name="parameters" element="example:test" />
33+
</wsdl:message>
34+
<wsdl:message name="testOut">
35+
<wsdl:part name="parameters" element="example:testResponse" />
36+
</wsdl:message>
37+
38+
<wsdl:portType name="ExampleSoap">
39+
<wsdl:operation name="testRequestResponse">
40+
<wsdl:input message="example:testIn" />
41+
<wsdl:output message="example:testOut" />
42+
</wsdl:operation>
43+
<wsdl:operation name="testOneWay">
44+
<wsdl:input message="example:testIn" />
45+
</wsdl:operation>
46+
</wsdl:portType>
47+
48+
<wsdl:binding name="ExampleSoap" type="example:ExampleSoap">
49+
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
50+
<wsdl:operation name="testRequestResponse">
51+
<soap12:operation soapAction="http://example.com/example/testrequestresponse" style="document" />
52+
<wsdl:input>
53+
<soap12:body use="literal" />
54+
</wsdl:input>
55+
<wsdl:output>
56+
<soap12:body use="literal" />
57+
</wsdl:output>
58+
</wsdl:operation>
59+
<wsdl:operation name="testOneWay">
60+
<soap12:operation soapAction="http://example.com/example/testoneway" style="document" />
61+
<wsdl:input>
62+
<soap12:body use="literal" />
63+
</wsdl:input>
64+
</wsdl:operation>
65+
</wsdl:binding>
66+
67+
<wsdl:service name="Example">
68+
<wsdl:port name="ExampleSoap" binding="example:ExampleSoap">
69+
<soap12:address location="http://localhost/test" />
70+
</wsdl:port>
71+
</wsdl:service>
72+
</wsdl:definitions>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/****************************************************************************
2+
**
3+
** This file is part of the KD Soap project.
4+
**
5+
** SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6+
**
7+
** SPDX-License-Identifier: MIT
8+
**
9+
****************************************************************************/
10+
11+
#include "KDSoapClientInterface.h"
12+
#include "KDSoapMessage.h"
13+
#include "KDSoapPendingCallWatcher.h"
14+
#include "KDSoapValue.h"
15+
#include "httpserver_p.h"
16+
#include "wsdl_jobs.h"
17+
#include <QDebug>
18+
#include <QEventLoop>
19+
#include <QTest>
20+
21+
using namespace KDSoapUnitTestHelpers;
22+
23+
class LiteralTest : public QObject
24+
{
25+
Q_OBJECT
26+
27+
private Q_SLOTS:
28+
void initTestCase()
29+
{
30+
}
31+
32+
void testRequest()
33+
{
34+
// just a compile check
35+
Example service;
36+
TestRequestResponseJob requestResponse(&service);
37+
TestOneWayJob oneWay(&service);
38+
}
39+
};
40+
41+
QTEST_MAIN(LiteralTest)
42+
43+
#include "test_jobs.moc"

0 commit comments

Comments
 (0)