Author: asoldano
Date: 2013-12-10 11:51:24 -0500 (Tue, 10 Dec 2013)
New Revision: 18160
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
Log:
[JBPAPP-10922] Also consider SOAPAction header for operation selection
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
16:50:16 UTC (rev 18159)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2013-12-10
16:51:24 UTC (rev 18160)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -24,6 +24,7 @@
import java.util.Iterator;
import javax.xml.namespace.QName;
+import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
@@ -100,16 +101,41 @@
if (epMetaData.getStyle() == Style.RPC)
throw new SOAPException("Empty SOAP body with no child element not
supported for RPC");
- // [JBWS-1125] Support empty soap body elements
- for (OperationMetaData opAux : epMetaData.getOperations())
- {
- if (opAux.getParameters().size() == 0)
+
+ 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())
{
- log.debug ("Dispatching empty SOAP body");
- opMetaData = opAux;
- break;
+ if (soapAction.equals(opAux.getSOAPAction())) {
+ opMetaData = opAux;
+ break;
+ }
}
}
+
+ if (opMetaData == null) {
+ // [JBWS-1125] Support empty soap body elements
+ for (OperationMetaData opAux : epMetaData.getOperations())
+ {
+ if (opAux.getParameters().size() == 0)
+ {
+ log.debug ("Dispatching empty SOAP body");
+ opMetaData = opAux;
+ break;
+ }
+ }
+ }
}
else
{
Show replies by date