riftsaw SVN: r257 - in trunk: integration-tests and 9 other directories.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-11-09 11:43:42 -0500 (Mon, 09 Nov 2009)
New Revision: 257
Modified:
trunk/distribution/src/main/release/install/build.xml
trunk/distribution/src/main/release/install/deployment.properties
trunk/integration-tests/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml
trunk/qa/build.xml
trunk/qa/hudson-riftsaw-db.sh
trunk/qa/hudson-riftsaw-jboss.sh
trunk/qa/hudson-riftsaw-jdk5.sh
trunk/qa/hudson-riftsaw-ws.sh
trunk/samples/quickstart/atm/build.xml
trunk/samples/quickstart/hello_world/build.xml
trunk/samples/quickstart/loan_approval/build.xml
trunk/samples/quickstart/simple_correlation/build.xml
trunk/samples/quickstart/simple_invoke/build.xml
Log:
* replace the 'esb.server' in the deployment.properties as 'as.home'. also 'esb.config' as 'as.config'.
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/distribution/src/main/release/install/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -7,7 +7,7 @@
<property file="${org.jboss.soa.bpel.deployment.properties}"/>
<property file="../version.properties" />
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
<property name="conf.dir" value="${server.dir}/conf"/>
<property name="deploy.dir" value="${server.dir}/deploy"/>
<property name="deployers.dir" value="${server.dir}/deployers"/>
@@ -38,22 +38,21 @@
<property name="samples" value="../samples" />
<target name="check.deploy.props">
- <condition property="esb.server.configured">
+ <condition property="as.configured">
<and>
- <isset property="org.jboss.esb.server.home"/>
- <isset property="org.jboss.esb.server.config"/>
+ <isset property="org.jboss.as.home"/>
+ <isset property="org.jboss.as.config"/>
<isset property="org.jboss.esb.home"/>
</and>
</condition>
- <fail unless="esb.server.configured" message="Cannot determine target deployment, please check deployment.properties"/>
+ <fail unless="as.configured" message="Cannot determine target deployment, please check deployment.properties"/>
</target>
<target name="deploy" description="Deploys BPEL Runtime to the server">
<antcall target="internal.install.riftsaw.ws.stack"/>
- <antcall target="remove.redundant.juddi" />
-
+
<echo message="Deploy BPEL runtime to JBoss server" />
<copy todir="${deployers.dir}/${bpel-deployer}">
<fileset dir="${modules}/${bpel-deployer}" />
@@ -107,6 +106,8 @@
tofile="${deploy.dir}/${bpel-runtime}/lib/xmlbeans-2.3.0.tmp"/>
<copy file="${modules}/shared/xmlbeans.jar" todir="${deployers.dir}/esb.deployer/lib"/>
+ <antcall target="remove.redundant.juddi" />
+
</target>
<target name="undeploy" description="Undeploys BPEL Runtime">
@@ -205,8 +206,8 @@
<unzip src="${ws.stack.dir}/jbossws-${ws.stack}-${ws.version}.zip" dest="${basedir}/ws-stack/dist/" />
<copy file="ws-stack/dist/jbossws-${ws.stack}-bin-dist/ant.properties.example" tofile="ws-stack/dist/jbossws-${ws.stack}-bin-dist/ant.properties" />
<ant dir="${basedir}/ws-stack/dist/jbossws-${ws.stack}-bin-dist" target="deploy-jboss510">
- <property name="jboss510.home" value="${org.jboss.esb.server.home}" />
- <property name="jboss.server.instance" value="${org.jboss.esb.server.config}" />
+ <property name="jboss510.home" value="${org.jboss.as.home}" />
+ <property name="jboss.server.instance" value="${org.jboss.as.config}" />
</ant>
</target>
@@ -215,13 +216,16 @@
<get src="${ws.stack.distro.url}" dest="${ws.stack.dir}/jbossws-${ws.stack}-${ws.version}.zip" />
</target>
- <condition property="is.juddi.duplicated">
- <available file="${org.jboss.esb.home}/server/${org.jboss.esb.server.config}/deploy/juddi-service.sar" />
- </condition>
+ <target name="check.juddi">
+ <condition property="is.juddi.duplicated">
+ <available file="${deploy.dir}/juddi-service.sar" />
+ </condition>
+ </target>
- <target name="remove.redundant.juddi" if="is.juddi.duplicated">
+ <target name="remove.redundant.juddi" if="is.juddi.duplicated" depends="check.juddi">
<!-- JBoss WS install additional juddi, duplicated with JBossESB's juddi one, or in cluster environment -->
- <delete dir="${org.jboss.esb.home}/server/${org.jboss.esb.server.config}/deploy/juddi-service.sar"/>
+ <echo> deleting the duplicated juddi service</echo>
+ <delete dir="${deploy.dir}/juddi-service.sar"/>
</target>
</project>
Modified: trunk/distribution/src/main/release/install/deployment.properties
===================================================================
--- trunk/distribution/src/main/release/install/deployment.properties 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/distribution/src/main/release/install/deployment.properties 2009-11-09 16:43:42 UTC (rev 257)
@@ -8,11 +8,11 @@
# Use of relative paths or paths with spaces will cause runtime errors
# when deploying and executing the samples.
# (e.g. /var/local/jboss-5.1.0.GA)
-org.jboss.esb.server.home=/local/deploy/jboss-5.1.0.GA
+org.jboss.as.home=/local/deploy/jboss-5.1.0.GA
# The Configuration of JBoss AS to Use
# (e.g. default)
-org.jboss.esb.server.config=default
+org.jboss.as.config=default
# The directory for JBossESB home
# (e.g. /var/local/jbossesb-4.6.GA)
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/integration-tests/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -19,8 +19,8 @@
<ant antfile="build.xml"
target="deploy"
dir="${basedir}/../distribution/target/dist/riftsaw-${riftsaw.engine.version}/install">
- <property name="org.jboss.esb.server.home" value="${org.jboss.esb.server.home}" />
- <property name="org.jboss.esb.server.config" value="${org.jboss.esb.server.config}" />
+ <property name="org.jboss.as.home" value="${org.jboss.as.home}" />
+ <property name="org.jboss.as.config" value="${org.jboss.as.config}" />
<property name="org.jboss.esb.home" value="${org.jboss.esb.home}" />
<property name="database" value="${database}" />
</ant>
@@ -30,8 +30,8 @@
<ant antfile="build.xml"
target="undeploy"
dir="${basedir}/../distribution/target/dist/riftsaw-${riftsaw.engine.version}/install">
- <property name="org.jboss.esb.server.home" value="${org.jboss.esb.server.home}" />
- <property name="org.jboss.esb.server.config" value="${org.jboss.esb.server.config}" />
+ <property name="org.jboss.as.home" value="${org.jboss.as.home}" />
+ <property name="org.jboss.as.config" value="${org.jboss.as.config}" />
<property name="org.jboss.esb.home" value="${org.jboss.esb.home}" />
<property name="database" value="${database}" />
</ant>
@@ -41,14 +41,14 @@
<java classname="org.jboss.Main"
fork="true" spawn="true"
- dir="${org.jboss.esb.server.home}/server/default" >
+ dir="${org.jboss.as.home}/server/default" >
<arg line="-c default"/>
- <jvmarg value="-Djava.endorsed.dirs=${org.jboss.esb.server.home}/lib/endorsed"/>
+ <jvmarg value="-Djava.endorsed.dirs=${org.jboss.as.home}/lib/endorsed"/>
<jvmarg value="-Xms128m"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-XX:MaxPermSize=256m"/>
<classpath>
- <pathelement path="${org.jboss.esb.server.home}/bin/run.jar"/>
+ <pathelement path="${org.jboss.as.home}/bin/run.jar"/>
<pathelement path="${JAVA_HOME}/lib/tools.jar"/>
</classpath>
</java>
@@ -61,7 +61,7 @@
<echo>JNP port detected, just waiting for 1 min 30 secs to ensure server started</echo>
- <sleep minutes="2" seconds="30" />
+ <sleep minutes="1" seconds="30" />
<echo>Server has started</echo>
@@ -69,13 +69,13 @@
<target name="stop-server" >
<echo>Stopping the server</echo>
- <echo>Server is at ${org.jboss.esb.server.home}</echo>
+ <echo>Server is at ${org.jboss.as.home}</echo>
<java classname="org.jboss.Shutdown" fork="true" failonerror="false" resultproperty="shutdown.rc">
<arg line="-s jnp://localhost:1099 --shutdown"/>
<classpath>
- <pathelement path="${org.jboss.esb.server.home}/bin/shutdown.jar"/>
- <pathelement path="${org.jboss.esb.server.home}/client/jbossall-client.jar"/>
+ <pathelement path="${org.jboss.as.home}/bin/shutdown.jar"/>
+ <pathelement path="${org.jboss.as.home}/client/jbossall-client.jar"/>
<pathelement path="${JAVA_HOME}/lib/tools.jar"/>
</classpath>
</java>
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_atm/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -15,7 +15,7 @@
<path id="compile-classpath">
<!-- Required for JMS Client Code. -->
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" />
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" />
</path>
<target name="deploywar" description="make war">
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -15,7 +15,7 @@
<property name="war.build.dir" location="${deploy.dir}/${ant.project.name}/build/war/classes"/>
<path id="compile-classpath">
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
</path>
<property name="compile-classpath" refid="compile-classpath"/>
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -15,7 +15,7 @@
<property name="war.build.dir" location="${deploy.dir}/${ant.project.name}/build/war/classes"/>
<path id="compile-classpath">
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
</path>
<property name="compile-classpath" refid="compile-classpath"/>
Modified: trunk/qa/build.xml
===================================================================
--- trunk/qa/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/qa/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -28,7 +28,7 @@
<property name="jbossesb.distro.url" value="http://jboss.org/downloading/?projectId=jbossesb&url=/jbossesb/downlo..." />
<property name="jbossesb.distro.path" value="${download.dir}/${jbossesb.filename}" />
- <property name="org.jboss.esb.server.config" value="default" />
+ <property name="org.jboss.as.config" value="default" />
<echo message="database.......... ${database}" />
<echo message="riftsaw.version...... ${riftsaw.version}" />
@@ -72,7 +72,7 @@
<ant dir="${jboss.parent.dir}/jbossesb-${jbossesb.version}/install" target="deploy">
<property name="org.jboss.esb.server.home" value="${jboss.home}" />
- <property name="org.jboss.esb.server.config" value="${org.jboss.esb.server.config}" />
+ <property name="org.jboss.esb.server.config" value="${org.jboss.as.config}" />
</ant>
</target>
@@ -83,8 +83,8 @@
<unzip src="../distribution/target/riftsaw-${riftsaw.version}.zip" dest="../distribution/target" />
<ant dir="../distribution/target/riftsaw-${riftsaw.version}/install" target="deploy">
- <property name="org.jboss.esb.server.home" value="${jboss.home}}" />
- <property name="org.jboss.esb.server.config" value="${org.jboss.esb.server.config}" />
+ <property name="org.jboss.as.home" value="${jboss.home}}" />
+ <property name="org.jboss.as.config" value="${org.jboss.as.config}" />
</ant>
</target>
Modified: trunk/qa/hudson-riftsaw-db.sh
===================================================================
--- trunk/qa/hudson-riftsaw-db.sh 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/qa/hudson-riftsaw-db.sh 2009-11-09 16:43:42 UTC (rev 257)
@@ -26,11 +26,11 @@
ant $ANT_PROPERTIES drop.riftsaw.schema
RIFTSAW_VERSION="2.0-SNAPSHOT"
-ESB_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
-ESB_CONFIG="default"
+AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
+AS_CONFIG="default"
echo build the RiftSaw and run integration tests
-echo ESB_HOME=$ESB_HOME, ESB_CONIFG=$ESB_CONFIG
+echo AS_HOME=$AS_HOME, AS_CONIFG=$AS_CONFIG
cd ../integration-tests
-mvn -Dorg.jboss.esb.server.home=$ESB_HOME -Dorg.jboss.esb.server.config=$ESB_CONFIG -Ddatabase=$DATABASE clean install
+mvn -Dorg.jboss.as.home=$AS_HOME -Dorg.jboss.as.config=$AS_CONFIG -Ddatabase=$DATABASE clean install
Modified: trunk/qa/hudson-riftsaw-jboss.sh
===================================================================
--- trunk/qa/hudson-riftsaw-jboss.sh 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/qa/hudson-riftsaw-jboss.sh 2009-11-09 16:43:42 UTC (rev 257)
@@ -22,11 +22,11 @@
ant $ANT_PROPERTIES install.jbossesb
RIFTSAW_VERSION="2.0-SNAPSHOT"
-ESB_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
-ESB_CONFIG="default"
+AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
+AS_CONFIG="default"
echo build the RiftSaw and run integration tests
-echo ESB_HOME=$ESB_HOME, ESB_CONIFG=$ESB_CONFIG
+echo AS_HOME=$AS_HOME, AS_CONIFG=$AS_CONFIG
cd ../integration-tests
-mvn -Dorg.jboss.esb.server.home=$ESB_HOME -Dorg.jboss.esb.server.config=$ESB_CONFIG -Ddatabase=$DATABASE clean install
+mvn -Dorg.jboss.as.home=$AS_HOME -Dorg.jboss.as.config=$AS_CONFIG -Ddatabase=$DATABASE clean install
Modified: trunk/qa/hudson-riftsaw-jdk5.sh
===================================================================
--- trunk/qa/hudson-riftsaw-jdk5.sh 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/qa/hudson-riftsaw-jdk5.sh 2009-11-09 16:43:42 UTC (rev 257)
@@ -27,12 +27,12 @@
#ant $ANT_PROPERTIES drop.riftsaw.schema
RIFTSAW_VERSION="2.0-SNAPSHOT"
-ESB_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
-ESB_CONFIG="default"
+AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
+AS_CONFIG="default"
WS_STACK_DIR="$RIFTSAW_PARENT_DIR/downloads"
echo build the RiftSaw and run integration tests
-echo ESB_HOME=$ESB_HOME, ESB_CONIFG=$ESB_CONFIG WS_STACK_DIR=$WS_STACK_DIR WS_STACK=$WS_STACK
+echo AS_HOME=$AS_HOME, AS_CONIFG=$AS_CONFIG WS_STACK_DIR=$WS_STACK_DIR WS_STACK=$WS_STACK
cd ../integration-tests
-mvn -Dorg.jboss.esb.server.home=$ESB_HOME -Dorg.jboss.esb.server.config=$ESB_CONFIG -Ddatabase=$DATABASE -Dws.stack.dir=$WS_STACK_DIR clean install
+mvn -Dorg.jboss.as.home=$AS_HOME -Dorg.jboss.as.config=$AS_CONFIG -Ddatabase=$DATABASE -Dws.stack.dir=$WS_STACK_DIR clean install
Modified: trunk/qa/hudson-riftsaw-ws.sh
===================================================================
--- trunk/qa/hudson-riftsaw-ws.sh 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/qa/hudson-riftsaw-ws.sh 2009-11-09 16:43:42 UTC (rev 257)
@@ -26,12 +26,12 @@
#ant $ANT_PROPERTIES drop.riftsaw.schema
RIFTSAW_VERSION="2.0-SNAPSHOT"
-ESB_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
-ESB_CONFIG="default"
+AS_HOME="$RIFTSAW_PARENT_DIR/riftsaw-$RIFTSAW_VERSION/jboss-$JBOSS_VERSION"
+AS_CONFIG="default"
WS_STACK_DIR="$RIFTSAW_PARENT_DIR/downloads"
echo build the RiftSaw and run integration tests
-echo ESB_HOME=$ESB_HOME, ESB_CONIFG=$ESB_CONFIG WS_STACK_DIR=$WS_STACK_DIR WS_STACK=$WS_STACK
+echo AS_HOME=$AS_HOME, AS_CONIFG=$AS_CONFIG WS_STACK_DIR=$WS_STACK_DIR WS_STACK=$WS_STACK
cd ../integration-tests
-mvn -Dorg.jboss.esb.server.home=$ESB_HOME -Dorg.jboss.esb.server.config=$ESB_CONFIG -Ddatabase=$DATABASE -Dws.stack=$WS_STACK -Dws.stack.dir=$WS_STACK_DIR clean install
+mvn -Dorg.jboss.as.home=$AS_HOME -Dorg.jboss.as.config=$AS_CONFIG -Ddatabase=$DATABASE -Dws.stack=$WS_STACK -Dws.stack.dir=$WS_STACK_DIR clean install
Modified: trunk/samples/quickstart/atm/build.xml
===================================================================
--- trunk/samples/quickstart/atm/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/samples/quickstart/atm/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -9,7 +9,7 @@
<property name="version" value="1" />
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}" />
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}" />
<property name="conf.dir" value="${server.dir}/conf" />
<property name="deploy.dir" value="${server.dir}/deploy" />
<property name="server.lib.dir" value="${server.dir}/lib" />
@@ -19,7 +19,7 @@
<path id="compile-classpath">
<!-- Required for JMS Client Code. -->
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" />
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" />
</path>
<property name="compile-classpath" refid="compile-classpath" />
Modified: trunk/samples/quickstart/hello_world/build.xml
===================================================================
--- trunk/samples/quickstart/hello_world/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/samples/quickstart/hello_world/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -10,7 +10,7 @@
<property name="version" value="1" />
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
<property name="conf.dir" value="${server.dir}/conf"/>
<property name="deploy.dir" value="${server.dir}/deploy"/>
<property name="server.lib.dir" value="${server.dir}/lib"/>
Modified: trunk/samples/quickstart/loan_approval/build.xml
===================================================================
--- trunk/samples/quickstart/loan_approval/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/samples/quickstart/loan_approval/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -10,7 +10,7 @@
<property name="version" value="1" />
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
<property name="conf.dir" value="${server.dir}/conf"/>
<property name="deploy.dir" value="${server.dir}/deploy"/>
<property name="server.lib.dir" value="${server.dir}/lib"/>
@@ -20,7 +20,7 @@
<property name="war.build.dir" location="build/war/classes"/>
<path id="compile-classpath">
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
</path>
<property name="compile-classpath" refid="compile-classpath"/>
Modified: trunk/samples/quickstart/simple_correlation/build.xml
===================================================================
--- trunk/samples/quickstart/simple_correlation/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/samples/quickstart/simple_correlation/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -10,7 +10,7 @@
<property name="version" value="1" />
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
<property name="conf.dir" value="${server.dir}/conf"/>
<property name="deploy.dir" value="${server.dir}/deploy"/>
<property name="server.lib.dir" value="${server.dir}/lib"/>
Modified: trunk/samples/quickstart/simple_invoke/build.xml
===================================================================
--- trunk/samples/quickstart/simple_invoke/build.xml 2009-11-09 14:56:55 UTC (rev 256)
+++ trunk/samples/quickstart/simple_invoke/build.xml 2009-11-09 16:43:42 UTC (rev 257)
@@ -1,86 +1,86 @@
-<project name="Quickstart_bpel_simple_invoke" default="deploy" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- Import the base Ant build script... -->
- <property file="../../../install/deployment.properties" />
-
- <property name="version" value="1" />
-
- <property name="server.dir" value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}"/>
- <property name="conf.dir" value="${server.dir}/conf"/>
- <property name="deploy.dir" value="${server.dir}/deploy"/>
- <property name="server.lib.dir" value="${server.dir}/lib"/>
-
- <property name="sample.jar.name" value="${ant.project.name}-${version}.jar" />
-
- <property name="war.build.dir" location="build/war/classes"/>
-
- <path id="compile-classpath">
- <fileset dir="${org.jboss.esb.server.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
- </path>
- <property name="compile-classpath" refid="compile-classpath"/>
-
- <target name="makewar" description="make war">
- <!-- Compile... -->
- <mkdir dir="${war.build.dir}" />
- <javac srcdir="war/src" destdir="${war.build.dir}" debug="true">
- <classpath>
- <path refid="compile-classpath" />
- <fileset dir="war/resources/WEB-INF/lib" includes="*.jar" />
- </classpath>
- </javac>
-
- <!-- War... -->
- <war warfile="build/${ant.project.name}.war"
- webxml="${basedir}/war/resources/WEB-INF/web.xml">
- <webinf dir="${basedir}/war/resources/WEB-INF">
- <include name="jboss-web.xml"/>
- </webinf>
- <classes dir="${war.build.dir}" includes="**/*.class"/>
- <fileset dir="${basedir}/war/view">
- <include name="**/*"/>
- </fileset>
- <classes dir="${basedir}">
- <include name="juddi.properties"/>
- </classes>
- </war>
- </target>
-
- <target name="deploywar" depends="makewar" >
- <copy todir="${deploy.dir}"
- file="build/${ant.project.name}.war"/>
+<project name="Quickstart_bpel_simple_invoke" default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <property file="../../../install/deployment.properties" />
+
+ <property name="version" value="1" />
+
+ <property name="server.dir" value="${org.jboss.as.home}/server/${org.jboss.as.config}"/>
+ <property name="conf.dir" value="${server.dir}/conf"/>
+ <property name="deploy.dir" value="${server.dir}/deploy"/>
+ <property name="server.lib.dir" value="${server.dir}/lib"/>
+
+ <property name="sample.jar.name" value="${ant.project.name}-${version}.jar" />
+
+ <property name="war.build.dir" location="build/war/classes"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org.jboss.as.home}/client" includes="*.jar" /> <!-- Required for JMS Client Code. -->
+ </path>
+ <property name="compile-classpath" refid="compile-classpath"/>
+
+ <target name="makewar" description="make war">
+ <!-- Compile... -->
+ <mkdir dir="${war.build.dir}" />
+ <javac srcdir="war/src" destdir="${war.build.dir}" debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ <fileset dir="war/resources/WEB-INF/lib" includes="*.jar" />
+ </classpath>
+ </javac>
+
+ <!-- War... -->
+ <war warfile="build/${ant.project.name}.war"
+ webxml="${basedir}/war/resources/WEB-INF/web.xml">
+ <webinf dir="${basedir}/war/resources/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${war.build.dir}" includes="**/*.class"/>
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ <classes dir="${basedir}">
+ <include name="juddi.properties"/>
+ </classes>
+ </war>
</target>
-
- <target name="undeploywar">
- <delete file="${deploy.dir}/${ant.project.name}.war"/>
- </target>
-
- <target name="deploy" depends="deploywar" >
- <echo>Deploy ${ant.project.name}</echo>
- <jar basedir="bpel" destfile="${deploy.dir}/${sample.jar.name}" />
- </target>
-
- <target name="undeploy" depends="undeploywar" >
- <echo>Undeploy ${ant.project.name}</echo>
- <delete file="${deploy.dir}/${sample.jar.name}" />
- </target>
-
- <target name="sendhello">
- <echo>Send test message to: ${ant.project.name}</echo>
- <java classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
- <arg value="http://localhost:8080/Quickstart_bpel_simple_invokeWS"/>
- <arg value="messages/hello_request1.xml"/>
- <classpath>
- <fileset dir="../../common/lib">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${java.class.path}"/>
- </classpath>
- </java>
- </target>
-
-</project>
+
+ <target name="deploywar" depends="makewar" >
+ <copy todir="${deploy.dir}"
+ file="build/${ant.project.name}.war"/>
+ </target>
+
+ <target name="undeploywar">
+ <delete file="${deploy.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="deploy" depends="deploywar" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar basedir="bpel" destfile="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="undeploy" depends="undeploywar" >
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="sendhello">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg value="http://localhost:8080/Quickstart_bpel_simple_invokeWS"/>
+ <arg value="messages/hello_request1.xml"/>
+ <classpath>
+ <fileset dir="../../common/lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </target>
+
+</project>
15 years, 1 month
riftsaw SVN: r256 - trunk/samples/esb/bpel_loan_fault.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2009-11-09 09:56:55 -0500 (Mon, 09 Nov 2009)
New Revision: 256
Modified:
trunk/samples/esb/bpel_loan_fault/readme.txt
Log:
Document fault handling approach for ESB to BPEL process integration.
Modified: trunk/samples/esb/bpel_loan_fault/readme.txt
===================================================================
--- trunk/samples/esb/bpel_loan_fault/readme.txt 2009-11-09 14:48:03 UTC (rev 255)
+++ trunk/samples/esb/bpel_loan_fault/readme.txt 2009-11-09 14:56:55 UTC (rev 256)
@@ -1,7 +1,7 @@
Overview:
=========
- The purpose of the bpel helloworld quickstart sample is to demonstrate
- a simple invocation of a BPEL process using an ESB action.
+ The purpose of the bpel loan fault quickstart sample is to demonstrate
+ fault handling when invoking a BPEL process using an ESB action.
Running this quickstart:
========================
@@ -10,9 +10,9 @@
To Run '.esb' archive mode:
===========================
- Before deploying this example, you will need to deploy the BPEL 'hello_world'
+ Before deploying this example, you will need to deploy the BPEL 'loan_approval'
quickstart example. The ESB action deployed and executed in this example will
- invoke this 'hello_world' BPEL example.
+ invoke this 'loan_approval' BPEL example.
1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
2. Open another command terminal window in this folder ("Window2"), type
15 years, 1 month
riftsaw SVN: r255 - trunk/docs/docbook/userguide/src/main/module.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2009-11-09 09:48:03 -0500 (Mon, 09 Nov 2009)
New Revision: 255
Modified:
trunk/docs/docbook/userguide/src/main/module/esb.xml
Log:
Document fault handling approach for ESB to BPEL process integration.
Modified: trunk/docs/docbook/userguide/src/main/module/esb.xml
===================================================================
--- trunk/docs/docbook/userguide/src/main/module/esb.xml 2009-11-09 14:18:16 UTC (rev 254)
+++ trunk/docs/docbook/userguide/src/main/module/esb.xml 2009-11-09 14:48:03 UTC (rev 255)
@@ -159,6 +159,79 @@
element representing the root node of a more complex XML value.
</para>
+ <section>
+ <title>Fault Handling</title>
+
+ <para>
+ The normal response from a WSDL operation will be returned from the <emphasis>BPELInvoke</emphasis>
+ ESB action as a normal message and placed on the action pipeline ready for processing by the next
+ ESB action, or alternatively if no further actions have been defined, then returned back to the
+ service client.
+ </para>
+
+ <para>
+ Faults, associated with a WSDL operation, are handled slightly differently. Depending on configuration
+ it is possible to receive the fault as an ESB message or for the fault to be treated as an
+ exception which aborts the action pipeline. The configuration property used to determine which
+ behaviour is used is called <emphasis>abortOnFault</emphasis>. The default value for this property
+ is "true". As an example, from the loan fault quickstart sample,
+ </para>
+
+ <informalexample>
+ <programlisting role="XML" ><![CDATA[
+<action name="action2" class="org.jboss.soa.esb.actions.bpel.BPELInvoke">
+ <property name="service" value="{http://example.com/loan-approval/wsdl/}loanService"/>
+ <property name="operation" value="request" />
+ <property name="abortOnFault" value="true" />
+</action>
+ ]]></programlisting>
+ </informalexample>
+
+ <para>
+ A WSDL fault has two relevant pieces of information, the fault type (or code) and the fault details.
+ These are both returned in specific parts of ESB message's body.
+ </para>
+
+ <orderedlist>
+ <listitem>
+ Fault code (as javax.xml.namespace.QName)
+ <para>
+ ESB message body part: <emphasis>org.jboss.soa.esb.message.fault.detail.code</emphasis>
+ </para>
+ <para>
+ This body part identifies the specific WSDL fault returned by the BPEL process, associated with
+ the WSDL operation that was invoked.
+ </para>
+ <warning>
+ The specific version of the QName used by the JBoss server is from the stax-api.jar found in the
+ server's lib/endorsed directory. If the client does not also include this jar in a folder that is
+ in its endorsed directories, then a class version exception will occur when this ESB message
+ part is accessed.
+ </warning>
+ </listitem>
+ <listitem>
+ Fault code (as textual representation of QName)
+ <para>
+ ESB message body part: <emphasis>org.jboss.soa.bpel.message.fault.detail.code</emphasis>
+ </para>
+ <para>
+ This body part will return the textual representation of the QName for the fault code. The textual
+ representation is of the form "{namespace}localpart" and can be converted back into a QName using the
+ <emphasis>javax.xml.namespace.QName.valueOf(String)</emphasis> method.
+ </para>
+ </listitem>
+ <listitem>
+ Fault details
+ <para>
+ ESB message body part: <emphasis>org.jboss.soa.esb.message.fault.detail.detail</emphasis>
+ </para>
+ <para>
+ This body part will contain the textual representation of the message content associated
+ with the fault.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
</section>
</chapter>
15 years, 1 month
riftsaw SVN: r254 - trunk/distribution/src/main/release/install.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-11-09 09:18:16 -0500 (Mon, 09 Nov 2009)
New Revision: 254
Modified:
trunk/distribution/src/main/release/install/build.xml
Log:
* update the script to remove the duplicated juddi sar if any.
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2009-11-09 13:47:01 UTC (rev 253)
+++ trunk/distribution/src/main/release/install/build.xml 2009-11-09 14:18:16 UTC (rev 254)
@@ -52,6 +52,7 @@
<target name="deploy" description="Deploys BPEL Runtime to the server">
<antcall target="internal.install.riftsaw.ws.stack"/>
+ <antcall target="remove.redundant.juddi" />
<echo message="Deploy BPEL runtime to JBoss server" />
<copy todir="${deployers.dir}/${bpel-deployer}">
@@ -195,6 +196,8 @@
<target name="internal.uninstall.riftsaw.into.jboss.db.sqlserver" />
<target name="internal.uninstall.riftsaw.into.jboss.db.postgres" />
+
+ <target name="internal.uninstall.riftsaw.into.jboss.db.oracle"/>
<target name="internal.install.riftsaw.ws.stack" unless="keep.ws.stack">
<echo>Replacing the Web Service Stack to ${ws.stack}-${ws.version}</echo>
@@ -205,8 +208,6 @@
<property name="jboss510.home" value="${org.jboss.esb.server.home}" />
<property name="jboss.server.instance" value="${org.jboss.esb.server.config}" />
</ant>
- <!-- JBoss WS install additional juddi, duplicated with JBossESB's juddi one -->
- <delete dir="${org.jboss.esb.home}/server/${org.jboss.esb.server.config}/deploy/juddi-service.sar"/>
</target>
<target name="get.ws.stack" description="download ws stack" unless="is.ws.stack.distro.available">
@@ -214,4 +215,13 @@
<get src="${ws.stack.distro.url}" dest="${ws.stack.dir}/jbossws-${ws.stack}-${ws.version}.zip" />
</target>
+ <condition property="is.juddi.duplicated">
+ <available file="${org.jboss.esb.home}/server/${org.jboss.esb.server.config}/deploy/juddi-service.sar" />
+ </condition>
+
+ <target name="remove.redundant.juddi" if="is.juddi.duplicated">
+ <!-- JBoss WS install additional juddi, duplicated with JBossESB's juddi one, or in cluster environment -->
+ <delete dir="${org.jboss.esb.home}/server/${org.jboss.esb.server.config}/deploy/juddi-service.sar"/>
+ </target>
+
</project>
15 years, 1 month
riftsaw SVN: r253 - in trunk: runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2009-11-09 08:47:01 -0500 (Mon, 09 Nov 2009)
New Revision: 253
Modified:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartESBBPELLoanFaultTestCase.java
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
trunk/samples/esb/bpel_loan_fault/build.xml
trunk/samples/esb/bpel_loan_fault/src/org/jboss/soa/esb/samples/quickstart/loanfault/test/SendEsbMessage.java
Log:
Fix for RIFTSAW-110 - added server lib/endorsed to ant script to enable quickstart to work. Issue is that stax-api.jar contains QName which conflicts with the default one supplied with the jdk. In case not practical for client to add this endorsed lib folder, then have also added additional body part in the ESB message containing a textual representation of the fault type.
Modified: trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartESBBPELLoanFaultTestCase.java
===================================================================
--- trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartESBBPELLoanFaultTestCase.java 2009-11-09 11:22:51 UTC (rev 252)
+++ trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartESBBPELLoanFaultTestCase.java 2009-11-09 13:47:01 UTC (rev 253)
@@ -33,6 +33,7 @@
private static final String TEST_NAME = "Quickstart_esb_bpel_loan_fault";
protected static final String BODY_FAULT_CODE = "org.jboss.soa.esb.message.fault.detail.code";
+ protected static final String BODY_BPEL_FAULT_CODE = "org.jboss.soa.bpel.message.fault.detail.code";
protected static final String BODY_FAULT_MESSAGE = "org.jboss.soa.esb.message.fault.detail.detail";
public QuickstartESBBPELLoanFaultTestCase() {
@@ -54,10 +55,11 @@
} catch(org.jboss.soa.esb.couriers.FaultMessageException fme) {
assertMessage((String)fme.getReturnedMessage().getBody().get(BODY_FAULT_MESSAGE),
- "<message><errorCode><integer xmlns=\"http://example.com/loan-approval/xsd/error-messages/\">1</integer></errorCode></message>");
+ "<message><errorCode><integer xmlns=\"http://example.com/loan-approval/xsd/error-messages/\">1</integer></errorCode></message>");
+
+ assertMessage((String)fme.getReturnedMessage().getBody().get(BODY_BPEL_FAULT_CODE),
+ "{http://example.com/loan-approval/wsdl/}unableToHandleRequest");
- //System.out.println("FAULT: "+fme.getReturnedMessage().getBody().get(BODY_FAULT_CODE));
-
} catch(Exception e) {
fail("Test failed with exception: "+e);
}
@@ -73,9 +75,10 @@
} catch(org.jboss.soa.esb.couriers.FaultMessageException fme) {
assertMessage((String)fme.getReturnedMessage().getBody().get(BODY_FAULT_MESSAGE),
- "<message><errorCode><integer xmlns=\"http://example.com/loan-approval/xsd/error-messages/\">1</integer></errorCode></message>");
+ "<message><errorCode><integer xmlns=\"http://example.com/loan-approval/xsd/error-messages/\">1</integer></errorCode></message>");
- //System.out.println("FAULT: "+fme.getReturnedMessage().getBody().get(BODY_FAULT_CODE));
+ assertMessage((String)fme.getReturnedMessage().getBody().get(BODY_BPEL_FAULT_CODE),
+ "{http://example.com/loan-approval/wsdl/}unableToHandleRequest");
} catch(Exception e) {
fail("Test failed with exception: "+e);
Modified: trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
===================================================================
--- trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-09 11:22:51 UTC (rev 252)
+++ trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-09 13:47:01 UTC (rev 253)
@@ -51,6 +51,7 @@
protected static final String ABORT_ON_FAULT = "abortOnFault";
protected static final String BODY_FAULT_CODE = "org.jboss.soa.esb.message.fault.detail.code";
+ protected static final String BODY_BPEL_FAULT_CODE = "org.jboss.soa.bpel.message.fault.detail.code";
protected ConfigTree _config;
private static BPELEngine _bpelEngine;
@@ -256,6 +257,13 @@
// In case we wanted to return the fault message as the message body
//faultException.getFaultMessage().getBody().add(respValue.toString());
+ // Record string representation of faultName, as currently if the client
+ // does not include the stax-api.jar in its list of endorsed libs (as the
+ // JBoss AS server does, then it will result in a class version issue when
+ // it tries to retrieve the ESB fault code (which is transferred as a QName).
+ // See RIFTSAW-110 for more details.
+ faultException.getFaultMessage().getBody().add(BODY_BPEL_FAULT_CODE, faultName.toString());
+
throw faultException;
}
}
Modified: trunk/samples/esb/bpel_loan_fault/build.xml
===================================================================
--- trunk/samples/esb/bpel_loan_fault/build.xml 2009-11-09 11:22:51 UTC (rev 252)
+++ trunk/samples/esb/bpel_loan_fault/build.xml 2009-11-09 13:47:01 UTC (rev 253)
@@ -12,6 +12,7 @@
description="Will send an esb Message">
<echo>Runs Test ESB Message Sender</echo>
<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.loanfault.test.SendEsbMessage" failonerror="true">
+ <jvmarg value="-Djava.endorsed.dirs=${org.jboss.esb.server.home}/lib/endorsed"/>
<arg value="LoanFaultBPELESB"/> <!-- service category -->
<arg value="LoanFail"/> <!-- service name -->
<arg value="<request><firstName>Jane</firstName><name>Bloggs</name><amount>0</amount></request>"/> <!-- Message text -->
Modified: trunk/samples/esb/bpel_loan_fault/src/org/jboss/soa/esb/samples/quickstart/loanfault/test/SendEsbMessage.java
===================================================================
--- trunk/samples/esb/bpel_loan_fault/src/org/jboss/soa/esb/samples/quickstart/loanfault/test/SendEsbMessage.java 2009-11-09 11:22:51 UTC (rev 252)
+++ trunk/samples/esb/bpel_loan_fault/src/org/jboss/soa/esb/samples/quickstart/loanfault/test/SendEsbMessage.java 2009-11-09 13:47:01 UTC (rev 253)
@@ -38,11 +38,13 @@
*/
public class SendEsbMessage
{
- protected static final String BODY_FAULT_CODE = "org.jboss.soa.esb.message.fault.detail.code";
+ protected static final String ESB_FAULT_CODE = "org.jboss.soa.esb.message.fault.detail.code";
+ protected static final String BPEL_FAULT_CODE = "org.jboss.soa.bpel.message.fault.detail.code";
+ protected static final String FAULT_MESSAGE = "org.jboss.soa.esb.message.fault.detail.detail";
public static void main(String args[]) throws Exception
{
-// Setting the ConnectionFactory such that it will use scout
+ // Setting the ConnectionFactory such that it will use scout
System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
if (args.length < 3)
@@ -55,14 +57,15 @@
esbMessage.getBody().add(args[2]);
- try {
- Message respMessage = new ServiceInvoker(args[0], args[1]).deliverSync(esbMessage, 5000);
+ try {
+ Message respMessage = new ServiceInvoker(args[0], args[1]).deliverSync(esbMessage, 5000);
- System.out.println("REPLY: "+respMessage.getBody().get());
- } catch(org.jboss.soa.esb.couriers.FaultMessageException fme) {
- System.out.println("FAULT: "+fme.getReturnedMessage().getBody().get(BODY_FAULT_CODE));
- System.out.println("FAULT ("+fme.getCode()+") MESSAGE: "+fme.getReturnedMessage().getBody().get());
- }
+ System.out.println("REPLY: "+respMessage.getBody().get());
+ } catch(org.jboss.soa.esb.couriers.FaultMessageException fme) {
+ System.out.println("FAULT TYPE (AS QNAME): "+fme.getReturnedMessage().getBody().get(ESB_FAULT_CODE));
+ System.out.println("FAULT TYPE (AS STRING): "+fme.getReturnedMessage().getBody().get(BPEL_FAULT_CODE));
+ System.out.println("FAULT MESSAGE: "+fme.getReturnedMessage().getBody().get(FAULT_MESSAGE));
+ }
}
}
15 years, 1 month
riftsaw SVN: r252 - in trunk/integration-tests/src/test/resources/samples: Quickstart_bpel_loan_approval/messages and 2 other directories.
by riftsaw-commits@lists.jboss.org
Author: objectiser
Date: 2009-11-09 06:22:51 -0500 (Mon, 09 Nov 2009)
New Revision: 252
Modified:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/goodbye_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/hello_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/messages/hello_response1.xml
Log:
Updated integration test results to reflect slight change in SOAP message format.
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1,3 +1 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><wsdl:hello xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsdl='http://www.jboss.org/bpel/examples/wsdl'>
- <TestPart>Hello World</TestPart>
- </wsdl:hello></env:Body></env:Envelope>
\ No newline at end of file
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:helloResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><TestPart>Hello World</TestPart></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp1.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp1.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1 +1 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><message><accept>yes</accept></message></env:Body></env:Envelope>
\ No newline at end of file
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:requestResponse xmlns:odens='http://example.com/loan-approval/wsdl/'><accept>yes</accept></odens:requestResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_loan_approval/messages/loanresp2.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1 +1 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><message><accept>Evaluated and Approved</accept></message></env:Body></env:Envelope>
\ No newline at end of file
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:requestResponse xmlns:odens='http://example.com/loan-approval/wsdl/'><accept>Evaluated and Approved</accept></odens:requestResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/goodbye_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/goodbye_response1.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/goodbye_response1.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1,6 +1,3 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><wsdl:goodbye xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsdl='http://www.jboss.org/bpel/examples/wsdl'>
- <ID>
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:goodbyeResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><ID>
<id>1</id>
- </ID>
- <Message>Goodbye World</Message>
- </wsdl:goodbye></env:Body></env:Envelope>
\ No newline at end of file
+ </ID><Message>Goodbye World</Message></odens:goodbyeResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/hello_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/hello_response1.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation/messages/hello_response1.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1,6 +1,3 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><wsdl:hello xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsdl='http://www.jboss.org/bpel/examples/wsdl'>
- <ID>
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:helloResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><ID>
<id>1</id>
- </ID>
- <Message>Hello World</Message>
- </wsdl:hello></env:Body></env:Envelope>
\ No newline at end of file
+ </ID><Message>Hello World</Message></odens:helloResponse></env:Body></env:Envelope>
\ No newline at end of file
Modified: trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/messages/hello_response1.xml
===================================================================
--- trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/messages/hello_response1.xml 2009-11-09 09:25:37 UTC (rev 251)
+++ trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_invoke/messages/hello_response1.xml 2009-11-09 11:22:51 UTC (rev 252)
@@ -1,3 +1 @@
-<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><wsdl:sayHelloTo xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsdl='http://www.jboss.org/bpel/examples/wsdl'>
- <ToWhom>Hello ME. Sincerely, JBossWS and BPEL</ToWhom>
- </wsdl:sayHelloTo></env:Body></env:Envelope>
\ No newline at end of file
+<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><odens:sayHelloToResponse xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><ToWhom>Hello ME. Sincerely, JBossWS and BPEL</ToWhom></odens:sayHelloToResponse></env:Body></env:Envelope>
\ No newline at end of file
15 years, 1 month
riftsaw SVN: r251 - trunk/integration-tests.
by riftsaw-commits@lists.jboss.org
Author: jeff.yuchang
Date: 2009-11-09 04:25:37 -0500 (Mon, 09 Nov 2009)
New Revision: 251
Modified:
trunk/integration-tests/build.xml
Log:
* fix the test failure for oracle.
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2009-11-09 08:30:23 UTC (rev 250)
+++ trunk/integration-tests/build.xml 2009-11-09 09:25:37 UTC (rev 251)
@@ -12,7 +12,7 @@
<!--copy file="${riftsaw.test.deployment.properties}"
tofile="${basedir}/../distribution/target/dist/riftsaw-${riftsaw.engine.version}/install/deployment.properties" /-->
<copy file="${basedir}/../distribution/target/libs/ojdbc14.jar"
- todir="${basedir}/../distribution/dist/riftsaw-${riftsaw.engine.version}/db/drivers"/>
+ todir="${basedir}/../distribution/target/dist/riftsaw-${riftsaw.engine.version}/db/drivers"/>
</target>
<target name="deploy-riftsaw" >
15 years, 1 month
riftsaw SVN: r250 - in trunk: runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode and 4 other directories.
by riftsaw-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-11-09 03:30:23 -0500 (Mon, 09 Nov 2009)
New Revision: 250
Added:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContextAssoc.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
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/JAXWSBindingContext.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
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/WebServiceProviderFactory.java
trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/RiskAssessmentPTImpl.java
Log:
Switch to Invocationadapter API
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/BPELEngine.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -21,6 +21,7 @@
* This interface represents a BPEL engine.
*
* @author gbrown
+ * @author Heiko Braun
*
*/
public interface BPELEngine {
@@ -33,22 +34,15 @@
*
* @throws Exception Failed to initialize
*/
- public void init() throws Exception;
-
- /**
- * This method invokes a BPEL process, associated with the supplied
- * service and operation, using the supplied message.
- *
- * @param operation The operation name
- * @param service The service QName
- * @param message The message
- * @return A response to the message, or null if no response is
- * required.
- * @throws BPELFault Process raised a fault
- * @throws Exception Failed to invoke the operation
- */
- public org.w3c.dom.Element invoke(String operation, javax.xml.namespace.QName service,
- org.w3c.dom.Element message) throws BPELFault, Exception;
+ public void init() throws Exception;
+
+ /**
+ *
+ * @param invocationAdapter
+ * @throws BPELFault
+ * @throws Exception
+ */
+ public void invoke(InvocationAdapter invocationAdapter) throws BPELFault, Exception;
/**
* This method closes the BPEL engine.
Copied: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java (from rev 247, branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java)
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java (rev 0)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/InvocationAdapter.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -0,0 +1,64 @@
+/*
+ * 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.engine;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Hides the message translation details when invoking ODE from
+ * an external component (i.e. ESB or WS).
+ *
+ * @see org.jboss.soa.bpel.runtime.engine.BPELEngine#invoke(InvocationAdapter)
+ *
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public interface InvocationAdapter<T>
+{
+ String getOperationName();
+ QName getServiceName();
+
+ /**
+ * Callback from the Engine towards the adapter when
+ * turning an external message representation into an ODE request {@link org.apache.ode.bpel.iapi.Message}
+ * @param mex
+ * @param odeRequest
+ */
+ void parseRequest(MyRoleMessageExchange mex, Message odeRequest);
+
+ /**
+ * Callback from the Engine towards the adapter when
+ * turning an ODE response {@link org.apache.ode.bpel.iapi.Message} into an external format <T>
+ * @param mex
+ */
+ void createResponse(MyRoleMessageExchange mex);
+
+ /**
+ * Access the invocation result (response)
+ * @return T
+ */
+ T getInvocationResult();
+
+}
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 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -17,63 +17,38 @@
*/
package org.jboss.soa.bpel.runtime.engine.ode;
-import java.util.StringTokenizer;
-
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import org.jboss.soa.bpel.runtime.engine.BPELFault;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-
-import org.apache.ode.bpel.engine.cron.CronScheduler;
-import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.evt.DebugBpelEventListener;
import org.apache.ode.bpel.dao.BpelDAOConnectionFactory;
+import org.apache.ode.bpel.engine.BpelManagementFacadeImpl;
import org.apache.ode.bpel.engine.BpelServerImpl;
import org.apache.ode.bpel.engine.CountLRUDehydrationPolicy;
-import org.apache.ode.bpel.engine.BpelManagementFacadeImpl;
-import org.apache.ode.bpel.common.evt.DebugBpelEventListener;
-//import org.apache.ode.bpel.extension.ExtensionBundleRuntime;
-//import org.apache.ode.bpel.extension.ExtensionBundleValidation;
-//import org.apache.ode.bpel.extension.ExtensionValidator;
+import org.apache.ode.bpel.engine.cron.CronScheduler;
import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule;
-import org.apache.ode.bpel.iapi.BpelEventListener;
-import org.apache.ode.bpel.iapi.EndpointReferenceContext;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
-import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.ProcessStoreEvent;
-import org.apache.ode.bpel.iapi.ProcessStoreListener;
-import org.apache.ode.bpel.iapi.Scheduler;
+import org.apache.ode.bpel.iapi.*;
import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
+import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
import org.apache.ode.il.config.OdeConfigProperties;
import org.apache.ode.il.dbutil.Database;
import org.apache.ode.scheduler.simple.JdbcDelegate;
import org.apache.ode.scheduler.simple.SimpleScheduler;
-import org.apache.ode.store.RiftSawProcessStore;
import org.apache.ode.store.ProcessStoreImpl;
+import org.apache.ode.store.RiftSawProcessStore;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
import org.apache.ode.utils.Properties;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
+import org.jboss.soa.bpel.runtime.engine.BPELFault;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.w3c.dom.Element;
import javax.sql.DataSource;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
+import javax.transaction.*;
import javax.transaction.xa.XAResource;
+import java.util.StringTokenizer;
+import java.util.concurrent.*;
/**
* This is the JBoss Service wrapping the ODE BPEL engine.
@@ -88,7 +63,7 @@
protected final Log __logTx = LogFactory.getLog("org.apache.ode.tx");
protected BpelServerImpl _bpelServer;
- protected ProcessStoreImpl _store;
+ public ProcessStoreImpl _store;
protected OdeConfigProperties _odeConfig;
protected TransactionManager _txMgr;
protected BpelDAOConnectionFactory _daoCF;
@@ -96,7 +71,6 @@
protected Database _db;
protected ExecutorService _executorService;
protected CronScheduler _cronScheduler;
- //protected java.io.File _workRoot;
private java.util.List<IntegrationLayer> m_integrationLayers=new java.util.Vector<IntegrationLayer>();
@@ -122,31 +96,30 @@
* required.
* @throws Exception Failed to invoke the operation
*/
- public org.w3c.dom.Element invoke(String operation, javax.xml.namespace.QName service,
- org.w3c.dom.Element message) throws BPELFault, Exception {
- org.w3c.dom.Element ret=null;
-
-
+ public void invoke(InvocationAdapter invocationAdapter)
+ throws BPELFault, Exception
+ {
boolean success = true;
MyRoleMessageExchange odeMex = null;
Future responseFuture = null;
- try {
+
+ try
+ {
+ // start TX
_txMgr.begin();
if (__log.isDebugEnabled()) __log.debug("Starting transaction.");
-
- // Creating message exchange
- String messageId = new GUID().toString();
- odeMex = _bpelServer.getEngine().createMessageExchange(messageId, service,
- operation);
- __log.debug("ODE routed to operation " + odeMex.getOperation() + " from service " + service);
+
+ odeMex = createMessageExchange(invocationAdapter);
//odeMex.setProperty("isTwoWay", Boolean.toString(msgContext.getAxisOperation() instanceof TwoChannelAxisOperation));
- if (odeMex.getOperation() != null) {
+
+ if (odeMex.getOperation() != null)
+ {
// Preparing message to send to ODE
Message odeRequest = odeMex.createMessage(odeMex.getOperation().getInput().getMessage().getQName());
- //_converter.parseSoapRequest(odeRequest, msgContext.getEnvelope(), odeMex.getOperation());
+
+ // distinguish WS and ESB invocation
+ invocationAdapter.parseRequest(odeMex, odeRequest);
- odeRequest.setMessage(message);
-
// TODO: Might need to store session id/epr of caller?
//readHeader(msgContext, odeMex);
@@ -211,9 +184,9 @@
try {
// Refreshing the message exchange
odeMex = (MyRoleMessageExchange) _bpelServer.getEngine().getMessageExchange(odeMex.getMessageExchangeId());
- ret = onResponse(odeMex);
+ onResponse(odeMex, invocationAdapter);
- __log.debug("Returning: "+ret);
+ __log.debug("Returning: "+ invocationAdapter.getInvocationResult());
commit = true;
@@ -250,12 +223,21 @@
odeMex.release(true);
}
- return(ret);
}
- private org.w3c.dom.Element onResponse(MyRoleMessageExchange mex) throws BPELFault, Exception {
- org.w3c.dom.Element ret=null;
+ private MyRoleMessageExchange createMessageExchange(InvocationAdapter adapter)
+ {
+ // Creating message exchange
+ String messageId = new GUID().toString();
+ MyRoleMessageExchange odeMex = _bpelServer.getEngine()
+ .createMessageExchange(messageId, adapter.getServiceName(), adapter.getOperationName());
+ __log.debug("ODE routed to operation " + odeMex.getOperation() + " from service " + adapter.getServiceName());
+ return odeMex;
+ }
+ private void onResponse(MyRoleMessageExchange mex, InvocationAdapter invocationAdapter) throws BPELFault, Exception {
+ Element ret=null;
+
switch (mex.getStatus()) {
case FAULT:
if (__log.isDebugEnabled())
@@ -264,7 +246,11 @@
case ASYNC:
case RESPONSE:
- ret = mex.getResponse().getMessage();
+ if(true)
+ {
+ invocationAdapter.createResponse(mex);
+ }
+
if (__log.isDebugEnabled())
__log.debug("Response message " + ret);
break;
@@ -276,9 +262,7 @@
throw new Exception("Failure response message: "+mex.getFault()+" : "+mex.getFaultExplanation());
default:
throw new Exception("Received ODE message exchange in unexpected state: " + mex.getStatus());
- }
-
- return(ret);
+ }
}
/**
@@ -440,8 +424,8 @@
_executorService = Executors.newCachedThreadPool(threadFactory);
else
_executorService = Executors.newFixedThreadPool(_odeConfig.getThreadPoolMaxSize(), threadFactory);
-
+
_bpelServer = new BpelServerImpl();
_scheduler = createScheduler();
_scheduler.setJobProcessor(_bpelServer);
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/JAXWSBindingContext.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -27,14 +27,12 @@
import org.jboss.soa.bpel.runtime.ws.WSDLReference;
import javax.wsdl.Definition;
-import javax.wsdl.Import;
import javax.wsdl.PortType;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
import java.io.File;
import java.net.URL;
-import java.util.Iterator;
import java.util.List;
import java.util.UUID;
@@ -48,12 +46,12 @@
{
protected final Log log = LogFactory.getLog(getClass());
- private BPELEngineImpl server;
+ private BPELEngineImpl engine;
private EndpointManager endpointManager;
public JAXWSBindingContext(BPELEngineImpl server) {
- this.server = server;
- this.endpointManager = new EndpointManager(this.server);
+ this.engine = server;
+ this.endpointManager = new EndpointManager(this.engine);
}
public org.apache.ode.bpel.iapi.EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint)
@@ -65,7 +63,7 @@
if(ref!=null)
{
- // might happend when processes are retired.
+ // might happen when processes are retired.
// See https://jira.jboss.org/jira/browse/RIFTSAW-57
log.warn("Endpoint does already exist: "
+ myRoleEndpoint.serviceName + "/"+myRoleEndpoint.portName);
@@ -85,7 +83,7 @@
);
ref = endpointManager.createEndpoint(endpointMD, wsdlReference, classLoader);
-
+
}
catch (Throwable e)
{
@@ -105,7 +103,7 @@
private File findWSDLFile(QName processId, Endpoint myRoleEndpoint)
{
- ProcessConf pconf = server._store.getProcessConfiguration(processId);
+ ProcessConf pconf = engine._store.getProcessConfiguration(processId);
List<File> files = pconf.getFiles();
File targetWsdlFile = null;
for(File f : files)
@@ -133,7 +131,7 @@
}
if(null==targetWsdlFile)
- throw new ContextException("Unable to find target WDL file for "+ myRoleEndpoint);
+ throw new ContextException("Unable to find target WSDL file for "+ myRoleEndpoint);
return targetWsdlFile;
}
@@ -185,7 +183,7 @@
private Definition getWSDLDefinition(QName processId, QName serviceName)
{
- ProcessConf pconf = server._store.getProcessConfiguration(processId);
+ ProcessConf pconf = engine._store.getProcessConfiguration(processId);
Definition wsdl = pconf.getDefinitionForService(serviceName);
if (wsdl == null)
throw new ContextException("Unable to access WSDL definition to activate MyRole endpoint for service " + serviceName
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/AbstractWebServiceEndpoint.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -24,25 +24,25 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.utils.DOMUtils;
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.soap.*;
import javax.xml.ws.Provider;
/**
* Base class for BPEL endpoints that are created through javassist.
* Represents a JAX-WS {@link javax.xml.ws.Provider} implementation.
- *
+ *
* @see org.jboss.soa.bpel.runtime.ws.WebServiceProviderFactory
*
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -51,56 +51,64 @@
{
protected final Log log = LogFactory.getLog(getClass());
- public SOAPMessage invoke(SOAPMessage request)
+ private SOAPMessageAdapter soapAdapter;
+ private QName serviceQName;
+
+ private boolean isInitialized;
+
+ private void init()
{
- log.debug("Invoking endpoint "+getEndpointId());
-
- try
+ if(!isInitialized)
{
- SOAPBody body = request.getSOAPBody();
- Element messageElement = null; // first child of type Element
- NodeList children = body.getChildNodes();
- for(int i=0; i<children.getLength(); i++)
+ try
{
- Node tmp = children.item(i);
- if(Node.ELEMENT_NODE == tmp.getNodeType())
- {
- messageElement = (Element)tmp;
- break;
- }
-
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ Definition wsdlDefinition = wsdlReader.readWSDL(getWsdlLocation());
+ this.serviceQName = QName.valueOf(getServiceName());
+ this.soapAdapter = new SOAPMessageAdapter(wsdlDefinition, serviceQName, getPortName());
}
+ catch (WSDLException e)
+ {
+ throw new RuntimeException("Failed to parse WSDL", e);
+ }
+ isInitialized = true;
+ }
+ }
- // make sure namespaces are preserved
- DOMUtils.pancakeNamespaces(messageElement);
+ public SOAPMessage invoke(SOAPMessage soapMessage)
+ {
+ log.debug("Invoking endpoint "+getEndpointId());
+ init();
- // TODO: https://jira.jboss.org/jira/browse/RIFTSAW-38
- // For now create a deep copy (performance hit)
+ try
+ {
+ SOAPPart soapPart = soapMessage.getSOAPPart();
+ SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
+ Element messageElement = getMessagePayload(soapEnvelope);
- DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- Document doc = builder.newDocument();
- Element clone = (Element)doc.importNode(messageElement, true);
-
if(log.isDebugEnabled())
- log.debug( "ODE inbound message: \n" +DOMWriter.printNode(clone, true) );
+ log.debug( "ODE inbound message: \n" +DOMWriter.printNode(soapEnvelope, true) );
- Element result = getEngine().invoke(
+ // Create invocation context
+ WSInvocationAdapter invocationContext = new WSInvocationAdapter(
messageElement.getLocalName(),
- QName.valueOf(getServiceName()),
- clone//(Element)messageElement
+ serviceQName,
+ soapAdapter
);
+ invocationContext.setSOAPMessage(soapMessage);
- if(log.isDebugEnabled())
- log.debug( "ODE outbound message: \n" +DOMWriter.printNode(result, true) );
+ // Invoke ODE
+ getEngine().invoke(invocationContext);
- SOAPMessage response = MessageFactory.newInstance().createMessage();
- SOAPBody responseBody = response.getSOAPBody();
- SOAPFactory soapFactory = SOAPFactory.newInstance();
- SOAPElement responseElement = soapFactory.createElement(result);
+ // Handle response
+ SOAPMessage responseMessage = invocationContext.getInvocationResult();
- responseBody.appendChild(responseElement);
+ if(log.isDebugEnabled())
+ log.debug( "ODE outbound message: \n" +
+ DOMWriter.printNode(responseMessage.getSOAPPart().getEnvelope(), true)
+ );
- return response;
+ return responseMessage;
}
catch (Exception e)
{
@@ -108,10 +116,32 @@
}
}
+ public static Element getMessagePayload(SOAPEnvelope soapEnvelope)
+ throws SOAPException
+ {
+ SOAPBody body = soapEnvelope.getBody();
+ Element messageElement = null; // first child of type Element
+ NodeList children = body.getChildNodes();
+ for(int i=0; i<children.getLength(); i++)
+ {
+ Node tmp = children.item(i);
+ if(Node.ELEMENT_NODE == tmp.getNodeType())
+ {
+ messageElement = (Element)tmp;
+ break;
+ }
+ }
+ return messageElement;
+ }
+
public abstract String getEndpointId();
public abstract String getServiceName();
+ public abstract String getWsdlLocation();
+
+ public abstract String getPortName();
+
private BPELEngine getEngine()
{
try
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/EndpointManager.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -93,7 +93,7 @@
metaData.getServiceName(),
metaData.getPortName(),
metaData.getEndpointId(),
- wsdlRef.getWsdlFileURL(),
+ wsdlRef,
classLoader
);
Copied: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContext.java (from rev 247, branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContext.java)
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContext.java (rev 0)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContext.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -0,0 +1,81 @@
+/*
+ * 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 javax.wsdl.Definition;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public class MessageContext
+{
+ private SOAPMessage message;
+ private QName serviceName;
+ private String portName;
+ private Definition wsdlDefinition;
+
+ protected MessageContext()
+ {
+ }
+
+ public void setMessage(SOAPMessage message)
+ {
+ this.message = message;
+ }
+
+ public SOAPMessage getMessage()
+ {
+ return message;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setServiceName(QName serviceName)
+ {
+ this.serviceName = serviceName;
+ }
+
+ public String getPortName()
+ {
+ return portName;
+ }
+
+ public void setPortName(String portName)
+ {
+ this.portName = portName;
+ }
+
+ public void setWsdlDefinition(Definition wsdlDefinition)
+ {
+ this.wsdlDefinition = wsdlDefinition;
+ }
+
+ public Definition getWsdlDefinition()
+ {
+ return wsdlDefinition;
+ }
+}
Copied: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContextAssoc.java (from rev 247, branches/hbraun/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContextAssoc.java)
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContextAssoc.java (rev 0)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/MessageContextAssoc.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public class MessageContextAssoc
+{
+ private static ThreadLocal<MessageContext> inbound = new ThreadLocal<MessageContext>();
+ private static ThreadLocal<MessageContext> outbound = new ThreadLocal<MessageContext>();
+
+ public static MessageContext createInbound()
+ {
+ if(inbound.get()!=null)
+ throw new IllegalStateException("inbound MessageContext already exists");
+ inbound.set(new MessageContext());
+ return inbound.get();
+ }
+
+ public static MessageContext createOutbound()
+ {
+ if(outbound.get()!=null)
+ throw new IllegalStateException("outbound MessageContext already exists");
+ outbound.set(new MessageContext());
+ return outbound.get();
+ }
+
+ public static MessageContext getInbound()
+ {
+ return inbound.get();
+ }
+
+ public static MessageContext getOutbound()
+ {
+ return outbound.get();
+ }
+
+ public static void clearAll()
+ {
+ inbound.set(null);
+ outbound.set(null);
+ }
+}
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 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/SOAPMessageAdapter.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -189,7 +189,7 @@
List<Part> parts = wsdlMessageDef.getOrderedParts(wsdlSoapBody.getParts());
for(Part part : parts)
- {
+ {
Element srcPartEl = DOMUtils.findChildByName(message, new QName(null, part.getName()));
if (srcPartEl == null)
throw new RuntimeException("Part is missing" +part.getName());
@@ -232,13 +232,33 @@
if (bo == null)
throw new RuntimeException("Binding output not found on "+serviceName+"/"+portName);
+ extractSoapBodyParts(odeMessage, soapMessage, getSOAPBody(bo), odeOperation.getOutput().getMessage(), odeOperation.getName() + "Response");
+ extractSoapHeaderParts(odeMessage, soapMessage, odeOperation.getOutput().getMessage());
+ }
- javax.wsdl.extensions.soap.SOAPBody wsdlSOAPBody = getSOAPBody(bo);
- extractSoapBodyParts(odeMessage, soapMessage, wsdlSOAPBody, odeOperation.getOutput().getMessage(), odeOperation.getName() + "Response");
+ public void parseSoapRequest(
+ org.apache.ode.bpel.iapi.Message odeMessage,
+ SOAPMessage soapMessage,
+ Operation op)
+ {
- extractSoapHeaderParts(odeMessage, soapMessage, odeOperation.getOutput().getMessage());
+ BindingOperation bop = binding.getBindingOperation(op.getName(), null, null);
+
+ if (bop == null)
+ throw new RuntimeException("Binding operation not found ("+serviceName+"/"+portName);
+
+ BindingInput bi = bop.getBindingInput();
+ if (bi == null)
+ throw new RuntimeException("Binding inout not found"+serviceName+"/"+portName);
+
+ extractSoapBodyParts(odeMessage, soapMessage, getSOAPBody(bi), op.getInput().getMessage(), op.getName());
+ extractSoapHeaderParts(odeMessage, soapMessage, op.getInput().getMessage());
}
+ public SOAPFault createSoapFault(Element message, QName faultName, Operation op) {
+ throw new RuntimeException("Not implemented");
+ }
+
private void extractSoapHeaderParts(Message odeMessage, SOAPMessage soapMessage, javax.wsdl.Message wsdlMessageDef)
{
log.warn("extractSoapHeaderParts() not implemented");
@@ -268,7 +288,7 @@
throw new RuntimeException("Expected part wrapper '"+rpcWrapQName+"'missing on service:"+serviceName+"/"+portName);
for(Part part : parts)
- {
+ {
SOAPElement srcPart = getFirstChildWithName(new QName(null, part.getName()), partWrapper);
if (srcPart == null)
throw new RuntimeException("Soap body does not contain required part +"+part.getName());
Copied: trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java (from rev 247, branches/hbraun/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 (rev 0)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WSInvocationAdapter.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -0,0 +1,98 @@
+/*
+ * 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.bpel.runtime.engine.InvocationAdapter;
+
+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 SOAPMessage soapRequestMessage;
+ private SOAPMessage soapResponseMessage;
+
+ private final SOAPMessageAdapter soapAdapter;
+
+ public WSInvocationAdapter(String operationName,
+ QName serviceName, SOAPMessageAdapter soapAdapter)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ this.soapAdapter = soapAdapter;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void parseRequest(MyRoleMessageExchange mex, Message request)
+ {
+ if(null==soapRequestMessage)
+ throw new IllegalArgumentException("No request SOAPMessage set");
+
+ soapAdapter.parseSoapRequest(request, soapRequestMessage, mex.getOperation());
+ }
+
+ 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 parse SOAP response", 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/bpel/runtime/ws/WebServiceProviderFactory.java
===================================================================
--- trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/WebServiceProviderFactory.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -30,8 +30,6 @@
import javassist.bytecode.annotation.StringMemberValue;
import javax.xml.namespace.QName;
-import java.net.URL;
-import java.util.UUID;
/**
* Creates JAX-WS Provider classes using javassist.
@@ -45,7 +43,12 @@
{
private final static String PKG_PREFIX = WebServiceProviderFactory.class.getPackage().getName()+".";
- public AbstractWebServiceEndpoint createProvider(QName service, String port, String endpointId, URL wsdlLocation, ClassLoader loader)
+ public AbstractWebServiceEndpoint createProvider(
+ QName service, String port,
+ String endpointId,
+ WSDLReference wsdlRef,
+ ClassLoader loader
+ )
throws Exception
{
ClassPool pool = new ClassPool(true);
@@ -60,16 +63,26 @@
String implClassName = PKG_PREFIX+"BPELWebServiceEndpoint_"+endpointId;
CtClass impl = pool.makeClass(implClassName);
- // BPELWebServiceProvider.endpointId property
+ // AbstractWebServiceEndpoint.endpointId property
CtField idField = new CtField(stringType, "endpointId", impl);
idField.setModifiers(Modifier.PUBLIC);
impl.addField(idField, "\""+endpointId+"\"");
- // BPELWebServiceProvider.serviceName property
+ // AbstractWebServiceEndpoint.serviceName property
CtField serviceField = new CtField(stringType, "serviceName", impl);
serviceField.setModifiers(Modifier.PUBLIC);
impl.addField(serviceField, "\""+service.toString()+"\"");
+ // AbstractWebServiceEndpoint.wsdlLocation property
+ CtField wsdlLocationField = new CtField(stringType, "wsdlLocation", impl);
+ wsdlLocationField.setModifiers(Modifier.PUBLIC);
+ impl.addField(wsdlLocationField, "\""+wsdlRef.getWsdlFileURL().toExternalForm()+"\"");
+
+ // AbstractWebServiceEndpoint.portName property
+ CtField portNameField = new CtField(stringType, "portName", impl);
+ portNameField.setModifiers(Modifier.PUBLIC);
+ impl.addField(portNameField, "\""+port+"\"");
+
// Annotations
ClassFile classFile = impl.getClassFile();
classFile.setVersionToJava5();
@@ -105,7 +118,7 @@
);
providerAnnotation.addMemberValue(
"wsdlLocation",
- new StringMemberValue(wsdlLocation.toExternalForm(), constantPool)
+ new StringMemberValue(wsdlRef.getWsdlFileURL().toExternalForm(), constantPool)
);
attr.addAnnotation(providerAnnotation);
@@ -124,39 +137,13 @@
// Provider interface and base implementation
impl.setSuperclass(pool.get("org.jboss.soa.bpel.runtime.ws.AbstractWebServiceEndpoint"));
- CtMethod method1 = new CtMethod(
- stringType, "getEndpointId",
- new CtClass[]{},
- impl
- );
+ createStringGetter(impl, stringType, "endpointId", "getEndpointId");
+ createStringGetter(impl, stringType, "serviceName", "getServiceName");
+ createStringGetter(impl, stringType, "wsdlLocation", "getWsdlLocation");
+ createStringGetter(impl, stringType, "portName", "getPortName");
- // Method body
- StringBuffer body = new StringBuffer();
- body.append("{");
- body.append("return this.endpointId;");
- body.append("}");
+ // ------------
- method1.setBody(body.toString());
- impl.addMethod(method1);
-
- // --------
-
-
- CtMethod method2 = new CtMethod(
- stringType, "getServiceName",
- new CtClass[]{},
- impl
- );
-
- // Method body
- StringBuffer body2 = new StringBuffer();
- body2.append("{");
- body2.append("return this.serviceName;");
- body2.append("}");
-
- method2.setBody(body2.toString());
- impl.addMethod(method2);
-
// freeze
impl.stopPruning(false);
impl.toClass(loader);
@@ -169,16 +156,23 @@
return obj;
}
- public static void main(String[] args) throws Exception
+ private void createStringGetter(CtClass impl, CtClass stringType, String property, String methodName)
+ throws Exception
{
- WebServiceProviderFactory fac = new WebServiceProviderFactory();
- AbstractWebServiceEndpoint providerImpl = fac.createProvider(
- new QName("ServiceName"), "portName",
- UUID.randomUUID().toString(),
- new URL("file://some/location/hello.wsdl"),
- Thread.currentThread().getContextClassLoader()
+ CtMethod method = new CtMethod(
+ stringType, methodName,
+ new CtClass[]{},
+ impl
);
- System.out.println(providerImpl.getEndpointId());
+ // Method body
+ StringBuffer body = new StringBuffer();
+ body.append("{");
+ body.append("return this."+property+";");
+ body.append("}");
+
+ method.setBody(body.toString());
+ impl.addMethod(method);
+
}
}
Modified: trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java
===================================================================
--- trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/BPELInvoke.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -28,6 +28,7 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import javax.naming.*;
+import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
@@ -176,11 +177,21 @@
org.w3c.dom.Element resp=null;
javax.xml.namespace.QName faultName=null;
- try {
- resp = engine.invoke(_config.getAttribute(OPERATION),
- new javax.xml.namespace.QName(getNamespace(serviceName),
- getLocalPart(serviceName)), mesgElem);
- } catch(BPELFault fault) {
+ try
+ {
+ QName serviceQName = new QName(getNamespace(serviceName), getLocalPart(serviceName));
+
+ // Create invocationContext
+ ESBInvocationAdapter invocationContext =
+ new ESBInvocationAdapter(_config.getAttribute(OPERATION), serviceQName);
+ invocationContext.setRequestXML(mesgElem);
+
+ // invoke ODE
+ engine.invoke(invocationContext);
+ resp = invocationContext.getInvocationResult();
+ }
+ catch(BPELFault fault)
+ {
resp = fault.getFaultMessage();
faultName = fault.getFaultName();
}
Copied: trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java (from rev 247, branches/hbraun/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java)
===================================================================
--- trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java (rev 0)
+++ trunk/runtime/jbossesb-bpel/src/main/java/org/jboss/soa/esb/actions/bpel/ESBInvocationAdapter.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -0,0 +1,90 @@
+/*
+ * 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.esb.actions.bpel;
+
+import org.apache.ode.bpel.iapi.Message;
+import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Heiko Braun <hbraun(a)redhat.com>
+ */
+public class ESBInvocationAdapter implements InvocationAdapter<Element>
+{
+ private String operationName;
+ private QName serviceName;
+ private Element requestXML;
+ private Element responseXML;
+
+ public ESBInvocationAdapter(String operationName, QName serviceName)
+ {
+ this.operationName = operationName;
+ this.serviceName = serviceName;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public QName getServiceName()
+ {
+ return serviceName;
+ }
+
+ public void setRequestXML(Element requestXML)
+ {
+ this.requestXML = requestXML;
+ }
+
+ public void parseRequest(MyRoleMessageExchange mex, Message request)
+ {
+ if(null==this.requestXML)
+ throw new IllegalArgumentException("request XML not set");
+ request.setMessage(this.requestXML);
+ }
+
+ public void createResponse(MyRoleMessageExchange mex)
+ {
+ this.responseXML = mex.getResponse().getMessage();
+ }
+
+ public Element getInvocationResult()
+ {
+ return this.responseXML;
+ }
+
+ // test methods
+ Element getRequestXML()
+ {
+ return requestXML;
+ }
+
+ void setResponseXML(Element responseXML)
+ {
+ this.responseXML = responseXML;
+ }
+}
+
Modified: trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java
===================================================================
--- trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/runtime/jbossesb-bpel/src/test/java/org/jboss/soa/esb/actions/bpel/TestBPELEngine.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -17,16 +17,16 @@
*/
package org.jboss.soa.esb.actions.bpel;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
import org.jboss.soa.bpel.runtime.engine.BPELEngine;
import org.jboss.soa.bpel.runtime.engine.BPELFault;
import org.jboss.soa.bpel.runtime.engine.IntegrationLayer;
+import org.jboss.soa.bpel.runtime.engine.InvocationAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
public class TestBPELEngine implements BPELEngine {
public TestBPELEngine() {
@@ -51,38 +51,35 @@
m_response = doc.getDocumentElement();
}
-
- @Override
+
public void addIntegrationLayer(IntegrationLayer il) {
// TODO Auto-generated method stub
}
- @Override
public void close() throws Exception {
// TODO Auto-generated method stub
}
- @Override
public void init() throws Exception {
// TODO Auto-generated method stub
}
- @Override
- public Element invoke(String operation, QName service, Element message)
+ public void invoke(InvocationAdapter invocationAdapter)
throws BPELFault, Exception {
if (m_fault != null) {
throw m_fault;
}
-
- m_request = message;
- return(m_response);
+
+
+ ESBInvocationAdapter esbCtx = (ESBInvocationAdapter) invocationAdapter;
+ m_request = esbCtx.getRequestXML();
+ esbCtx.setResponseXML(m_response);
}
- @Override
public void removeIntegrationLayer(IntegrationLayer il) {
// TODO Auto-generated method stub
Modified: trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/RiskAssessmentPTImpl.java
===================================================================
--- trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/RiskAssessmentPTImpl.java 2009-11-06 18:21:59 UTC (rev 249)
+++ trunk/samples/quickstart/loan_approval/war/src/com/example/loan_approval/wsdl/RiskAssessmentPTImpl.java 2009-11-09 08:30:23 UTC (rev 250)
@@ -5,28 +5,28 @@
import javax.jws.WebService;
@WebService(
- endpointInterface="com.example.loan_approval.wsdl.RiskAssessmentPT",
- targetNamespace = "http://example.com/loan-approval/wsdl/",
- portName="riskAssessor_Port")
+ endpointInterface="com.example.loan_approval.wsdl.RiskAssessmentPT",
+ targetNamespace = "http://example.com/loan-approval/wsdl/",
+ portName="riskAssessor_Port")
public class RiskAssessmentPTImpl implements RiskAssessmentPT {
- public String check(
- String firstName,
- String name,
- BigInteger amount)
- throws ErrorMessage {
- System.out.println("\nRiskAssessmentPTImpl");
- System.out.println("*************************************************");
- System.out.println("firstName Parameter: " + firstName );
- System.out.println("name Parameter: " + name );
- System.out.println("amount Parameter: " + amount );
- System.out.println("*************************************************");
- System.out.println("\n");
-
- if (amount.intValue() <= 10000)
- return "low";
- else
- return "high";
- }
-
+ public String check(
+ String firstName,
+ String name,
+ BigInteger amount)
+ throws ErrorMessage {
+ System.out.println("\nRiskAssessmentPTImpl");
+ System.out.println("*************************************************");
+ System.out.println("firstName Parameter: " + firstName );
+ System.out.println("name Parameter: " + name );
+ System.out.println("amount Parameter: " + amount );
+ System.out.println("*************************************************");
+ System.out.println("\n");
+
+ if (amount.intValue() <= 10000)
+ return "low";
+ else
+ return "high";
+ }
+
}
15 years, 1 month