Author: klape
Date: 2014-01-20 20:26:58 -0500 (Mon, 20 Jan 2014)
New Revision: 18266
Modified:
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/testsuite/native-tests/src/test/resources/jaxrpc/wsse/rpc/WEB-INF/wsdl/HelloService.wsdl
Log:
[JBPAPP-10940] Pulled in JBPAPP-10922 and a test suite fix to get the jaxrpc tests to
pass
Property changes on: stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940
___________________________________________________________________
Modified: svn:mergeinfo
- /stack/native/branches/jbossws-native-3.1.2:18168,18198
+ /stack/native/branches/jbossws-native-3.1.2:18159-18160,18167-18168,18170,18198
Modified:
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2014-01-16
17:14:32 UTC (rev 18265)
+++
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2014-01-21
01:26:58 UTC (rev 18266)
@@ -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;
@@ -84,6 +85,7 @@
SOAPBody soapBody = soapMessage.getSOAPBody();
SOAPBodyElement soapBodyElement = null;
+ @SuppressWarnings("rawtypes")
Iterator bodyChildren = soapBody.getChildElements();
while (bodyChildren.hasNext() && soapBodyElement == null)
{
@@ -100,14 +102,18 @@
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)
+ opMetaData = matchUsingSOAPAction(epMetaData, soapMessage);
+
+ if (opMetaData == null) {
+ // [JBWS-1125] Support empty soap body elements
+ for (OperationMetaData opAux : epMetaData.getOperations())
{
- log.debug ("Dispatching empty SOAP body");
- opMetaData = opAux;
- break;
+ if (opAux.getParameters().size() == 0)
+ {
+ log.debug ("Dispatching empty SOAP body");
+ opMetaData = opAux;
+ break;
+ }
}
}
}
@@ -116,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);
+ }
}
}
@@ -136,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;
+ }
}
Modified:
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/testsuite/native-tests/src/test/resources/jaxrpc/wsse/rpc/WEB-INF/wsdl/HelloService.wsdl
===================================================================
---
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/testsuite/native-tests/src/test/resources/jaxrpc/wsse/rpc/WEB-INF/wsdl/HelloService.wsdl 2014-01-16
17:14:32 UTC (rev 18265)
+++
stack/native/branches/jbossws-native-3.1.2.SP7_JBPAPP-10940/modules/testsuite/native-tests/src/test/resources/jaxrpc/wsse/rpc/WEB-INF/wsdl/HelloService.wsdl 2014-01-21
01:26:58 UTC (rev 18266)
@@ -45,7 +45,7 @@
<binding name='HelloBinding' type='tns:Hello'>
<soap:binding style='rpc'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='echoUserType'>
- <soap:operation soapAction=''/>
+ <soap:operation soapAction='echoUserType'/>
<input>
<soap:body namespace='http://org.jboss.test.ws/wsse'
use='literal'/>
</input>
@@ -54,7 +54,7 @@
</output>
</operation>
<operation name='triggerException'>
- <soap:operation soapAction=''/>
+ <soap:operation soapAction='triggerException'/>
<input>
<soap:body namespace='http://org.jboss.test.ws/wsse'
use='literal'/>
</input>