aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv')
-rw-r--r--src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java2
-rw-r--r--src/main/java/at/gv/egiz/moazs/client/ClientFactory.java21
-rw-r--r--src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java12
3 files changed, 25 insertions, 10 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java b/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java
index d870aa8..8e1566e 100644
--- a/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java
+++ b/src/main/java/at/gv/egiz/moazs/backend/ForwardResponseToServiceSink.java
@@ -33,7 +33,7 @@ public class ForwardResponseToServiceSink {
log.info("Forward msg:{} with AppDeliveryID={} to service at {}.",
msgResponse.getRootElementLocalPart(), msgResponse.getAppDeliveryID(), params.getURL());
var binaryResponse = repository.retrieveBinaryResponse(msgResponse.getResponseID());
- Mzs2AppPortType client = factory.create(params, Mzs2AppPortType.class);
+ Mzs2AppPortType client = factory.createSoap11(params, Mzs2AppPortType.class);
return msgResponse.sendToAppClient(converter, binaryResponse, client);
}
}
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();
diff --git a/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java b/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java
index f44fb3d..6ec120f 100644
--- a/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java
+++ b/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java
@@ -2,7 +2,7 @@ package at.gv.egiz.moazs.scheme;
import at.gv.egiz.eaaf.core.impl.utils.DOMUtils;
import at.gv.egiz.moazs.MoaZSException;
-import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.binding.soap.Soap12;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -26,8 +26,8 @@ import static at.gv.egiz.moazs.MoaZSException.moaZSException;
public class SOAPUtils {
private static final Logger log = LoggerFactory.getLogger(SOAPUtils.class);
- private static final String SOAP_BODY_MISSING_ERROR_MSG = "<soap11:Body> is missing.";
- private static final String SOAP_BODY_CHILDREN_MISSING_ERROR_MSG = "<soap11:Body> has no child elements.";
+ private static final String SOAP_BODY_MISSING_ERROR_MSG = "<soap12:Body> is missing.";
+ private static final String SOAP_BODY_CHILDREN_MISSING_ERROR_MSG = "<soap12:Body> has no child elements.";
private static final String APP_DELIVERY_ID_FULL_TAG_NAME = "<msg:" + NameSpace.MSG_APP_DELIVERY_ID + ">";
private static final String MULTIPLE_MSG = "Found multiple {} elements. Will choose first element.";
private static final String APP_DELIVERY_ID_MISSING_ERROR_MSG = APP_DELIVERY_ID_FULL_TAG_NAME + " is missing.";
@@ -40,16 +40,16 @@ public class SOAPUtils {
public Node getChildElementOfSoapBody(Element document) throws MoaZSException {
- var bodyList = document.getElementsByTagNameNS(Soap11.SOAP_NAMESPACE, "Body");
+ var bodyList = document.getElementsByTagNameNS(Soap12.SOAP_NAMESPACE, "Body");
if (bodyList.getLength() == 0) throw moaZSException(SOAP_BODY_MISSING_ERROR_MSG);
- if (bodyList.getLength() > 1) log.warn(MULTIPLE_MSG, "<soap11:Body>");
+ if (bodyList.getLength() > 1) log.warn(MULTIPLE_MSG, "<soap12:Body>");
var body = bodyList.item(0);
var children = body.getChildNodes();
var candidates = filterNodeByType(children, Node.ELEMENT_NODE);
if (candidates.isEmpty()) throw moaZSException(SOAP_BODY_CHILDREN_MISSING_ERROR_MSG);
- if (candidates.size() > 1) log.warn(MULTIPLE_MSG, "<soap11:Body> child");
+ if (candidates.size() > 1) log.warn(MULTIPLE_MSG, "<soap12:Body> child");
return candidates.get(0);
}