aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/client
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-10-02 14:30:43 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-10-02 14:30:43 +0200
commitb3060f8ba40280d438e2b4b06b39aed84c587f7a (patch)
tree8f28026793af1a6d3b071ae91d1afe972b1d8fa7 /src/main/java/at/gv/egiz/moazs/client
parentdedb4687f46c0ea10539edc38206d440fe0c806e (diff)
downloadmoa-zs-b3060f8ba40280d438e2b4b06b39aed84c587f7a.tar.gz
moa-zs-b3060f8ba40280d438e2b4b06b39aed84c587f7a.tar.bz2
moa-zs-b3060f8ba40280d438e2b4b06b39aed84c587f7a.zip
For {TNVZ, MSG}: Switch to Soap 1.2
- But: Leave MZS Interface at Soap 1.1 - Add ClientFactory.createSOAP11 to ensure that we can talk back to the app.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/client')
-rw-r--r--src/main/java/at/gv/egiz/moazs/client/ClientFactory.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/client/ClientFactory.java b/src/main/java/at/gv/egiz/moazs/client/ClientFactory.java
index 44da83a..8b2054b 100644
--- a/src/main/java/at/gv/egiz/moazs/client/ClientFactory.java
+++ b/src/main/java/at/gv/egiz/moazs/client/ClientFactory.java
@@ -55,16 +55,27 @@ public class ClientFactory {
}
/**
- * Creates a client that communicates with a soap service.
+ * Creates a client that communicates with a soap 1.2 service.
*
* @param params for the client, such as service url and ssl parameters.
* @return the client
*/
public <T> T create(ClientType params, Class<T> clazz) {
- return JAXBClassNotFoundFix.runInTheadWithClassClassLoader(() -> createClient(params, clazz));
+ return JAXBClassNotFoundFix.runInTheadWithClassClassLoader(() -> create(params, clazz, true));
}
- private <T> T createClient(ClientType params, Class<T> clazz) {
+ /**
+ * Creates a client that communicates with a soap 1.1 service.
+ *
+ * @param params for the client, such as service url and ssl parameters.
+ * @return the client
+ */
+ public <T> T createSoap11(ClientType params, Class<T> clazz) {
+ return JAXBClassNotFoundFix.runInTheadWithClassClassLoader(() -> create(params, clazz, false));
+ }
+
+
+ private <T> T create(ClientType params, Class<T> clazz, boolean isSoap12) {
log.info("Create client for service {}", params.getURL());
@@ -72,6 +83,10 @@ public class ClientFactory {
factory.setServiceClass(clazz);
factory.setAddress(params.getURL());
factory.getInInterceptors().add(storeResponseInterceptor);
+
+ if (isSoap12) {
+ factory.setBindingId(SOAPBinding.SOAP12HTTP_MTOM_BINDING);
+ }
setupLoggingInterceptors(factory);
var proxy = new JaxWsProxyFactoryBean(factory).create();