Author: objectiser
Date: 2010-09-09 12:20:38 -0400 (Thu, 09 Sep 2010)
New Revision: 940
Modified:
branches/RiftSaw-2.1.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java
branches/RiftSaw-2.1.x/pom.xml
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java
trunk/pom.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
Log:
RIFTSAW-279 - now resolved for cxf aswell.
Modified:
branches/RiftSaw-2.1.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java
===================================================================
---
branches/RiftSaw-2.1.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java 2010-09-09
08:18:33 UTC (rev 939)
+++
branches/RiftSaw-2.1.x/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -39,12 +39,8 @@
}
public static Test suite() {
- if
(System.getProperty("ws.stack","native").equals("native"))
{
- return(new RiftSawTestSetup(RiftSaw279TestCase.class,
+ return(new RiftSawTestSetup(RiftSaw279TestCase.class,
TEST_NAME, "RiftSaw_279-1.jar"));
- } else {
- return(new TestSuite());
- }
}
public void testSendHello() throws Exception {
Modified: branches/RiftSaw-2.1.x/pom.xml
===================================================================
--- branches/RiftSaw-2.1.x/pom.xml 2010-09-09 08:18:33 UTC (rev 939)
+++ branches/RiftSaw-2.1.x/pom.xml 2010-09-09 16:20:38 UTC (rev 940)
@@ -407,9 +407,9 @@
<repositories>
<repository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Maven Repository Group</name>
- <
url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-developer-repository-group</id>
+ <name>JBoss Developer Maven Repository Group</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/developer/</u...
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
Modified:
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java
===================================================================
---
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java 2010-09-09
08:18:33 UTC (rev 939)
+++
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -104,8 +104,18 @@
}
}
- public void createSoapRequest(SOAPMessage soapMessage, Message odeRequestMessage,
Operation wsdlOperation)
+ /**
+ * This method creates the SOAP request and returns the SOAPAction field.
+ *
+ * @param soapMessage
+ * @param odeRequestMessage
+ * @param wsdlOperation
+ * @return The SOAP action
+ */
+ public String createSoapRequest(SOAPMessage soapMessage, Message odeRequestMessage,
Operation wsdlOperation)
{
+ String ret=null;
+
BindingOperation bop = binding.getBindingOperation(wsdlOperation.getName(), null,
null);
if (bop == null)
throw new RuntimeException("Operation "+wsdlOperation.getName()+"not
found on "+serviceName+"/"+portName);
@@ -135,18 +145,20 @@
wsdlOperation.getName()
);
- // Add SOAPAction
+ // Discover SOAPAction
for (Object extension : bop.getExtensibilityElements()) {
if (extension instanceof javax.wsdl.extensions.soap.SOAPOperation) {
javax.wsdl.extensions.soap.SOAPOperation soapop=
(javax.wsdl.extensions.soap.SOAPOperation)extension;
- if (soapop.getSoapActionURI() != null) {
- MimeHeaders hd = soapMessage.getMimeHeaders();
- hd.addHeader("SOAPAction", soapop.getSoapActionURI());
+ if (soapop.getSoapActionURI() != null) {
+ ret = soapop.getSoapActionURI();
+ break;
}
}
}
+
+ return(ret);
}
public boolean isRPC()
Modified:
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-09-09
08:18:33 UTC (rev 939)
+++
branches/RiftSaw-2.1.x/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -32,6 +32,7 @@
import javax.wsdl.Fault;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Dispatch;
@@ -219,18 +220,32 @@
if(log.isDebugEnabled())
log.debug( "ODE outbound message: \n"
+DOMWriter.printNode(mex.getRequest().getMessage(), true) );
- messageAdapter.createSoapRequest(soapRequestMessage, mex.getRequest(),
mex.getOperation());
+ String soapAction=messageAdapter.createSoapRequest(soapRequestMessage,
mex.getRequest(), mex.getOperation());
if (log.isDebugEnabled()) {
log.debug("Riftsaw soap request message: \n" +
JavaUtils.getSoapMessageASString(soapRequestMessage));
}
// The actual WS invocation
- Dispatch proxy = getDispatcher(port);
+ Dispatch<SOAPMessage> proxy = getDispatcher(port);
try {
+ // Set SOAPAction
+ if (soapAction != null) {
+ // Setting soap action using both approaches, as CXF needs one and
JBossWS-Native the other
+ proxy.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY,
soapAction);
+ MimeHeaders hd = soapRequestMessage.getMimeHeaders();
+ hd.addHeader("SOAPAction", soapAction);
+ } else if (log.isDebugEnabled()) {
+ log.debug("SOAPAction not set");
+ }
+
SOAPMessage soapResponseMessage =
(SOAPMessage)proxy.invoke(soapRequestMessage);
+ if (log.isDebugEnabled()) {
+ log.debug("Riftsaw soap response message: \n" +
JavaUtils.getSoapMessageASString(soapResponseMessage));
+ }
+
// Create ODE response
Message odeResponse =
mex.createMessage(mex.getOperation().getOutput().getMessage().getQName());
if(soapResponseMessage.getSOAPBody().hasFault())
@@ -261,6 +276,10 @@
Element odeMsgEl = odeMsg.createElementNS(null, "message");
odeMsg.appendChild(odeMsgEl);
+ if (log.isDebugEnabled()) {
+ log.debug("Riftsaw soap fault: \n" +
DOMWriter.printNode(fe.getFault(), true));
+ }
+
Fault fault=messageAdapter.parseSoapFault(odeMsgEl, fe.getFault(),
mex.getOperation());
@@ -365,7 +384,7 @@
throw new RuntimeException("Not implemented. Should be removed form
interface");
}
- private synchronized Dispatch getDispatcher(QName portName)
+ private synchronized Dispatch<SOAPMessage> getDispatcher(QName portName)
{
if(null==dispatcher) {
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java 2010-09-09
08:18:33 UTC (rev 939)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/testcases/RiftSaw279TestCase.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -39,12 +39,8 @@
}
public static Test suite() {
- if
(System.getProperty("ws.stack","native").equals("native"))
{
- return(new RiftSawTestSetup(RiftSaw279TestCase.class,
+ return(new RiftSawTestSetup(RiftSaw279TestCase.class,
TEST_NAME, "RiftSaw_279-1.jar"));
- } else {
- return(new TestSuite());
- }
}
public void testSendHello() throws Exception {
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-09-09 08:18:33 UTC (rev 939)
+++ trunk/pom.xml 2010-09-09 16:20:38 UTC (rev 940)
@@ -411,9 +411,9 @@
<repositories>
<repository>
- <id>jboss-public-repository-group</id>
- <name>JBoss Public Maven Repository Group</name>
- <
url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <id>jboss-developer-repository-group</id>
+ <name>JBoss Developer Maven Repository Group</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/developer/</u...
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java 2010-09-09
08:18:33 UTC (rev 939)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -104,8 +104,18 @@
}
}
- public void createSoapRequest(SOAPMessage soapMessage, Message odeRequestMessage,
Operation wsdlOperation)
+ /**
+ * This method creates the SOAP request and returns the SOAPAction field.
+ *
+ * @param soapMessage
+ * @param odeRequestMessage
+ * @param wsdlOperation
+ * @return The SOAP action
+ */
+ public String createSoapRequest(SOAPMessage soapMessage, Message odeRequestMessage,
Operation wsdlOperation)
{
+ String ret=null;
+
BindingOperation bop = binding.getBindingOperation(wsdlOperation.getName(), null,
null);
if (bop == null)
throw new RuntimeException("Operation "+wsdlOperation.getName()+"not
found on "+serviceName+"/"+portName);
@@ -135,18 +145,20 @@
wsdlOperation.getName()
);
- // Add SOAPAction
+ // Discover SOAPAction
for (Object extension : bop.getExtensibilityElements()) {
if (extension instanceof javax.wsdl.extensions.soap.SOAPOperation) {
javax.wsdl.extensions.soap.SOAPOperation soapop=
(javax.wsdl.extensions.soap.SOAPOperation)extension;
- if (soapop.getSoapActionURI() != null) {
- MimeHeaders hd = soapMessage.getMimeHeaders();
- hd.addHeader("SOAPAction", soapop.getSoapActionURI());
+ if (soapop.getSoapActionURI() != null) {
+ ret = soapop.getSoapActionURI();
+ break;
}
}
}
+
+ return(ret);
}
public boolean isRPC()
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-09-09
08:18:33 UTC (rev 939)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceClient.java 2010-09-09
16:20:38 UTC (rev 940)
@@ -32,6 +32,7 @@
import javax.wsdl.Fault;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Dispatch;
@@ -219,18 +220,32 @@
if(log.isDebugEnabled())
log.debug( "ODE outbound message: \n"
+DOMWriter.printNode(mex.getRequest().getMessage(), true) );
- messageAdapter.createSoapRequest(soapRequestMessage, mex.getRequest(),
mex.getOperation());
+ String soapAction=messageAdapter.createSoapRequest(soapRequestMessage,
mex.getRequest(), mex.getOperation());
if (log.isDebugEnabled()) {
log.debug("Riftsaw soap request message: \n" +
JavaUtils.getSoapMessageASString(soapRequestMessage));
}
// The actual WS invocation
- Dispatch proxy = getDispatcher(port);
+ Dispatch<SOAPMessage> proxy = getDispatcher(port);
try {
+ // Set SOAPAction
+ if (soapAction != null) {
+ // Setting soap action using both approaches, as CXF needs one and
JBossWS-Native the other
+ proxy.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY,
soapAction);
+ MimeHeaders hd = soapRequestMessage.getMimeHeaders();
+ hd.addHeader("SOAPAction", soapAction);
+ } else if (log.isDebugEnabled()) {
+ log.debug("SOAPAction not set");
+ }
+
SOAPMessage soapResponseMessage =
(SOAPMessage)proxy.invoke(soapRequestMessage);
+ if (log.isDebugEnabled()) {
+ log.debug("Riftsaw soap response message: \n" +
JavaUtils.getSoapMessageASString(soapResponseMessage));
+ }
+
// Create ODE response
Message odeResponse =
mex.createMessage(mex.getOperation().getOutput().getMessage().getQName());
if(soapResponseMessage.getSOAPBody().hasFault())
@@ -261,6 +276,10 @@
Element odeMsgEl = odeMsg.createElementNS(null, "message");
odeMsg.appendChild(odeMsgEl);
+ if (log.isDebugEnabled()) {
+ log.debug("Riftsaw soap fault: \n" +
DOMWriter.printNode(fe.getFault(), true));
+ }
+
Fault fault=messageAdapter.parseSoapFault(odeMsgEl, fe.getFault(),
mex.getOperation());
@@ -365,7 +384,7 @@
throw new RuntimeException("Not implemented. Should be removed form
interface");
}
- private synchronized Dispatch getDispatcher(QName portName)
+ private synchronized Dispatch<SOAPMessage> getDispatcher(QName portName)
{
if(null==dispatcher) {