Skip to content

spring-ws-test - IllegalArgumentException during request comparison #1193

@MHajoha

Description

@MHajoha

With com.sun.xml.messaging.saaj:saaj-impl:1.5.3 (which is included in spring-boot-starter-web-services:2.4.5), the comparison of expected and actual request throws an IllegalArgumentException for us:

java.lang.IllegalArgumentException: Cannot find SOAP wrapper for element [SOAP-ENV:Envelope: null]

	at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.find(SOAPDocumentImpl.java:590)
	at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.find(SOAPDocumentImpl.java:578)
	at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.java:155)
	at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:135)
	at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getDocumentElement(SOAPPartImpl.java:430)
	at org.custommonkey.xmlunit.DifferenceEngine.compareNode(DifferenceEngine.java:191)
	at org.custommonkey.xmlunit.DifferenceEngine.compare(DifferenceEngine.java:130)
	at org.custommonkey.xmlunit.Diff.compare(Diff.java:241)
	at org.custommonkey.xmlunit.Diff.appendMessage(Diff.java:364)
	at org.custommonkey.xmlunit.Diff.toString(Diff.java:378)
	at org.springframework.ws.test.support.matcher.SoapEnvelopeDiffMatcher.match(SoapEnvelopeDiffMatcher.java:61)
	at org.springframework.ws.test.support.matcher.AbstractSoapMessageMatcher.match(AbstractSoapMessageMatcher.java:40)
	at org.springframework.ws.test.client.WebServiceMessageMatcherAdapter.match(WebServiceMessageMatcherAdapter.java:43)
	at org.springframework.ws.test.client.MockSenderConnection.send(MockSenderConnection.java:76)
	at org.springframework.ws.client.core.WebServiceTemplate.sendRequest(WebServiceTemplate.java:658)
	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:606)
	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:555)
	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390)
	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383)
	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:373)
	at org.example.SpringWsTestReproTest.Should_Work(SpringWsTestReproTest.java:37)

This does not occur with saaj-impl:1.5.2.
I've created a relatively minimal test to reproduce the issue: https://github.com/MHajoha/spring-ws-test-bug-repro

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions