Author: objectiser
Date: 2010-11-16 17:06:58 -0500 (Tue, 16 Nov 2010)
New Revision: 1110
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSInvocationAdapter.java
Removed:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEMessageAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/InvocationAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/MessageAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ServiceInvoker.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSDLReference.java
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java
Log:
Removed the ODE message class from the InvocationAdapter API.
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -240,11 +240,11 @@
if (__log.isDebugEnabled())
__log.debug("Fault response message: " + mex.getFault());
- invocationAdapter.createFault(mex);
+ invocationAdapter.createFault(mex.getOperation(), mex.getFault(), new
ODEMessageAdapter(mex.getFaultResponse()));
break;
case ASYNC:
case RESPONSE:
- invocationAdapter.createResponse(mex);
+ invocationAdapter.createResponse(mex.getOperation(), new
ODEMessageAdapter(mex.getResponse()));
if (__log.isDebugEnabled())
__log.debug("Response message " + ret);
break;
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEMessageAdapter.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEMessageAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEMessageAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -27,6 +27,10 @@
public ODEMessageAdapter(Message mesg) {
m_message = mesg;
}
+
+ public org.w3c.dom.Element getMessage() {
+ return(m_message.getMessage());
+ }
public void setPart(String name, org.w3c.dom.Element elem) {
if (name == null) {
@@ -35,9 +39,16 @@
m_message.setPart(name, elem);
}
}
+
+ public org.w3c.dom.Element getPart(String name) {
+ return(m_message.getPart(name));
+ }
public void setHeaderPart(String name, org.w3c.dom.Element elem) {
m_message.setHeaderPart(name, elem);
}
+ public java.util.Map<String, org.w3c.dom.Node> getHeaderParts() {
+ return(m_message.getHeaderParts());
+ }
}
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/ODEWebServiceFactory.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -24,6 +24,7 @@
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.si.ServiceInvoker;
import org.jboss.soa.si.ws.SOAPMessageAdapter;
+import org.jboss.soa.si.ws.WSInvocationAdapter;
import org.jboss.soa.si.ws.WebServiceFactory;
public class ODEWebServiceFactory implements WebServiceFactory {
Deleted:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.soa.bpel.runtime.ws;
-
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.jboss.soa.si.InvocationAdapter;
-import org.jboss.soa.si.MessageAdapter;
-import org.jboss.soa.si.ws.SOAPMessageAdapter;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-/**
- * @author Heiko Braun <hbraun(a)redhat.com>
- */
-public final class WSInvocationAdapter implements InvocationAdapter<SOAPMessage>
-{
- private final String operationName;
- private final QName serviceName;
- private final String portName;
-
- private SOAPMessage soapRequestMessage;
- private SOAPMessage soapResponseMessage;
-
- private final SOAPMessageAdapter soapAdapter;
-
- public WSInvocationAdapter(String operationName,
- QName serviceName, String portName, SOAPMessageAdapter soapAdapter)
- {
- this.operationName = operationName;
- this.serviceName = serviceName;
- this.portName = portName;
- this.soapAdapter = soapAdapter;
- }
-
- public String getOperationName()
- {
- return operationName;
- }
-
- public QName getServiceName()
- {
- return serviceName;
- }
-
- public String getPortName()
- {
- return portName;
- }
-
- public void initRequest(javax.wsdl.Operation op, MessageAdapter request)
- {
- if(null==soapRequestMessage)
- throw new IllegalArgumentException("No request SOAPMessage set");
-
- soapAdapter.parseSoapRequest(request, soapRequestMessage, op);
- }
-
- public void createResponse(MyRoleMessageExchange mex)
- {
- try
- {
- // create SOAPEnvelope
- soapResponseMessage = MessageFactory.newInstance().createMessage();
- soapAdapter.createSoapResponse(soapResponseMessage, mex.getResponse(),
mex.getOperation());
- }
- catch (SOAPException e)
- {
- throw new RuntimeException("Failed to create SOAP response", e);
- }
- }
-
- public void createFault(MyRoleMessageExchange mex)
- {
- try
- {
- soapResponseMessage = MessageFactory.newInstance().createMessage();
- soapAdapter.createSoapFault(soapResponseMessage,
mex.getFaultResponse().getMessage(), mex.getFault(), mex.getOperation() );
- }
- catch (SOAPException e)
- {
- throw new RuntimeException("Failed to create SOAP fault", e);
- }
- }
-
- public SOAPMessage getInvocationResult()
- {
- if(null==soapResponseMessage)
- throw new IllegalArgumentException("No response SOAPMessage set");
-
- return soapResponseMessage;
- }
-
- public void setSOAPMessage(SOAPMessage soapMessage)
- {
- this.soapRequestMessage = soapMessage;
- }
-}
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/InvocationAdapter.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/si/InvocationAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/si/InvocationAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -19,12 +19,8 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-
package org.jboss.soa.si;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-
import javax.xml.namespace.QName;
/**
@@ -57,9 +53,10 @@
* turning an ODE response {@link org.apache.ode.bpel.iapi.Message} into an external
format <T>
* @param mex
*/
- void createResponse(MyRoleMessageExchange mex);
+ void createResponse(javax.wsdl.Operation wsdl, MessageAdapter resp);
- void createFault(MyRoleMessageExchange mex);
+ void createFault(javax.wsdl.Operation op, QName faultName, MessageAdapter fault);
+
/**
* Access the invocation result (response)
* @return T
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/MessageAdapter.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/si/MessageAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/si/MessageAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -19,8 +19,14 @@
public interface MessageAdapter {
+ public org.w3c.dom.Element getMessage();
+
public void setPart(String name, org.w3c.dom.Element elem);
+ public org.w3c.dom.Element getPart(String name);
+
public void setHeaderPart(String name, org.w3c.dom.Element elem);
+ public java.util.Map<String, org.w3c.dom.Node> getHeaderParts();
+
}
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ServiceInvoker.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/si/ServiceInvoker.java 2010-11-16
20:45:11 UTC (rev 1109)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/si/ServiceInvoker.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -17,7 +17,6 @@
*/
package org.jboss.soa.si;
-
public interface ServiceInvoker {
/**
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/BaseWebServiceEndpoint.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -21,10 +21,8 @@
*/
package org.jboss.soa.si.ws;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.soa.bpel.runtime.ws.WSInvocationAdapter;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -27,7 +27,6 @@
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.stl.CollectionsX;
import org.apache.ode.utils.wsdl.WsdlUtils;
-import org.jboss.soa.bpel.runtime.ws.WebServiceClient;
import org.jboss.soa.si.MessageAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -168,7 +167,7 @@
return isRPC;
}
- public void createSoapResponse(SOAPMessage soapMessage, Message odeResponseMessage,
Operation wsdlOperation)
+ public void createSoapResponse(SOAPMessage soapMessage, MessageAdapter
odeResponseMessage, Operation wsdlOperation)
{
BindingOperation bop =
binding.getBindingOperation(wsdlOperation.getName(),null,null);
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSDLReference.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSDLReference.java 2010-11-16
20:45:11 UTC (rev 1109)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSDLReference.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -23,8 +23,6 @@
import javax.wsdl.Definition;
-import org.jboss.soa.bpel.runtime.ws.EndpointManager;
-
import java.net.URI;
import java.net.URL;
import java.net.MalformedURLException;
Copied: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSInvocationAdapter.java
(from rev 1109,
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java)
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSInvocationAdapter.java
(rev 0)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WSInvocationAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.si.ws;
+
+import org.jboss.soa.si.InvocationAdapter;
+import org.jboss.soa.si.MessageAdapter;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public final class WSInvocationAdapter implements InvocationAdapter<SOAPMessage>
+{
+ private final String operationName;
+ private final QName serviceName;
+ private final String portName;
+
+ private SOAPMessage soapRequestMessage;
+ private SOAPMessage soapResponseMessage;
+
+ private final SOAPMessageAdapter soapAdapter;
+
+ public WSInvocationAdapter(String operationName,
+ QName serviceName, String portName, SOAPMessageAdapter soapAdapter)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ this.portName = portName;
+ this.soapAdapter = soapAdapter;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public String getPortName()
+ {
+ return portName;
+ }
+
+ public void initRequest(javax.wsdl.Operation op, MessageAdapter request)
+ {
+ if(null==soapRequestMessage)
+ throw new IllegalArgumentException("No request SOAPMessage set");
+
+ soapAdapter.parseSoapRequest(request, soapRequestMessage, op);
+ }
+
+ public void createResponse(javax.wsdl.Operation op, MessageAdapter resp)
+ {
+ try
+ {
+ // create SOAPEnvelope
+ soapResponseMessage = MessageFactory.newInstance().createMessage();
+ soapAdapter.createSoapResponse(soapResponseMessage,resp, op);
+ }
+ catch (SOAPException e)
+ {
+ throw new RuntimeException("Failed to create SOAP response", e);
+ }
+ }
+
+ public void createFault(javax.wsdl.Operation op, QName faultName, MessageAdapter
fault)
+ {
+ try
+ {
+ soapResponseMessage = MessageFactory.newInstance().createMessage();
+ soapAdapter.createSoapFault(soapResponseMessage, fault.getMessage(), faultName,
op);
+ }
+ catch (SOAPException e)
+ {
+ throw new RuntimeException("Failed to create SOAP fault", e);
+ }
+ }
+
+ public SOAPMessage getInvocationResult()
+ {
+ if(null==soapResponseMessage)
+ throw new IllegalArgumentException("No response SOAPMessage set");
+
+ return soapResponseMessage;
+ }
+
+ public void setSOAPMessage(SOAPMessage soapMessage)
+ {
+ this.soapRequestMessage = soapMessage;
+ }
+}
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/WebServiceFactory.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -19,7 +19,6 @@
import javax.xml.namespace.QName;
-import org.jboss.soa.bpel.runtime.ws.WSInvocationAdapter;
import org.jboss.soa.si.ServiceInvoker;
public interface WebServiceFactory {
Modified:
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java
===================================================================
---
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java 2010-11-16
20:45:11 UTC (rev 1109)
+++
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/internal/soa/esb/actions/bpel/ESBInvocationAdapter.java 2010-11-16
22:06:58 UTC (rev 1110)
@@ -21,8 +21,6 @@
*/
package org.jboss.internal.soa.esb.actions.bpel;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
import org.jboss.soa.si.InvocationAdapter;
import org.jboss.soa.si.MessageAdapter;
import org.w3c.dom.Element;
@@ -96,15 +94,15 @@
}
}
- public void createResponse(MyRoleMessageExchange mex)
+ public void createResponse(javax.wsdl.Operation op, MessageAdapter resp)
{
- this.responseXML = mex.getResponse().getMessage();
+ this.responseXML = resp.getMessage();
}
- public void createFault(MyRoleMessageExchange mex)
+ public void createFault(javax.wsdl.Operation op, QName faultName, MessageAdapter
fault)
{
- this.responseXML = mex.getFaultResponse().getMessage();
- this.faultName = mex.getFault();
+ this.responseXML = fault.getMessage();
+ this.faultName = faultName;
}
public Element getInvocationResult()