diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-10-02 14:30:43 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-10-02 14:30:43 +0200 |
commit | b3060f8ba40280d438e2b4b06b39aed84c587f7a (patch) | |
tree | 8f28026793af1a6d3b071ae91d1afe972b1d8fa7 /src/main/java/at/gv/egiz/moazs/client | |
parent | dedb4687f46c0ea10539edc38206d440fe0c806e (diff) | |
download | moa-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.java | 21 |
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(); |