outofcoffee/imposter

NPE while parsing a WSDL with rpc/encoded style

irek-work opened this issue · 2 comments

Hi everybody,

when I try to start imposter using a WSDL with rpc/encoded style I get an exception in WSDL1Parser:

java.lang.NullPointerException: null
	at io.gatehill.imposter.plugin.soap.parser.Wsdl1Parser.getMessagePartElementName(Wsdl1Parser.kt:221) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.plugin.soap.parser.Wsdl1Parser.getOperation(Wsdl1Parser.kt:166) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.plugin.soap.parser.Wsdl1Parser.getBinding(Wsdl1Parser.kt:85) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.plugin.soap.parser.VersionAwareWsdlParser.getBinding(VersionAwareWsdlParser.kt:91) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.plugin.soap.SoapPluginImpl.parseWsdls(SoapPluginImpl.kt:124) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.plugin.soap.SoapPluginImpl.configureRoutes(SoapPluginImpl.kt:108) ~[imposter-mock-soap-3.35.0.jar:?]
	at io.gatehill.imposter.Imposter.configureRoutes(Imposter.kt:221) ~[imposter-engine-3.35.0.jar:?]
	at io.gatehill.imposter.Imposter.access$configureRoutes(Imposter.kt:88) ~[imposter-engine-3.35.0.jar:?]
	at io.gatehill.imposter.Imposter$start$1.invokeSuspend(Imposter.kt:135) ~[imposter-engine-3.35.0.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.9.10.jar:1.9.10-release-459]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) ~[kotlinx-coroutines-core-jvm-1.7.3.jar:?]

The WSDL is valid (I can't post it because of my customer).
Is rpc/encoded not supported or it is just a bug?
I look forward for your answers / fixes.

Edit: I found the code line which causes npe:
Bildschirmfoto 2024-03-28 um 14 14 10
here you try to read "element" but here in wsdl:part:
Bildschirmfoto 2024-03-28 um 14 14 39
is no attribute "element" (and it shouldn't be there) but "type"

Hi @irek-work, thanks for raising this. Support for RPC style needed improving. There is better support for RPC style in v3.37.0.

Please could you let me know if this helps? If not, sharing a WSDL file to test will enable us to create a test case for your circumstances.

Hi @irek-work, thanks again for raising this. Given the various improvements to RPC style SOAP services since v3.37, I'm going to close this issue, but please reopen it if it's still an issue.