Skip to content

Commit 6191c68

Browse files
committed
feat(soap): adds support for RPC style bindings.
1 parent e6368f9 commit 6191c68

File tree

16 files changed

+75
-325
lines changed

16 files changed

+75
-325
lines changed

mock/soap/src/main/java/io/gatehill/imposter/plugin/soap/SoapPluginImpl.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ class SoapPluginImpl @Inject constructor(
185185
LOGGER.warn("Unable to find a matching binding operation using SOAPAction or SOAP request body")
186186
return@build completedUnitFuture()
187187
}
188-
// check(operation.style.equals("document", ignoreCase = true)) {
189-
// "Only document SOAP bindings are supported"
190-
// }
188+
check(operation.style.equals("document", ignoreCase = true)
189+
|| operation.style.equals("rpc", ignoreCase = true)) {
190+
"Only document and RPC style SOAP bindings are supported"
191+
}
191192

192193
LOGGER.debug("Matched operation: ${operation.name} in binding ${binding.name}")
193194
return@build handle(config, parser, binding, operation, httpExchange, bodyHolder, soapAction)

mock/soap/src/main/java/io/gatehill/imposter/plugin/soap/SoapResourceMatcher.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ class SoapResourceMatcher(
209209
op.inputRef.elementName.localPart == bodyRootElement.name
210210
}
211211
is TypeOperationMessage -> {
212-
op.inputRef.typeName.namespaceURI == bodyRootElement.namespaceURI &&
213-
op.inputRef.operationName == bodyRootElement.name
212+
op.inputRef.operationName == bodyRootElement.name
213+
// TODO consider matching on body child element names against part names
214214
}
215215
else -> false
216216
}

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/AbstractEndToEndTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ abstract class AbstractEndToEndTest : BaseVerticleTest() {
180180
)
181181
}
182182

183-
protected fun httpBinding() {
183+
@Test
184+
fun testHttpBinding() {
184185
RestAssured.given()
185186
.log().ifValidationFails()
186187
.accept(soapContentType)

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl1Soap11DocumentEndToEndTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
package io.gatehill.imposter.plugin.soap
4444

4545
import io.gatehill.imposter.plugin.soap.util.SoapUtil
46-
import org.junit.Test
4746

4847
/**
4948
* Tests for [SoapPluginImpl] using WSDL v1 and SOAP 1.1.
@@ -54,7 +53,4 @@ class Wsdl1Soap11DocumentEndToEndTest : AbstractEndToEndTest() {
5453
override val testConfigDirs = listOf("/wsdl1-soap11-document")
5554
override val soapEnvNamespace = SoapUtil.soap11EnvNamespace
5655
override val soapContentType = SoapUtil.soap11ContentType
57-
58-
@Test
59-
fun testHttpBinding() = httpBinding()
6056
}

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl1Soap11MessageTypeEndToEndTest.kt

Lines changed: 0 additions & 78 deletions
This file was deleted.

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl1Soap11RpcEndToEndTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016-2024.
2+
* Copyright (c) 2016-2021.
33
*
44
* This file is part of Imposter.
55
*

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl1Soap11WithXsdImportIncludeEndToEndTest.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
package io.gatehill.imposter.plugin.soap
4444

4545
import io.gatehill.imposter.plugin.soap.util.SoapUtil
46-
import org.junit.Test
4746

4847
/**
4948
* Tests for [SoapPluginImpl] using WSDL v1 and SOAP 1.1 where XSDs are imported and included using
@@ -53,7 +52,4 @@ class Wsdl1Soap11WithXsdImportIncludeEndToEndTest : AbstractEndToEndTest() {
5352
override val testConfigDirs = listOf("/wsdl1-soap11-xsd-import-include")
5453
override val soapEnvNamespace = SoapUtil.soap11EnvNamespace
5554
override val soapContentType = SoapUtil.soap11ContentType
56-
57-
@Test
58-
fun testHttpBinding() = httpBinding()
5955
}

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl1Soap12EndToEndTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,4 @@ class Wsdl1Soap12EndToEndTest : AbstractEndToEndTest() {
5757

5858
@Test
5959
fun testRequestResponseUsingSoapActionInContentType() = soap12RequestResponseUsingSoapActionInContentType()
60-
61-
@Test
62-
fun testHttpBinding() = httpBinding()
6360
}

mock/soap/src/test/java/io/gatehill/imposter/plugin/soap/Wsdl2Soap12EndToEndTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,4 @@ class Wsdl2Soap12EndToEndTest : AbstractEndToEndTest() {
5757

5858
@Test
5959
fun testRequestResponseUsingSoapActionInContentType() = soap12RequestResponseUsingSoapActionInContentType()
60-
61-
@Test
62-
fun testHttpBinding() = httpBinding()
6360
}

mock/soap/src/test/resources/wsdl1-soap11-document/service.wsdl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151

5252
<documentation>
5353
This is a sample WSDL 1.1 document describing the pet service.
54-
It has SOAP 1.1 bindings.
54+
It has SOAP 1.1 bindings, uses the Document style, with messages
55+
specifying an XML schema element.
5556
</documentation>
5657

5758
<!-- Abstract type -->

0 commit comments

Comments
 (0)