Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ protected E doGet() {
protected E assemble(E gateway) {
gateway.setUriVariableExpressions(this.uriVariableExpressions);
JavaUtils.INSTANCE
.acceptIfNotNull(this.headerMapper, gateway::setHeaderMapper);
gateway.setEncodingMode(this.encodingMode);
.acceptIfNotNull(this.headerMapper, gateway::setHeaderMapper)
.acceptIfNotNull(this.encodingMode, gateway::setEncodingMode);
gateway.setIgnoreEmptyResponses(this.ignoreEmptyResponses);
gateway.setRequestCallback(this.requestCallback);
return gateway;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@

import java.util.Arrays;

import org.springframework.integration.JavaUtils;
import org.springframework.integration.ws.MarshallingWebServiceOutboundGateway;
import org.springframework.oxm.Marshaller;
import org.springframework.oxm.Unmarshaller;
Expand Down Expand Up @@ -141,9 +142,10 @@ protected MarshallingWebServiceOutboundGateway create() {
@Override
protected MarshallingWebServiceOutboundGateway assemble(MarshallingWebServiceOutboundGateway gateway) {
MarshallingWebServiceOutboundGateway assembled = super.assemble(gateway);
assembled.setFaultMessageResolver(this.faultMessageResolver);
assembled.setMessageSenders(this.messageSenders);
assembled.setInterceptors(this.gatewayInterceptors);
JavaUtils.INSTANCE
.acceptIfNotNull(this.faultMessageResolver, assembled::setFaultMessageResolver)
.acceptIfNotNull(this.messageSenders, assembled::setMessageSenders)
.acceptIfNotNull(this.gatewayInterceptors, assembled::setInterceptors);
return assembled;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@

import java.util.Arrays;

import org.springframework.integration.JavaUtils;
import org.springframework.integration.ws.SimpleWebServiceOutboundGateway;
import org.springframework.ws.WebServiceMessageFactory;
import org.springframework.ws.client.core.FaultMessageResolver;
Expand Down Expand Up @@ -100,7 +101,7 @@ public static class SimpleWsOutboundGatewayNoTemplateSpec

protected SourceExtractor<?> sourceExtractor; // NOSONAR

private boolean extractPayload;
private boolean extractPayload = true;

/**
* Configure a {@link SourceExtractor} to use.
Expand Down Expand Up @@ -181,9 +182,10 @@ protected SimpleWebServiceOutboundGateway create() {
@Override
protected SimpleWebServiceOutboundGateway assemble(SimpleWebServiceOutboundGateway gateway) {
SimpleWebServiceOutboundGateway assembled = super.assemble(gateway);
assembled.setFaultMessageResolver(this.faultMessageResolver);
assembled.setMessageSenders(this.messageSenders);
assembled.setInterceptors(this.gatewayInterceptors);
JavaUtils.INSTANCE
.acceptIfNotNull(this.faultMessageResolver, assembled::setFaultMessageResolver)
.acceptIfNotNull(this.messageSenders, assembled::setMessageSenders)
.acceptIfNotNull(this.gatewayInterceptors, assembled::setInterceptors);
assembled.setExtractPayload(this.extractPayload);
return assembled;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -96,7 +96,6 @@ void marshallingOutbound() {
.marshaller(marshaller)
.unmarshaller(unmarshaller)
.messageFactory(messageFactory)
.encodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY)
.faultMessageResolver(faultMessageResolver)
.headerMapper(headerMapper)
.ignoreEmptyResponses(true)
Expand Down Expand Up @@ -172,7 +171,6 @@ void marshallingOutboundTemplate() {
MarshallingWebServiceOutboundGateway gateway =
Ws.marshallingOutboundGateway(template)
.uri(uri)
.encodingMode(DefaultUriBuilderFactory.EncodingMode.VALUES_ONLY)
.headerMapper(headerMapper)
.ignoreEmptyResponses(true)
.requestCallback(requestCallback)
Expand All @@ -182,6 +180,10 @@ void marshallingOutboundTemplate() {
assertThat(TestUtils.getPropertyValue(gateway, "headerMapper")).isSameAs(headerMapper);
assertThat(TestUtils.getPropertyValue(gateway, "requestCallback")).isSameAs(requestCallback);
assertThat(TestUtils.getPropertyValue(gateway, "uriVariableExpressions")).isEqualTo(uriVariableExpressions);
assertThat(
TestUtils.getPropertyValue(gateway, "uriFactory.encodingMode",
DefaultUriBuilderFactory.EncodingMode.class))
.isEqualTo(DefaultUriBuilderFactory.EncodingMode.TEMPLATE_AND_VALUES);
}

@Test
Expand Down