Updated Branches:
  refs/heads/master d4bc4147d -> 69102e435

ODE-964: Correlation with soap header


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/69102e43
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/69102e43
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/69102e43

Branch: refs/heads/master
Commit: 69102e435b0cf8e37f8b3d89c698b946de9085c0
Parents: d4bc414
Author: sathwik <[email protected]>
Authored: Wed Feb 13 15:37:48 2013 +0530
Committer: sathwik <[email protected]>
Committed: Wed Feb 13 15:37:48 2013 +0530

----------------------------------------------------------------------
 axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml   |    2 +
 .../CorrelationCustomSoapHeaderTest.java           |   83 +++++++++++++++
 .../TestCorrelationCustomSoapHeader/deploy.xml     |   29 +++++
 .../firstRequest.soap                              |   26 +++++
 .../secondRequest.soap                             |   32 ++++++
 .../wsdlWithHeader-Process.bpel                    |   75 +++++++++++++
 .../wsdlWithHeader-Process.wsdl                    |   64 +++++++++++
 .../wsdlWithHeader.wsdl                            |   29 +++++
 .../wsdlWithheaders.wsdl                           |   72 +++++++++++++
 .../ode/axis2/util/SoapMessageConverter.java       |    3 +-
 .../runtime/PropertyAliasEvaluationContext.java    |    5 +-
 11 files changed, 418 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
----------------------------------------------------------------------
diff --git a/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml 
b/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
index d33cd9c..831bb2e 100644
--- a/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
+++ b/axis2-war/src/main/webapp/WEB-INF/conf/axis2.xml
@@ -246,6 +246,8 @@
                      
class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
             <handler name="RequestURIOperationDispatcher"
                      
class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     
class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
             <handler name="HTTPLocationBasedDispatcher"
                      
class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
         </phase>

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationCustomSoapHeaderTest.java
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationCustomSoapHeaderTest.java
 
