From 8bcd9c265198e8d46e2ec862ca6e0cb47838bd7f Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Wed, 3 Jul 2019 14:30:34 +0200 Subject: Soap Client: Enable MTOM Per Default --- src/main/java/at/gv/egiz/moazs/msg/ClientFactory.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main/java/at/gv/egiz/moazs/msg/ClientFactory.java b/src/main/java/at/gv/egiz/moazs/msg/ClientFactory.java index 6729015..c2ad4a7 100644 --- a/src/main/java/at/gv/egiz/moazs/msg/ClientFactory.java +++ b/src/main/java/at/gv/egiz/moazs/msg/ClientFactory.java @@ -5,6 +5,7 @@ import at.gv.egiz.moazs.util.SSLContextCreator; import at.gv.zustellung.app2mzs.xsd.ClientType; import at.gv.zustellung.app2mzs.xsd.KeyStoreType; import at.gv.zustellung.app2mzs.xsd.SSLType; +import javax.xml.ws.soap.SOAPBinding; import org.apache.cxf.configuration.jsse.TLSClientParameters; import org.apache.cxf.endpoint.Client; import org.apache.cxf.frontend.ClientProxy; @@ -19,6 +20,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Nullable; import javax.net.ssl.SSLContext; +import javax.xml.ws.BindingProvider; import static at.gv.zustellung.app2mzs.xsd.KeyStoreType.keyStoreTypeBuilder; @@ -57,6 +59,10 @@ public class ClientFactory { Client client = ClientProxy.getClient(proxy); HTTPConduit http = (HTTPConduit) client.getConduit(); + var bindingProvider = (BindingProvider) proxy; + SOAPBinding binding = (SOAPBinding) bindingProvider.getBinding(); + binding.setMTOMEnabled(true); + var httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(params.getConnectionTimeout().longValueExact()); httpClientPolicy.setReceiveTimeout(params.getReceiveTimeout().longValueExact()); -- cgit v1.2.3