You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2009/06/23 21:10:28 UTC

svn commit: r787794 - in /ode/trunk: axis2-war/src/test/java/org/apache/ode/axis2/ axis2-war/src/test/resources/TestSoapHeader2/ engine/src/main/java/org/apache/ode/bpel/engine/

Author: midon
Date: Tue Jun 23 19:10:28 2009
New Revision: 787794

URL: http://svn.apache.org/viewvc?rev=787794&view=rev
Log:
ODE-627: send all soap headers

Added:
    ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeader2Test.java
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/deploy.xml
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.bpel
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.wsdl
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.wsdl
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.xsd
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/location.endpoint
    ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/testRequest.soap
Modified:
    ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java

Added: ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeader2Test.java
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeader2Test.java?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeader2Test.java (added)
+++ ode/trunk/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeader2Test.java Tue Jun 23 19:10:28 2009
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+package org.apache.ode.axis2;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.JettyWrapper;
+import org.apache.ode.axis2.httpbinding.HttpBindingTest;
+import org.apache.ode.utils.DOMUtils;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.mortbay.jetty.handler.ContextHandler;
+import org.mortbay.jetty.handler.AbstractHandler;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Request;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.util.concurrent.CountDownLatch;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.io.IOException;
+import java.io.StringReader;
+
+/**
+ * <p/>
+ * This unit test passes an integer to a BPEL. Then the BPEL invokes the 6 operations of Arithmetics.wsdl.
+ * These operations are set up to use the various Http binding configurations.
+ * <p/>
+ * From a "business" standpoint:<br/>
+ * Let N be the input number, stored in the testRequest1.soap file<br/>
+ * This test will compute the Sum of the first (N + 5) positive integers.
+ * <p/>
+ * If N=10, the expected result is 15*(15+1)/2 = 120
+ *
+ * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
+ */
+public class SoapHeader2Test extends Axis2TestBase {
+
+    private static final Log log = LogFactory.getLog(SoapHeader2Test.class);
+
+    protected JettyWrapper jettyWrapper;
+
+
+    @BeforeMethod
+    protected void setUp() throws Exception {
+        super.setUp();
+        ContextHandler contextHandler = new ContextHandler();
+        contextHandler.setContextPath("/TestSoapHeader2");
+        contextHandler.setHandler(new AbstractHandler() {
+            public void handle(String s, HttpServletRequest request, HttpServletResponse response, int i) throws IOException, ServletException {
+                boolean header1found = false, header2found = false;
+                String line;
+                while ((line = request.getReader().readLine()) != null && (!header1found || !header2found)) {
+                    header1found = header1found || line.matches(".*Hello from TestSoapHeader2</header1-field1>.*");
+                    header2found = header2found || line.matches(".*Hello from TestSoapHeader2</header2-field1>.*");
+                }
+                response.getOutputStream().print("<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:unit=\"http://ode/bpel/unit-test.wsdl\">\n" +
+                        "   <soapenv:Header/>\n" +
+                        "   <soapenv:Body>\n" +
+                        "      <unit:body>\n");
+                if (header1found && header2found) {
+                    response.getOutputStream().print("         <unit:message>TestSoapHeader2 passed</unit:message>\n");
+                } else {
+                    response.getOutputStream().print("         <unit:message>Some soap headers are missing!</unit:message>\n");
+                }
+                response.getOutputStream().print("      </unit:body>\n" +
+                        "   </soapenv:Body>\n" +
+                        "</soapenv:Envelope>");
+                response.getOutputStream().close();
+                response.setStatus(200);
+                ((Request) request).setHandled(true);
+            }
+        });
+
+        jettyWrapper = new JettyWrapper(contextHandler);
+        jettyWrapper.start();
+    }
+
+    @AfterMethod
+    protected void tearDown() throws Exception {
+        jettyWrapper.stop();
+        super.tearDown();
+    }
+
+    @Test
+    public void testSoapHeaders() throws Exception {
+        String bundleName = "TestSoapHeader2";
+        // deploy the required service
+        if (!server.isDeployed(bundleName)) server.deployProcess(bundleName);
+        try {
+            String response = server.sendRequestFile("http://localhost:8888/processes/hello/hello/process/client",
+                    bundleName, "testRequest.soap");
+            if (log.isDebugEnabled()) log.debug(response);
+            assertTrue("Soap headers missing!", response.contains("TestSoapHeader2 passed"));
+        } finally {
+            server.undeployProcess(bundleName);
+        }
+    }
+
+}

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/HelloWorld2.wsdl Tue Jun 23 19:10:28 2009
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<wsdl:definitions 
+    targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/unit-test.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+   
+
+   <wsdl:types>
+      <xsd:schema targetNamespace="http://ode/bpel/unit-test.wsdl" 
+        attributeFormDefault="qualified" elementFormDefault="qualified">
+      <xsd:include schemaLocation="hello.xsd"/>
+      </xsd:schema> 
+   </wsdl:types>
+   
+    <wsdl:message name="HelloMessage">
+        <wsdl:part name="TestPart" element="tns:body"/>
+    </wsdl:message>
+    
+    <wsdl:message name="headers">
+        <wsdl:part name="h1" element="tns:header1"/>
+        <wsdl:part name="h2" element="tns:header2"/>        
+    </wsdl:message>
+        
+    <wsdl:portType name="HelloPortType">
+        <wsdl:operation name="hello">
+            <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+            <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+        </wsdl:operation>    
+    </wsdl:portType>
+    
+     <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="hello">
+            <soap:operation soapAction=""/>
+            <wsdl:input>
+                <soap:header message="tns:headers" use="literal" part="h1"/>
+                <soap:header message="tns:headers" use="literal" part="h2"/>            
+                <soap:body parts="TestPart" use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    
+    <wsdl:service name="HelloService">
+		<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+     		<soap:address location="http://localhost:7070/TestSoapHeader2/"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="HelloPartnerLinkType">
+       <plnk:role name="me" portType="tns:HelloPortType"/>
+       <plnk:role name="you" portType="tns:HelloPortType"/>
+   </plnk:partnerLinkType>
+   
+</wsdl:definitions>
+

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/deploy.xml?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/deploy.xml (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/deploy.xml Tue Jun 23 19:10:28 2009
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<dd:deploy xmlns:dd="http://www.apache.org/ode/schemas/dd/2007/03"><dd:process xmlns:dd="http://www.apache.org/ode/schemas/dd/2007/03" xmlns:tns="http://ode/bpel/unit-test.wsdl" xmlns:service="http://example.com/hello/service" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:diag="http://example.com/hello" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:client="http://example.com/hello/client" xmlns:this="http://example.com/hello/process" name="this:process" fileName="hello-process.bpel">
+  <dd:property name="PATH">hello</dd:property>
+  <dd:property name="SVG">hello.svg</dd:property>
+  <dd:provide partnerLink="processAndClientPlkVar">
+    <dd:service name="this:CanonicServiceForclient" port="canonicPort"></dd:service>
+  </dd:provide>
+  <dd:invoke partnerLink="serviceAndProcessForHelloPortPlkVar">
+    <dd:service name="tns:HelloService" port="HelloPort"></dd:service>
+  </dd:invoke>
+</dd:process></dd:deploy>
\ No newline at end of file

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.bpel?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.bpel (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.bpel Tue Jun 23 19:10:28 2009
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpel:process xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:pnlk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ode="http://www.apache.org/ode/type/extension" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:this="http://example.com/hello/process" xmlns:client="http://example.com/hello/client" xmlns:tns="http://ode/bpel/unit-test.wsdl" xmlns:diag="http://example.com/hello" xmlns:service="http://example.com/hello/service" xmlns:bpmn="http://www.intalio.com/bpms" xmlns:atomic="http://ode.apache.org/atomicScope" queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" bpmn:label="process" name="process" bpmn:id="_Ue3NkBenEd6EIOjxNvjNWw" targetNamespace="http://e
 xample.com/hello/process">
+  <bpel:import namespace="http://ode/bpel/unit-test.wsdl" location="HelloWorld2.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://example.com/hello" location="hello.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://example.com/hello/process" location="hello-process.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:partnerLinks>
+    <bpel:partnerLink name="processAndClientPlkVar" partnerLinkType="diag:processAndClient" myRole="process_for_client"/>
+    <bpel:partnerLink name="serviceAndProcessForHelloPortPlkVar" partnerLinkType="diag:serviceAndProcessForHelloPortPlk" initializePartnerRole="yes" partnerRole="service_for_process"/>
+  </bpel:partnerLinks>
+  <bpel:variables>
+    <bpel:variable name="thisEventStartMessageRequest" messageType="this:EventStartMessageRequest"/>
+    <bpel:variable name="thisEventStartMessageResponse" messageType="this:EventStartMessageResponse"/>
+    <bpel:variable name="tnsTestInMsg" messageType="tns:HelloMessage"/>
+    <bpel:variable name="tnsTestOutMsg" messageType="tns:HelloMessage"/>
+  </bpel:variables>
+  <bpel:sequence>
+    <bpel:receive partnerLink="processAndClientPlkVar" portType="this:Forclient" operation="EventStartMessage" variable="thisEventStartMessageRequest" createInstance="yes" bpmn:label="Message_Start_Event" name="Message_Start_Event" bpmn:id="_bJfSgBenEd6EIOjxNvjNWw"></bpel:receive>
+    <bpel:assign name="init-variables-process" bpmn:id="_bJfSgBenEd6EIOjxNvjNWw">
+      <bpel:copy bpmn:label="$thisEventStartMessageResponse">
+        <bpel:from>
+          <bpel:literal>
+<this:EventStartMessageResponse></this:EventStartMessageResponse></bpel:literal>
+        </bpel:from>
+        <bpel:to>$thisEventStartMessageResponse.body</bpel:to>
+      </bpel:copy>
+      <bpel:copy bpmn:label="$tnsTestInMsg">
+        <bpel:from>
+          <bpel:literal>
+<tns:header1>
+  <tns:header1-field1></tns:header1-field1>
+</tns:header1></bpel:literal>
+        </bpel:from>
+        <bpel:to variable="tnsTestInMsg" header="h1"></bpel:to>
+      </bpel:copy>
+      <bpel:copy bpmn:label="$tnsTestInMsg">
+        <bpel:from>
+          <bpel:literal>
+<tns:header2>
+  <tns:header2-field1></tns:header2-field1>
+</tns:header2></bpel:literal>
+        </bpel:from>
+        <bpel:to variable="tnsTestInMsg" header="h2"></bpel:to>
+      </bpel:copy>
+      <bpel:copy bpmn:label="$tnsTestInMsg">
+        <bpel:from>
+          <bpel:literal>
+<tns:body>
+  <tns:message></tns:message>
+</tns:body></bpel:literal>
+        </bpel:from>
+        <bpel:to>$tnsTestInMsg.TestPart</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:assign bpmn:label="Task" name="Task" bpmn:id="_bvx2cBenEd6EIOjxNvjNWw">
+      <bpel:copy>
+        <bpel:from>$thisEventStartMessageRequest.body/tns:message</bpel:from>
+        <bpel:to variable="tnsTestInMsg" header="h2">
+          <bpel:query>tns:header2-field1</bpel:query>
+        </bpel:to>
+      </bpel:copy>
+      <bpel:copy>
+        <bpel:from>$thisEventStartMessageRequest.body/tns:message</bpel:from>
+        <bpel:to>$tnsTestInMsg.TestPart/tns:message</bpel:to>
+      </bpel:copy>
+      <bpel:copy>
+        <bpel:from>$thisEventStartMessageRequest.body/tns:message</bpel:from>
+        <bpel:to variable="tnsTestInMsg" header="h1">
+          <bpel:query>tns:header1-field1</bpel:query>
+        </bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:invoke partnerLink="serviceAndProcessForHelloPortPlkVar" portType="tns:HelloPortType" operation="hello" inputVariable="tnsTestInMsg" outputVariable="tnsTestOutMsg" bpmn:label="Task" name="Task-1" bpmn:id="_bvx2cBenEd6EIOjxNvjNWw"></bpel:invoke>
+    <bpel:assign bpmn:label="Message_End_Event" name="Message_End_Event" bpmn:id="_cYnYEBenEd6EIOjxNvjNWw">
+      <bpel:copy>
+        <bpel:from>$tnsTestOutMsg.TestPart</bpel:from>
+        <bpel:to>$thisEventStartMessageResponse.body</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:reply partnerLink="processAndClientPlkVar" portType="this:Forclient" operation="EventStartMessage" variable="thisEventStartMessageResponse" bpmn:label="Message_End_Event" name="Message_End_Event-1" bpmn:id="_cYnYEBenEd6EIOjxNvjNWw"></bpel:reply>
+  </bpel:sequence>
+</bpel:process>
\ No newline at end of file

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.wsdl?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello-process.wsdl Tue Jun 23 19:10:28 2009
@@ -0,0 +1,40 @@
+<?xml version='1.0' encoding='utf-8'?>
+<wsdl:definitions xmlns:tns="http://ode/bpel/unit-test.wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hello="http://ode/bpel/unit-test.wsdl" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:client="http://example.com/hello/client" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:service="http://example.com/hello/service" xmlns:diag="http://example.com/hello" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pnlk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:this="http://example.com/hello/process" targetNamespace="http://example.com/hello/process">
+    <wsdl:types>
+        <xs:schema targetNamespace="http://ode/bpel/unit-test.wsdl">
+            <xs:include schemaLocation="hello.xsd"/>
+        </xs:schema>
+        <xs:schema elementFormDefault="qualified" targetNamespace="http://example.com/hello/process">
+            <xs:element name="EventStartMessageResponse" type="xs:string"/>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="EventStartMessageRequest">
+        <wsdl:part name="body" element="tns:body"/>
+    </wsdl:message>
+    <wsdl:message name="EventStartMessageResponse">
+        <wsdl:part name="body" element="this:EventStartMessageResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="Forclient">
+        <wsdl:operation name="EventStartMessage">
+            <wsdl:input message="this:EventStartMessageRequest" name="EventStartMessage"/>
+            <wsdl:output message="this:EventStartMessageResponse" name="EventStartMessageResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CanonicBindingForclient" type="this:Forclient">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="EventStartMessage">
+            <soap:operation style="document" soapAction="http://example.com/hello/process/Forclient/EventStartMessage"/>
+            <wsdl:input name="EventStartMessage">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="EventStartMessageResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CanonicServiceForclient">
+        <wsdl:port name="canonicPort" binding="this:CanonicBindingForclient">
+            <soap:address location="http://localhost:8080/ode/processes/hello/hello/process/client"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.wsdl?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.wsdl (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.wsdl Tue Jun 23 19:10:28 2009
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='utf-8'?>
+<wsdl:definitions xmlns:process="http://example.com/hello/process" xmlns:tns="http://ode/bpel/unit-test.wsdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:diag="http://example.com/hello" xmlns:client="http://example.com/hello/client" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:pnlk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:bpdm="http://www.intalio/designer/business-process-data-modeling" targetNamespace="http://example.com/hello">
+    <wsdl:import namespace="http://ode/bpel/unit-test.wsdl" location="HelloWorld2.wsdl"/>
+    <wsdl:import namespace="http://example.com/hello/process" location="hello-process.wsdl"/>
+    <pnlk:partnerLinkType name="serviceAndProcessForHelloPortPlk">
+        <pnlk:role name="service_for_process" portType="tns:HelloPortType"/>
+    </pnlk:partnerLinkType>
+    <pnlk:partnerLinkType name="processAndClient">
+        <pnlk:role name="process_for_client" portType="process:Forclient"/>
+    </pnlk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.xsd
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.xsd?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.xsd (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/hello.xsd Tue Jun 23 19:10:28 2009
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema targetNamespace="http://ode/bpel/unit-test.wsdl"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    attributeFormDefault="qualified" elementFormDefault="qualified">
+
+    <xsd:element name="header1">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:element name="header1-field1" type="xsd:string" />
+            </xsd:sequence>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="header2">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:element name="header2-field1" type="xsd:string" />
+            </xsd:sequence>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="body">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:element name="message" type="xsd:string" />
+            </xsd:sequence>
+        </xsd:complexType>
+    </xsd:element>
+
+</xsd:schema>

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/location.endpoint
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/location.endpoint?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/location.endpoint (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/location.endpoint Tue Jun 23 19:10:28 2009
@@ -0,0 +1,6 @@
+
+alias.myns=http://ode/bpel/unit-test.wsdl
+# not yet implemented in trunk
+#myns.HelloService.ode.address=http://localhost:${system.test.port.1}/TestSoapHeader2/
+
+

Added: ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/testRequest.soap
URL: http://svn.apache.org/viewvc/ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/testRequest.soap?rev=787794&view=auto
==============================================================================
--- ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/testRequest.soap (added)
+++ ode/trunk/axis2-war/src/test/resources/TestSoapHeader2/testRequest.soap Tue Jun 23 19:10:28 2009
@@ -0,0 +1,27 @@
+<?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.
+  -->
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:unit="http://ode/bpel/unit-test.wsdl">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <unit:body>
+         <unit:message>Hello from TestSoapHeader2</unit:message>
+      </unit:body>
+   </soapenv:Body>
+</soapenv:Envelope>

Modified: ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=787794&r1=787793&r2=787794&view=diff
==============================================================================
--- ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java (original)
+++ ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java Tue Jun 23 19:10:28 2009
@@ -729,7 +729,9 @@
             Element part = (Element) parts.item(m);
             if (part.getAttribute("headerPart") != null && part.getAttribute("headerPart").length() > 0) {
                 header.appendChild(doc.importNode(part, true));
+                // remove the element from the list AND decrement the index to avoid skipping the next element!!
                 outgoingElmt.removeChild(part);
+                m--;
             }
         }
         message.setData(outgoingElmt);