New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MarshallingWsOutboundGatewayNoTemplateSpec overwrites useful WebserviceTemplate defaults with null #3688
Comments
gviczai
added
status: waiting-for-triage
The issue need to be evaluated and its future decided
type: bug
labels
Dec 10, 2021
artembilan
added
backport 5.3.x
in: ws
and removed
status: waiting-for-triage
The issue need to be evaluated and its future decided
labels
Dec 10, 2021
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
Dec 10, 2021
Fixes spring-projects#3688 The `WebServiceTemplate` is populated with some defaults from its ctor. We should rely on the target default template values as much as possible and don't override them to `null` if end-user doesn't ask about that explicitly * Fix `BaseWsOutboundGatewaySpec` extensions to populate values to the target gateway only if they are not null - therefore provided by end-user * If end-user wants them explicitly `null`, it is better to do that via externally configured template. See overloaded variants for DSL: `Ws.marshallingOutboundGateway(WebServiceTemplate)` and `Ws.simpleOutboundGateway(WebServiceTemplate)` **Cherry-pick to `5.4.x` & `5.3.x`**
garyrussell
pushed a commit
that referenced
this issue
Dec 13, 2021
Fixes #3688 The `WebServiceTemplate` is populated with some defaults from its ctor. We should rely on the target default template values as much as possible and don't override them to `null` if end-user doesn't ask about that explicitly * Fix `BaseWsOutboundGatewaySpec` extensions to populate values to the target gateway only if they are not null - therefore provided by end-user * If end-user wants them explicitly `null`, it is better to do that via externally configured template. See overloaded variants for DSL: `Ws.marshallingOutboundGateway(WebServiceTemplate)` and `Ws.simpleOutboundGateway(WebServiceTemplate)` **Cherry-pick to `5.4.x` & `5.3.x`**
garyrussell
pushed a commit
that referenced
this issue
Dec 13, 2021
Fixes #3688 The `WebServiceTemplate` is populated with some defaults from its ctor. We should rely on the target default template values as much as possible and don't override them to `null` if end-user doesn't ask about that explicitly * Fix `BaseWsOutboundGatewaySpec` extensions to populate values to the target gateway only if they are not null - therefore provided by end-user * If end-user wants them explicitly `null`, it is better to do that via externally configured template. See overloaded variants for DSL: `Ws.marshallingOutboundGateway(WebServiceTemplate)` and `Ws.simpleOutboundGateway(WebServiceTemplate)` **Cherry-pick to `5.4.x` & `5.3.x`**
garyrussell
pushed a commit
that referenced
this issue
Dec 13, 2021
Fixes #3688 The `WebServiceTemplate` is populated with some defaults from its ctor. We should rely on the target default template values as much as possible and don't override them to `null` if end-user doesn't ask about that explicitly * Fix `BaseWsOutboundGatewaySpec` extensions to populate values to the target gateway only if they are not null - therefore provided by end-user * If end-user wants them explicitly `null`, it is better to do that via externally configured template. See overloaded variants for DSL: `Ws.marshallingOutboundGateway(WebServiceTemplate)` and `Ws.simpleOutboundGateway(WebServiceTemplate)` **Cherry-pick to `5.4.x` & `5.3.x`**
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In what version(s) of Spring Integration are you seeing this issue?
5.5.6, 5.4.x, but other versions are affected as well
Describe the bug
In MarshallingWsOutboundGatewaySpec.MarshallingWsOutboundGatewayNoTemplateSpec class the assemble() method overwrites messageSenders and faultMessageResolver's otherwise useful and valid default not null values
with null values in the WebServiceTemplate created by the builder itself if no values provided in the builder explicitly:
https://github.com/spring-projects/spring-integration/blob/5.4.x/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/MarshallingWsOutboundGatewaySpec.java#L144
https://github.com/spring-projects/spring-integration/blob/5.4.x/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java#L181
Also, one MUST provide an encodingMode in the builder, because BaseWsOutboundGatewaySpec does exactly the same (overwrites the correct default value without null checking) with the UriFactory's encodingMode:
https://github.com/spring-projects/spring-integration/blob/5.4.x/spring-integration-ws/src/main/java/org/springframework/integration/ws/dsl/BaseWsOutboundGatewaySpec.java#L162
https://github.com/spring-projects/spring-integration/blob/5.4.x/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java#L140
To Reproduce
create a Ws.marshallingOutboundGateway()
Expected behavior
faultMessageResolver, messageSenders and enCodingmode:
(Note: A simple null check before the setter calls would be sufficient.)
Sample
The text was updated successfully, but these errors were encountered: