From 2b972bd9a24f6398961ffb227e5f5b42b7274c0a Mon Sep 17 00:00:00 2001 From: Matthieu Verbert Date: Mon, 19 Mar 2018 16:45:23 +0100 Subject: [PATCH] Handle SOAP12Address like SOAPAddress SOAP 1.2 WSDL should be treated just like SOAP 1.1 ones when filtering the address location URI. --- .../switchyard/component/soap/util/WSDLUtil.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/components/soap/src/main/java/org/switchyard/component/soap/util/WSDLUtil.java b/components/soap/src/main/java/org/switchyard/component/soap/util/WSDLUtil.java index 96d2c2dd9..d033ca0d5 100644 --- a/components/soap/src/main/java/org/switchyard/component/soap/util/WSDLUtil.java +++ b/components/soap/src/main/java/org/switchyard/component/soap/util/WSDLUtil.java @@ -179,12 +179,18 @@ public static void filterWSDL(Definition definition, PropertyResolver propertyRe Service service = (Service) serviceObject; for (Object portObject : service.getPorts().values()) { Port port = (Port) portObject; + String locationURI = getEndpointAddress(port); for (Object extObject : port.getExtensibilityElements()) { - if (extObject instanceof SOAPAddress) { - SOAPAddress address = (SOAPAddress) extObject; - String toReplace = Strings.replaceProperties(address.getLocationURI(), propertyResolver); - if (!toReplace.isEmpty() && !toReplace.equals(address.getLocationURI())) { - address.setLocationURI(toReplace); + if (extObject instanceof SOAPAddress || extObject instanceof SOAP12Address) { + String toReplace = Strings.replaceProperties(locationURI, propertyResolver); + if (!toReplace.isEmpty() && !toReplace.equals(locationURI)) { + if (extObject instanceof SOAPAddress) { + SOAPAddress address = (SOAPAddress) extObject; + address.setLocationURI(toReplace); + } else if (extObject instanceof SOAP12Address) { + SOAP12Address address = (SOAP12Address) extObject; + address.setLocationURI(toReplace); + } } } }