b/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationCustomSoapHeaderTest.java
new file mode 100644
index 0000000..7969c7e
--- /dev/null
+++ 
b/axis2-war/src/test/java/org/apache/ode/axis2/correlation/CorrelationCustomSoapHeaderTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.correlation;
+
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertNotNull;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.description.AxisService;
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.bpel.pmapi.InstanceInfoListDocument;
+import org.apache.ode.bpel.pmapi.ProcessInfoDocument;
+import org.apache.ode.bpel.pmapi.TInstanceInfo;
+import org.apache.ode.bpel.pmapi.TInstanceInfoList;
+import org.apache.ode.utils.DOMUtils;
+import org.testng.annotations.Test;
+import org.w3c.dom.Element;
+
+public class CorrelationCustomSoapHeaderTest extends Axis2TestBase {
+    @Test(dataProvider="configs")
+    public void testCorrelationWithCustomSoapHeaders() throws Exception{
+        server.undeployProcess("TestCorrelationCustomSoapHeader");
+        if (!server.isDeployed("TestCorrelationCustomSoapHeader")) 
+            server.deployProcess("TestCorrelationCustomSoapHeader");
+
+        String response1 = 
sendRequestFile("http://localhost:"+getTestPort(0)+"/processes/Correlation-Header/wsdlWithHeader/Process/initiator",
+                "TestCorrelationCustomSoapHeader", "firstRequest.soap");
+
+        //Take out the IID from the response which is used as the correlation 
value
+        Element rootElemt = DOMUtils.stringToDOM(response1);
+        Element soapBody = DOMUtils.getFirstChildElement(rootElemt);
+        assertEquals("Body", soapBody.getLocalName());
+
+        Element responseElem = DOMUtils.getFirstChildElement(soapBody);
+        assertEquals("Recevie_first_messageResponse", 
responseElem.getLocalName());
+
+        InstanceInfoListDocument infoListDoc = 
server.getODEServer().getInstanceManagement().listInstances("name=Process 
namespace=http://example.com/wsdlWithHeader/Process status=active", "", 1);
+        TInstanceInfoList infoList = infoListDoc.getInstanceInfoList();
+        TInstanceInfo[] infoListArr = infoList.getInstanceInfoArray();
+
+        assertNotNull(infoListArr);
+        assertNotNull(infoListArr[0]);
+
+        Long iid = null;
+
+        TInstanceInfo object = infoListArr[0];
+        //instance has to be in active status
+        assertEquals("ACTIVE", object.getStatus().toString());
+        iid = new Long(object.getIid());
+
+        //send second request
+        String response2 = 
sendRequestFile("http://localhost:"+getTestPort(0)+"/processes/correlationWithHeaders",
 "TestCorrelationCustomSoapHeader", "secondRequest.soap");
+
+        //instance should have completed now
+        String iidStatus = 
server.getODEServer().getInstanceManagement().getInstanceInfo(iid).getInstanceInfo().getStatus().toString();
+        assertEquals("COMPLETED", iidStatus);
+
+        server.undeployProcess("TestCorrelationCustomSoapHeader");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/deploy.xml
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/deploy.xml 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/deploy.xml
new file mode 100644
index 0000000..30ae16b
--- /dev/null
+++ b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/deploy.xml
@@ -0,0 +1,29 @@
+<?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.
+  -->
+<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:diag="http://example.com/wsdlWithHeader"; 
xmlns:tns="http://www.example.org/wsdlwithheader/"; 
xmlns:initiator="http://example.com/wsdlWithHeader/initiator"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:this="http://example.com/wsdlWithHeader/Process"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; name="this:Process" 
fileName="wsdlWithHeader-Process.bpel">
+  <dd:property name="PATH">wsdlWithHeader</dd:property>
+  <dd:provide partnerLink="processAndInitiatorPlkVar">
+    <dd:service name="this:CanonicServiceForinitiator" 
port="canonicPort"></dd:service>
+  </dd:provide>
+  <dd:provide 
partnerLink="processAndInitiatorForPortWsdl-with-headerSOAPPlkVar">
+    <dd:service name="tns:wsdl-with-header" 
port="wsdl-with-headerSOAP"></dd:service>
+  </dd:provide>
+</dd:process></dd:deploy>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/firstRequest.soap
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/firstRequest.soap
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/firstRequest.soap
new file mode 100644
index 0000000..2ebbaf3
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/firstRequest.soap
@@ -0,0 +1,26 @@
+<?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:proc="http://example.com/wsdlWithHeader/Process";>
+   <soapenv:Header/>
+   <soapenv:Body>
+      <proc:Recevie_first_messageRequest>1</proc:Recevie_first_messageRequest>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/secondRequest.soap
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/secondRequest.soap
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/secondRequest.soap
new file mode 100644
index 0000000..32ad653
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/secondRequest.soap
@@ -0,0 +1,32 @@
+<?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:wsd="http://www.example.org/wsdlwithheader/";>
+   <soapenv:Header>
+      <wsd:request>
+         <in>1000</in>
+      </wsd:request>
+   </soapenv:Header>
+   <soapenv:Body>
+      <wsd:request>
+         <in>1</in>
+      </wsd:request>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.bpel
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.bpel
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.bpel
new file mode 100644
index 0000000..c62dfc3
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.bpel
@@ -0,0 +1,75 @@
+<?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.
+  -->
+<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:tns="http://www.example.org/wsdlwithheader/"; 
xmlns:initiator="http://example.com/wsdlWithHeader/initiator"; 
xmlns:this="http://example.com/wsdlWithHeader/Process"; 
xmlns:diag="http://example.com/wsdlWithHeader"; 
xmlns:xml="http://www.w3.org/XML/1998/namespace"; 
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="_McZpcDJ2Ed6Mu8Tm6kQxHA" 
targetNamespace="http://example.com/wsdlW
 ithHeader/Process">
+  <bpel:import namespace="http://example.com/wsdlWithHeader"; 
location="wsdlWithHeader.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://example.com/wsdlWithHeader/Process"; 
location="wsdlWithHeader-Process.wsdl" 
importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:import namespace="http://www.example.org/wsdlwithheader/"; 
location="wsdlWithheaders.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+  <bpel:partnerLinks>
+    <bpel:partnerLink name="processAndInitiatorPlkVar" 
partnerLinkType="diag:ProcessAndInitiator" myRole="Process_for_initiator"/>
+    <bpel:partnerLink 
name="processAndInitiatorForPortWsdl-with-headerSOAPPlkVar" 
partnerLinkType="diag:ProcessAndInitiatorForPortWsdl-with-headerSOAPPlk" 
myRole="Process_for_initiator"/>
+  </bpel:partnerLinks>
+  <bpel:correlationSets>
+    <bpel:correlationSet name="set1" properties="this:instanceId"/>
+  </bpel:correlationSets>
+  <bpel:variables>
+    <bpel:variable name="thisRecevie_first_messageRequest" 
messageType="this:Recevie_first_messageRequest"/>
+    <bpel:variable name="thisRecevie_first_messageResponse" 
messageType="this:Recevie_first_messageResponse"/>
+    <bpel:variable name="tnsCorrelattionWithHeadersRequestMsg" 
messageType="tns:correlattionWithHeadersRequest"/>
+    <bpel:variable name="tnsCorrelattionWithHeadersResponseMsg" 
messageType="tns:correlattionWithHeadersResponse"/>
+  </bpel:variables>
+  <bpel:sequence>
+    <bpel:receive partnerLink="processAndInitiatorPlkVar" 
portType="this:Forinitiator" operation="Recevie_first_message" 
variable="thisRecevie_first_messageRequest" createInstance="yes" 
bpmn:label="Recevie first message" name="Recevie_first_message" 
bpmn:id="_Of-qwDJ2Ed6Mu8Tm6kQxHA"></bpel:receive>
+    <bpel:assign name="init-variables-Process" 
bpmn:id="_Of-qwDJ2Ed6Mu8Tm6kQxHA">
+      <bpel:copy bpmn:label="$thisRecevie_first_messageResponse">
+        <bpel:from>
+          <bpel:literal>
+<this:Recevie_first_messageResponse></this:Recevie_first_messageResponse></bpel:literal>
+        </bpel:from>
+        <bpel:to>$thisRecevie_first_messageResponse.body</bpel:to>
+      </bpel:copy>
+      <bpel:copy bpmn:label="$tnsCorrelattionWithHeadersResponseMsg">
+        <bpel:from>
+          <bpel:literal>
+<tns:response>
+  <out></out>
+</tns:response></bpel:literal>
+        </bpel:from>
+        <bpel:to>$tnsCorrelattionWithHeadersResponseMsg.parameters</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:assign bpmn:label="Recevie first message" 
name="Recevie_first_message-1" bpmn:id="_Of-qwDJ2Ed6Mu8Tm6kQxHA">
+      <bpel:copy>
+        <bpel:from>1000</bpel:from>
+        <bpel:to>$thisRecevie_first_messageResponse.body</bpel:to>
+      </bpel:copy>
+    </bpel:assign>
+    <bpel:reply partnerLink="processAndInitiatorPlkVar" 
portType="this:Forinitiator" operation="Recevie_first_message" 
variable="thisRecevie_first_messageResponse" bpmn:label="Recevie first message" 
name="Recevie_first_message-2" bpmn:id="_Of-qwDJ2Ed6Mu8Tm6kQxHA">
+      <bpel:correlations>
+        <bpel:correlation set="set1" initiate="join"/>
+      </bpel:correlations>
+    </bpel:reply>
+    <bpel:receive 
partnerLink="processAndInitiatorForPortWsdl-with-headerSOAPPlkVar" 
portType="tns:wsdl-with-header" operation="correlattionWithHeaders" 
variable="tnsCorrelattionWithHeadersRequestMsg" 
bpmn:label="correlattionWithHeaders" name="correlattionWithHeaders" 
bpmn:id="_kzEgGDJ7Ed6WJp7-9Y3qBw">
+      <bpel:correlations>
+        <bpel:correlation set="set1" initiate="no"/>
+      </bpel:correlations>
+    </bpel:receive>
+    <bpel:reply 
partnerLink="processAndInitiatorForPortWsdl-with-headerSOAPPlkVar" 
portType="tns:wsdl-with-header" operation="correlattionWithHeaders" 
variable="tnsCorrelattionWithHeadersResponseMsg" 
bpmn:label="correlattionWithHeaders" name="correlattionWithHeaders-1" 
bpmn:id="_kzEgGDJ7Ed6WJp7-9Y3qBw"></bpel:reply>
+  </bpel:sequence>
+</bpel:process>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.wsdl
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.wsdl
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.wsdl
new file mode 100644
index 0000000..456ef24
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader-Process.wsdl
@@ -0,0 +1,64 @@
+<?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 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:xml="http://www.w3.org/XML/1998/namespace"; 
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"; 
xmlns:wsdlWithheaders="http://www.example.org/wsdlwithheader/"; 
xmlns:diag="http://example.com/wsdlWithHeader"; 
xmlns:tns="http://www.example.org/wsdlwithheader/"; 
xmlns:initiator="http://example.com/wsdlWithHeader/initiator"; 
xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:pnlk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"; 
xmlns:this="http://example.com/wsdlWithHeader/Process"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
targetNamespace="http://example.com/wsdlWithHeader/Process";>
+    <wsdl:types>
+        <xs:schema elementFormDefault="qualified" 
targetNamespace="http://example.com/wsdlWithHeader/Process";>
+            <xs:element name="Recevie_first_messageRequest" type="xs:string"/>
+            <xs:element name="Recevie_first_messageResponse" type="xs:string"/>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:import namespace="http://www.example.org/wsdlwithheader/"; 
location="wsdlWithheaders.wsdl"/>
+    <wsdl:message name="Recevie_first_messageRequest">
+        <wsdl:part name="body" element="this:Recevie_first_messageRequest"/>
+    </wsdl:message>
+    <wsdl:message name="Recevie_first_messageResponse">
+        <wsdl:part name="body" element="this:Recevie_first_messageResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="Forinitiator">
+        <wsdl:operation name="Recevie_first_message">
+            <wsdl:input message="this:Recevie_first_messageRequest" 
name="Recevie_first_message"/>
+            <wsdl:output message="this:Recevie_first_messageResponse" 
name="Recevie_first_messageResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="CanonicBindingForinitiator" type="this:Forinitiator">
+        <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="Recevie_first_message">
+            <soap:operation style="document" 
soapAction="http://example.com/wsdlWithHeader/Process/Forinitiator/Recevie_first_message"/>
+            <wsdl:input name="Recevie_first_message">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="Recevie_first_messageResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="CanonicServiceForinitiator">
+        <wsdl:port name="canonicPort" 
binding="this:CanonicBindingForinitiator">
+            <soap:address 
location="http://localhost:8080/ode/processes/Correlation-Header/wsdlWithHeader/Process/initiator"/>
+        </wsdl:port>
+    </wsdl:service>
+    <vprop:property name="instanceId" type="xs:string"/>
+    <vprop:propertyAlias propertyName="this:instanceId" 
messageType="this:Recevie_first_messageResponse" part="body">
+        <vprop:query>text()</vprop:query>
+    </vprop:propertyAlias>
+    <vprop:propertyAlias propertyName="this:instanceId" 
messageType="tns:correlattionWithHeadersRequest" part="header">
+        <vprop:query>in/text()</vprop:query>
+    </vprop:propertyAlias>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader.wsdl
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader.wsdl
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader.wsdl
new file mode 100644
index 0000000..40cae5f
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithHeader.wsdl
@@ -0,0 +1,29 @@
+<?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 xmlns:tns="http://www.example.org/wsdlwithheader/"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:Process="http://example.com/wsdlWithHeader/Process"; 
xmlns:diag="http://example.com/wsdlWithHeader"; 
xmlns:initiator="http://example.com/wsdlWithHeader/initiator"; 
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/wsdlWithHeader";>
+    <wsdl:import namespace="http://example.com/wsdlWithHeader/Process"; 
location="wsdlWithHeader-Process.wsdl"/>
+    <wsdl:import namespace="http://www.example.org/wsdlwithheader/"; 
location="wsdlWithheaders.wsdl"/>
+    <pnlk:partnerLinkType name="ProcessAndInitiator">
+        <pnlk:role name="Process_for_initiator" 
portType="Process:Forinitiator"/>
+    </pnlk:partnerLinkType>
+    <pnlk:partnerLinkType 
name="ProcessAndInitiatorForPortWsdl-with-headerSOAPPlk">
+        <pnlk:role name="Process_for_initiator" 
portType="tns:wsdl-with-header"/>
+    </pnlk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithheaders.wsdl
----------------------------------------------------------------------
diff --git 
a/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithheaders.wsdl
 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithheaders.wsdl
new file mode 100644
index 0000000..303372e
--- /dev/null
+++ 
b/axis2-war/src/test/resources/TestCorrelationCustomSoapHeader/wsdlWithheaders.wsdl
@@ -0,0 +1,72 @@
+<?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 xmlns:pnlk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:tns="http://www.example.org/wsdlwithheader/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="wsdlwithheader" 
targetNamespace="http://www.example.org/wsdlwithheader/";>
+  <wsdl:types>
+    <xsd:schema targetNamespace="http://www.example.org/wsdlwithheader/";>
+      <xsd:element name="request">
+        <xsd:complexType>
+          <xsd:sequence>
+            <xsd:element name="in" type="xsd:string"/>
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="response">
+        <xsd:complexType>
+          <xsd:sequence>
+            <xsd:element name="out" type="xsd:string"/>
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:element>
+    </xsd:schema>
+  </wsdl:types>
+  <wsdl:message name="correlattionWithHeadersRequest">
+    <wsdl:part element="tns:request" name="parameters"/>
+
+    <wsdl:part name="header" element="tns:request"></wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="correlattionWithHeadersResponse">
+    <wsdl:part element="tns:response" name="parameters"/>
+  </wsdl:message>
+  <wsdl:portType name="wsdl-with-header">
+    <wsdl:operation name="correlattionWithHeaders">
+      <wsdl:input message="tns:correlattionWithHeadersRequest"/>
+      <wsdl:output message="tns:correlattionWithHeadersResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="wsdl-with-headerSOAP" type="tns:wsdl-with-header">
+    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="correlattionWithHeaders">
+      <soap:operation 
soapAction="http://www.example.org/wsdl-with-header/correlattionWithHeaders"/>
+      <wsdl:input>
+        <soap:body use="literal" parts="parameters"/>
+        <soap:header use="literal"  
message="tns:correlattionWithHeadersRequest" part="header"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="wsdl-with-header">
+    <wsdl:port binding="tns:wsdl-with-headerSOAP" name="wsdl-with-headerSOAP">
+      <soap:address 
location="http://localhost:8080/ode/processes/correlationWithHeaders"/>
+    </wsdl:port>
+  </wsdl:service>
+ 
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/axis2/src/main/java/org/apache/ode/axis2/util/SoapMessageConverter.java
----------------------------------------------------------------------
diff --git 
a/axis2/src/main/java/org/apache/ode/axis2/util/SoapMessageConverter.java 
b/axis2/src/main/java/org/apache/ode/axis2/util/SoapMessageConverter.java
index 382d3a9..597d2cd 100644
--- a/axis2/src/main/java/org/apache/ode/axis2/util/SoapMessageConverter.java
+++ b/axis2/src/main/java/org/apache/ode/axis2/util/SoapMessageConverter.java
@@ -459,7 +459,8 @@ public class SoapMessageConverter {
             Message hdrMsg = _def.getMessage(headerDef.getMessage());
             for (Object o : hdrMsg.getParts().values()) {
                 Part p = (Part) o;
-                if (p.getElementName().equals(elmtName)) return p.getName();
+                if (p.getElementName().equals(elmtName) && 
p.getName().equals(headerDef.getPart()))
+                    return p.getName();
             }
         }
         return elmtName.getLocalPart();

http://git-wip-us.apache.org/repos/asf/ode/blob/69102e43/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
----------------------------------------------------------------------
diff --git 
a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
 
b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
index 6c7ba5b..552996c 100644
--- 
a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
+++ 
b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
@@ -55,7 +55,10 @@ public class PropertyAliasEvaluationContext implements 
EvaluationContext {
             _root = headerParts.get(alias.header);
         } else if (alias.part != null) {
             Element part = DOMUtils.findChildByName(msgData,new QName(null, 
alias.part.name),false);
-            if (part != null && alias.part.type instanceof OElementVarType) {
+            //check if the property alias is defined on the header part of the 
message
+            if(part == null){
+                _root = headerParts.get(alias.part.name);
+            } else if (part != null && alias.part.type instanceof 
OElementVarType) {
                 _root = DOMUtils.findChildByName(part, 
((OElementVarType)alias.part.type).elementType);
             } else
                 _root = part;

Reply via email to