Author: asoldano
Date: 2013-12-11 08:27:25 -0500 (Wed, 11 Dec 2013)
New Revision: 18167
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
Log:
[JBPAPP-10922] Fallback to SOAPAction based operation selection also when resolution using
first body child did not match any operation
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2013-12-10
21:43:53 UTC (rev 18166)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2013-12-11
13:27:25 UTC (rev 18167)
@@ -85,6 +85,7 @@
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = null;
+ @SuppressWarnings("rawtypes")
Iterator bodyChildren = soapBody.getChildElements();
while (bodyChildren.hasNext() && soapBodyElement == null)
{
@@ -101,28 +102,7 @@
if (epMetaData.getStyle() == Style.RPC)
throw new SOAPException("Empty SOAP body with no child element not
supported for RPC");
-
- String soapAction = null;
- final MimeHeaders mh = soapMessage.getMimeHeaders();
- if (mh != null) {
- final String[] array = mh.getHeader("SOAPAction");
- if (array != null && array.length > 0) {
- soapAction = array[0];
- if (soapAction != null &&
soapAction.startsWith("\"") &&
soapAction.endsWith("\"")) {
- soapAction = soapAction.substring(1, soapAction.length() - 1);
- }
- }
- }
-
- if (soapAction != null && soapAction.length() > 0) {
- for (OperationMetaData opAux : epMetaData.getOperations())
- {
- if (soapAction.equals(opAux.getSOAPAction())) {
- opMetaData = opAux;
- break;
- }
- }
- }
+ opMetaData = matchUsingSOAPAction(epMetaData, soapMessage);
if (opMetaData == null) {
// [JBWS-1125] Support empty soap body elements
@@ -142,6 +122,10 @@
Name soapName = soapBodyElement.getElementName();
QName xmlElementName = new QName(soapName.getURI(),
soapName.getLocalName());
opMetaData = epMetaData.getOperation(xmlElementName);
+
+ if (opMetaData == null) {
+ opMetaData = matchUsingSOAPAction(epMetaData, soapMessage);
+ }
}
}
@@ -162,4 +146,28 @@
log.debug("getDispatchDestination: " + (opMetaData != null ?
opMetaData.getQName() : null));
return opMetaData;
}
+
+ private OperationMetaData matchUsingSOAPAction(final EndpointMetaData epMetaData,
final SOAPMessage soapMessage) {
+ String soapAction = null;
+ final MimeHeaders mh = soapMessage.getMimeHeaders();
+ if (mh != null) {
+ final String[] array = mh.getHeader("SOAPAction");
+ if (array != null && array.length > 0) {
+ soapAction = array[0];
+ if (soapAction != null && soapAction.startsWith("\"")
&& soapAction.endsWith("\"")) {
+ soapAction = soapAction.substring(1, soapAction.length() - 1);
+ }
+ }
+ }
+
+ if (soapAction != null && soapAction.length() > 0) {
+ for (OperationMetaData opAux : epMetaData.getOperations())
+ {
+ if (soapAction.equals(opAux.getSOAPAction())) {
+ return opAux;
+ }
+ }
+ }
+ return null;
+ }
}
Show replies by date