diff options
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(); |