Author: objectiser
Date: 2010-03-22 13:59:37 -0400 (Mon, 22 Mar 2010)
New Revision: 583
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELSimpleCorrelationWithOneWayTestCase.java
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.bpel
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.wsdl
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/bpel-deploy.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/build.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_request1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_response1.xml
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/hello_request1.xml
Modified:
trunk/integration-tests/build.xml
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/BaseWebServiceEndpoint.java
Log:
RIFTSAW-154 - fix one-way request issue.
Modified: trunk/integration-tests/build.xml
===================================================================
--- trunk/integration-tests/build.xml 2010-03-22 05:01:51 UTC (rev 582)
+++ trunk/integration-tests/build.xml 2010-03-22 17:59:37 UTC (rev 583)
@@ -128,6 +128,7 @@
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_header_ode/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_hello_world_header_wsdl/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_correlation/build.xml"
/>
+ <ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_invoke/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_simple_pick/build.xml"
/>
<ant
antfile="src/test/resources/samples/Quickstart_bpel_loan_approval/build.xml"
/>
Added:
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELSimpleCorrelationWithOneWayTestCase.java
===================================================================
---
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELSimpleCorrelationWithOneWayTestCase.java
(rev 0)
+++
trunk/integration-tests/src/test/java/org/jboss/soa/bpel/tests/samples/QuickstartBPELSimpleCorrelationWithOneWayTestCase.java 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,71 @@
+/*
+ * 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.tests.samples;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Test case for running the Quickstart_bpel_simple_correlation_with_oneway sample.
+ */
+public class QuickstartBPELSimpleCorrelationWithOneWayTestCase extends RiftSawTest {
+
+ private static final String TEST_NAME =
"Quickstart_bpel_simple_correlation_with_oneway";
+
+ public QuickstartBPELSimpleCorrelationWithOneWayTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(QuickstartBPELSimpleCorrelationWithOneWayTestCase.class,
+ TEST_NAME, "Quickstart_bpel_simple_correlation_with_oneway-1.jar"));
+ }
+
+ public void testSendHelloGoodbye() throws Exception {
+
+ sendSOAPMessage("hello_request1.xml",
+ "http://localhost:8080/Quickstart_bpel_simple_correlation_onewayWS");
+
+ try {
+ synchronized(this) {
+ wait(5000);
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ String result2=sendSOAPMessage("goodbye_request1.xml",
+ "http://localhost:8080/Quickstart_bpel_simple_correlation_onewayWS");
+
+ // If testing against cxf, then result is presented slightly differently
+ if (result2.indexOf("SOAP-ENV") != -1) {
+ result2 = result2.replaceAll("SOAP-ENV", "env");
+ result2 = result2.replaceAll(" xmlns=\"\"","");
+ result2 = result2.replaceAll("\"","'");
+ result2 = result2.replaceAll("<env:Header
/>","<env:Header></env:Header>");
+ }
+
+ assertMessageFromFile(result2, "goodbye_response1.xml");
+ }
+}
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.bpel
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.bpel
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.bpel 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,93 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<process name="HelloGoodbyeOneWay"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloGoodbye.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloGoodbyeOneWayPartnerLink"
+ partnerLinkType="intf:HelloGoodbyeOneWayPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <correlationSets
xmlns:cor="http://example.com/supplyCorrelation">
+ <correlationSet name="Session"
+ properties="intf:SessionID" />
+ </correlationSets>
+
+ <variables>
+ <variable name="myHelloVar"
messageType="intf:HelloMessage"/>
+ <variable name="myGoodbyeVar"
messageType="intf:GoodbyeMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloGoodbyeOneWayPartnerLink"
+ portType="intf:HelloGoodbyeOneWayPortType"
+ operation="hello"
+ variable="myHelloVar"
+ createInstance="yes">
+ <correlations>
+ <correlation set="Session" initiate="yes" />
+ </correlations>
+ </receive>
+
+ <receive
+ name="start"
+ partnerLink="helloGoodbyeOneWayPartnerLink"
+ portType="intf:HelloGoodbyeOneWayPortType"
+ operation="goodbye"
+ variable="myGoodbyeVar">
+ <correlations>
+ <correlation set="Session" initiate="no" />
+ </correlations>
+ </receive>
+
+ <assign name="assignGoodbyeMesg">
+ <copy>
+ <from variable="myGoodbyeVar" part="Message"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myGoodbyeVar" part="Message"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloGoodbyeOneWayPartnerLink"
+ portType="intf:HelloGoodbyeOneWayPortType"
+ operation="goodbye"
+ variable="myGoodbyeVar">
+ <correlations>
+ <correlation set="Session" initiate="no" />
+ </correlations>
+ </reply>
+ </sequence>
+</process>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.wsdl
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.wsdl
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/HelloGoodbye.wsdl 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:types="http://www.jboss.org/bpel/examples/xsd"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:types>
+ <xsd:schema
targetNamespace="http://www.jboss.org/bpel/examples/xsd">
+ <xsd:complexType name="SessionIdentity">
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="ID" type="types:SessionIdentity"/>
+ <wsdl:part name="Message" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:message name="GoodbyeMessage">
+ <wsdl:part name="ID" type="types:SessionIdentity"/>
+ <wsdl:part name="Message" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloGoodbyeOneWayPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="HelloIn"/>
+ </wsdl:operation>
+ <wsdl:operation name="goodbye">
+ <wsdl:input message="tns:GoodbyeMessage"
name="GoodbyeIn"/>
+ <wsdl:output message="tns:GoodbyeMessage"
name="GoodbyeOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloGoodbyeOneWaySoapBinding"
type="tns:HelloGoodbyeOneWayPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="goodbye">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloGoodbyeOneWayService">
+ <wsdl:port name="HelloGoodbyeOneWayPort"
binding="tns:HelloGoodbyeOneWaySoapBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_simple_correlation_onewayWS"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloGoodbyeOneWayPartnerLinkType">
+ <plnk:role name="me"
portType="tns:HelloGoodbyeOneWayPortType"/>
+ <plnk:role name="you"
portType="tns:HelloGoodbyeOneWayPortType"/>
+ </plnk:partnerLinkType>
+
+ <vprop:property name="SessionID" type="xsd:int" />
+
+ <vprop:propertyAlias propertyName="tns:SessionID"
+ messageType="tns:HelloMessage" part="ID">
+ <vprop:query>id</vprop:query>
+ </vprop:propertyAlias>
+
+ <vprop:propertyAlias propertyName="tns:SessionID"
+ messageType="tns:GoodbyeMessage"
part="ID">
+ <vprop:query>id</vprop:query>
+ </vprop:propertyAlias>
+
+
+</wsdl:definitions>
+
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/bpel-deploy.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/bpel-deploy.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/bpel/bpel-deploy.xml 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,29 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+ <process name="bpl:HelloGoodbyeOneWay">
+ <active>true</active>
+ <provide partnerLink="helloGoodbyeOneWayPartnerLink">
+ <service name="intf:HelloGoodbyeOneWayService"
port="HelloGoodbyeOneWayPort"/>
+ </provide>
+ </process>
+</deploy>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/build.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/build.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/build.xml 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,29 @@
+<project name="Quickstart_bpel_simple_correlation_with_oneway"
default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="version" value="1" />
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="test.dir"
value="${basedir}/src/test/resources/samples/${ant.project.name}"/>
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <jar basedir="${test.dir}/bpel"
destfile="${deploy.dir}/${ant.project.name}/${sample.jar.name}" />
+
+ <copy todir="${deploy.dir}/${ant.project.name}">
+ <fileset dir="${test.dir}/messages"/>
+ </copy>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+</project>
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_request1.xml 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:goodbye>
+ <ID>
+ <id>1</id>
+ </ID>
+ <Message>Goodbye</Message>
+ </wsdl:goodbye>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_response1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_response1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/goodbye_response1.xml 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,3 @@
+<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:...
xmlns:odens='http://www.jboss.org/bpel/examples/wsdl'><ID>
+ <id>1</id>
+ </ID><Message>Goodbye
World</Message></odens:goodbyeResponse></env:Body></env:Envelope>
\ No newline at end of file
Added:
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/hello_request1.xml
===================================================================
---
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/hello_request1.xml
(rev 0)
+++
trunk/integration-tests/src/test/resources/samples/Quickstart_bpel_simple_correlation_with_oneway/messages/hello_request1.xml 2010-03-22
17:59:37 UTC (rev 583)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <ID>
+ <id>1</id>
+ </ID>
+ <Message>Hello</Message>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/BaseWebServiceEndpoint.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/BaseWebServiceEndpoint.java 2010-03-22
05:01:51 UTC (rev 582)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/ws/BaseWebServiceEndpoint.java 2010-03-22
17:59:37 UTC (rev 583)
@@ -119,6 +119,13 @@
log.debug( "ODE no outbound message");
}
+ if (responseMessage == null) {
+ log.debug("No response, probably due to oneway request");
+
+ // Need to create an empty response to avoid npe in jbossws (RIFTSAW-154)
+ responseMessage = MessageFactory.newInstance().createMessage();
+ }
+
return responseMessage;
}
catch (Exception e)