You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/05/22 01:40:38 UTC

svn commit: r658934 [1/2] - in /ode/branches/APACHE_ODE_1.1: ./ bpel-api/src/main/java/org/apache/ode/bpel/common/ bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/ bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runt...

Author: mriou
Date: Wed May 21 16:40:35 2008
New Revision: 658934

URL: http://svn.apache.org/viewvc?rev=658934&view=rev
Log:
ODE-281 XPath functions for RESTful BPEL: combineUrl, composeUrl, expandTemplate.

Added:
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/CombineUrlTest.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/FunctionHelperTest.java
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.bpel
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.wsdl
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/deploy.xml
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/test.properties
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.bpel
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.wsdl
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/deploy.xml
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/test.properties
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.bpel
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.wsdl
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/deploy.xml
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/test.properties
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/URITemplate.java
    ode/branches/APACHE_ODE_1.1/utils/src/test/java/org/apache/ode/utils/URITemplateTest.java
Modified:
    ode/branches/APACHE_ODE_1.1/Rakefile
    ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java
    ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java
    ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java
    ode/branches/APACHE_ODE_1.1/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java

Modified: ode/branches/APACHE_ODE_1.1/Rakefile
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/Rakefile?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/Rakefile (original)
+++ ode/branches/APACHE_ODE_1.1/Rakefile Wed May 21 16:40:35 2008
@@ -251,7 +251,7 @@
     compile.from apt
     compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-obj", "bpel-schemas",
       "bpel-store", "jacob", "jacob-ap", "utils"),
-      COMMONS.logging, COMMONS.collections, JAXEN, JAVAX.persistence, JAVAX.stream, SAXON, WSDL4J, XMLBEANS
+      COMMONS.logging, COMMONS.collections, COMMONS.httpclient, JAXEN, JAVAX.persistence, JAVAX.stream, SAXON, WSDL4J, XMLBEANS
 
     test.with projects("scheduler-simple", "dao-jpa", "dao-hibernate", "bpel-epr"),
         BACKPORT, COMMONS.pool, COMMONS.lang, DERBY, JAVAX.connector, JAVAX.transaction,
@@ -298,7 +298,8 @@
   define "bpel-test" do
     compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-runtime",
       "bpel-store", "utils", "bpel-epr", "dao-jpa"),
-      DERBY, Java::JUnit::JUNIT_REQUIRES, JAVAX.persistence, OPENJPA, WSDL4J
+      DERBY, Java::JUnit::JUNIT_REQUIRES, JAVAX.persistence, OPENJPA, WSDL4J, COMMONS.httpclient,
+	COMMONS.codec
 
     test.with projects("bpel-obj", "jacob", "bpel-schemas",
       "bpel-scripts", "scheduler-simple"),
@@ -463,7 +464,7 @@
 
   desc "ODE Utils"
   define "utils" do
-    compile.with COMMONS.logging, COMMONS.pool, LOG4J, XERCES, JAVAX.stream, WSDL4J
+    compile.with COMMONS.logging, COMMONS.pool, COMMONS.httpclient, COMMONS.codec, LOG4J, XERCES, JAVAX.stream, WSDL4J
 	test.exclude "*TestResources"
     package :jar
   end

Modified: ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java Wed May 21 16:40:35 2008
@@ -27,29 +27,41 @@
  * <p>As per BPEL specification, appendix A.</p>
  */
 public class FaultException extends Exception {
-  private static final long serialVersionUID = 389190682205802035L;
-  private QName _qname;
+    private static final long serialVersionUID = 389190682205802035L;
+    private QName _qname;
 
-  /**
-   * Create a new instance.
-   * @param qname the <code>QName</code> of the fault
-   * @param message a descriptive message for the exception
-   */
-  public FaultException(QName qname, String message) {
-    super(message);
-    _qname = qname;
-  }
+    /**
+     * Create a new instance.
+     *
+     * @param qname   the <code>QName</code> of the fault
+     * @param message a descriptive message for the exception
+     */
+    public FaultException(QName qname, String message) {
+        super(message);
+        _qname = qname;
+    }
 
-  public FaultException(QName qname) {
-    super(qname.toString());
-    _qname = qname;
-  }
+    public FaultException(QName qname) {
+        super(qname.toString());
+        _qname = qname;
+    }
+
+    public FaultException(QName qname, String message, Throwable cause) {
+        super(message, cause);
+        this._qname = qname;
+    }
+
+    public FaultException(QName qname, Throwable cause) {
+        super(cause);
+        this._qname = qname;
+    }
 
-  /**
-   * Get the (official) <code>QName</code> of this fault.
-   * @return the <code>QName</code> of the fault
-   */
-  public QName getQName() {
-    return _qname;
+    /**
+     * Get the (official) <code>QName</code> of this fault.
+     *
+     * @return the <code>QName</code> of the fault
+     */
+    public QName getQName() {
+        return _qname;
   }
 }

Modified: ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/Constants.java Wed May 21 16:40:35 2008
@@ -50,6 +50,9 @@
      * Non standard extension function ode:splitToElements(sourceText, 'separator' 'targetLocalName', 'targetNS'?)
      */
     public static final String NON_STDRD_FUNCTION_SPLITTOELEMENTS = "splitToElements";
+    public static final String NON_STDRD_FUNCTION_COMBINE_URL = "combineUrl";
+    public static final String NON_STDRD_FUNCTION_COMPOSE_URL = "composeUrl";
+    public static final String NON_STDRD_FUNCTION_EXPAND_TEMPLATE = "expandTemplate";
 
     public static boolean isBpelNamespace(String uri){
         return Namespaces.WS_BPEL_20_NS.equals(uri) || Namespaces.WSBPEL2_0_FINAL_EXEC.equals(uri)

Modified: ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java Wed May 21 16:40:35 2008
@@ -19,13 +19,6 @@
 
 package org.apache.ode.bpel.elang.xpath20.compiler;
 
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPathFunction;
-import javax.xml.xpath.XPathFunctionException;
-import javax.xml.xpath.XPathFunctionResolver;
-
 import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.api.CompilerContext;
 import org.apache.ode.bpel.elang.xpath10.compiler.XPathMessages;
@@ -39,6 +32,12 @@
 import org.apache.ode.utils.msg.MessageBundle;
 import org.apache.ode.utils.xsl.XslTransformHandler;
 
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPathFunction;
+import javax.xml.xpath.XPathFunctionException;
+import javax.xml.xpath.XPathFunctionResolver;
+import java.util.List;
+
 /**
  * @author mriou <mriou at apache dot org>
  */
@@ -76,6 +75,11 @@
             String localName = functionName.getLocalPart();
             if (Constants.NON_STDRD_FUNCTION_SPLITTOELEMENTS.equals(localName)) {
                 return new SplitToElements();
+            } else if (Constants.NON_STDRD_FUNCTION_COMBINE_URL.equals(localName)) {
+                return new CombineUrl();
+            } else if (Constants.NON_STDRD_FUNCTION_COMPOSE_URL.equals(localName)
+                    || Constants.NON_STDRD_FUNCTION_EXPAND_TEMPLATE.equals(localName)) {
+                return new ComposeUrl();
             }
         }
 
@@ -144,4 +148,23 @@
         }
     }
 
+    public static class CombineUrl implements XPathFunction {
+        public Object evaluate(List args) throws XPathFunctionException {
+            if (args.size() != 2) {
+                throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_COMBINE_URL));
+            }
+            return "";
+        }
+    }
+
+    public static class ComposeUrl implements XPathFunction {
+        public Object evaluate(List args) throws XPathFunctionException {
+            boolean separareParameteters;
+            if (args.size() != 2 && (args.size() <= 2 || args.size() % 2 != 1)) {
+                throw new CompilationException(__msgs.errInvalidNumberOfArguments(Constants.NON_STDRD_FUNCTION_COMPOSE_URL));
+            }
+            return "";
+        }
+    }
+
 }

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java Wed May 21 16:40:35 2008
@@ -20,6 +20,7 @@
 package org.apache.ode.bpel.elang.xpath20.runtime;
 
 import net.sf.saxon.dom.NodeWrapper;
+import org.apache.commons.httpclient.URIException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
@@ -35,6 +36,7 @@
 import org.apache.ode.bpel.o.OXslSheet;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.Namespaces;
+import org.apache.ode.utils.URITemplate;
 import org.apache.ode.utils.xsl.XslTransformHandler;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -50,10 +52,13 @@
 import javax.xml.xpath.XPathFunctionResolver;
 import java.io.IOException;
 import java.io.StringWriter;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author mriou <mriou at apache dot org>
@@ -92,6 +97,12 @@
             String localName = functionName.getLocalPart();
             if (Constants.NON_STDRD_FUNCTION_SPLITTOELEMENTS.equals(localName)) {
                 return new SplitToElements();
+            } else if (Constants.NON_STDRD_FUNCTION_COMBINE_URL.equals(localName)) {
+                return new CombineUrl();
+            } else if (Constants.NON_STDRD_FUNCTION_COMPOSE_URL.equals(localName)) {
+                return new ComposeUrl();
+            } else if (Constants.NON_STDRD_FUNCTION_EXPAND_TEMPLATE.equals(localName)) {
+                return new ComposeUrl(true, "expandTemplateInvalidSource");
             }
         }
 
@@ -100,13 +111,14 @@
 
     public class GetLinkStatus implements XPathFunction {
         public Object evaluate(List args) throws XPathFunctionException {
-            assert args.size() == 1;
+            if (args.size() != 1)
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getLinkStatusInvalidSource"), "Illegal Arguments"));
 
             OLink olink = _oxpath.links.get(args.get(0));
             try {
                 return _ectx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
             } catch (FaultException e) {
-                throw new XPathFunctionException(e);
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getLinkStatusInvalidSource"), e));
             }
         }
     }
@@ -117,11 +129,11 @@
                 __log.debug("call(context=" + _ectx + " args=" + args + ")");
             }
 
-            String varname  = (String) args.get(0);
+            String varname = (String) args.get(0);
             String partname = args.size() > 1 ? (String) args.get(1) : null;
-            String xpathStr = args.size() > 2 ? (String)args.get(2) : null;
+            String xpathStr = args.size() > 2 ? (String) args.get(2) : null;
 
-            OXPath10Expression.OSigGetVariableData sig = _oxpath.resolveGetVariableDataSig(varname,partname,xpathStr);
+            OXPath10Expression.OSigGetVariableData sig = _oxpath.resolveGetVariableDataSig(varname, partname, xpathStr);
             if (sig == null) {
                 String msg = "InternalError: Attempt to use an unknown getVariableData signature: " + args;
                 if (__log.isFatalEnabled())
@@ -135,13 +147,12 @@
                     ret = _ectx.evaluateQuery(ret, sig.location);
 
                 if (__log.isDebugEnabled()) {
-                    __log.debug("bpws:getVariableData(" + args +  ")' = " + ret);
+                    __log.debug("bpws:getVariableData(" + args + ")' = " + ret);
                 }
 
                 return ret;
             } catch (FaultException e) {
                 __log.error("bpws:getVariableData(" + args + ") threw FaultException");
-
                 throw new XPathFunctionException(e);
             }
         }
@@ -150,7 +161,7 @@
     public class GetVariableProperty implements XPathFunction {
         public Object evaluate(List args) throws XPathFunctionException {
             if (args.size() != 2) {
-                throw new XPathFunctionException("missing required arguments");
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getVariablePropertyInvalidSource"), "Missing required arguments"));
             }
 
             OScope.Variable var = _oxpath.vars.get(args.get(0));
@@ -171,20 +182,20 @@
 
     public class DoXslTransform implements XPathFunction {
         public Object evaluate(List args) throws XPathFunctionException {
-            assert args.size() >= 2;
-            assert args.size() % 2 == 0;
+            if (args.size() < 2 || (args.size() % 2) != 0)
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "doXslTransformInvalidSource"), "Invalid arguments"));
+
             if (__log.isDebugEnabled()) {
                 __log.debug("call(context=" + _ectx + " args=" + args + ")");
             }
-            if(!(_oxpath instanceof OXPath10ExpressionBPEL20)) {
-                throw new IllegalStateException("XPath function bpws:doXslTransform not supported in " +
-                        "BPEL 1.1!");
+            if (!(_oxpath instanceof OXPath10ExpressionBPEL20)) {
+                throw new IllegalStateException("XPath function bpws:doXslTransform not supported in BPEL 1.1!");
             }
 
             Element varElmt;
             try {
                 if (args.get(1) instanceof List) {
-                    List elmts = (List)args.get(1);
+                    List elmts = (List) args.get(1);
                     if (elmts.size() != 1) throw new XPathFunctionException(
                             new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
                                     "Second parameter of the bpws:doXslTransform function MUST point to a single " +
@@ -192,7 +203,7 @@
                     varElmt = (Element) elmts.get(0);
                 } else {
                     if (args.get(1) instanceof NodeWrapper)
-                        varElmt = (Element) ((NodeWrapper)args.get(1)).getUnderlyingNode();
+                        varElmt = (Element) ((NodeWrapper) args.get(1)).getUnderlyingNode();
                     else varElmt = (Element) args.get(1);
                 }
             } catch (ClassCastException e) {
@@ -224,11 +235,11 @@
             HashMap<QName, Object> parametersMap = null;
             if (args.size() > 2) {
                 parametersMap = new HashMap<QName, Object>();
-                for (int idx = 2; idx < args.size(); idx+=2) {
+                for (int idx = 2; idx < args.size(); idx += 2) {
                     QName keyQName = _oxpath.namespaceCtx.derefQName((String) args.get(idx));
                     Object paramElmt;
                     if (args.get(idx + 1) instanceof NodeWrapper) {
-                        Element tmpElmt = (Element) ((NodeWrapper)args.get(idx + 1)).getUnderlyingNode();
+                        Element tmpElmt = (Element) ((NodeWrapper) args.get(idx + 1)).getUnderlyingNode();
                         Document paramDoc = DOMUtils.newDocument();
                         paramDoc.appendChild(paramDoc.importNode(tmpElmt, true));
                         paramElmt = paramDoc;
@@ -293,43 +304,18 @@
      */
     public class SplitToElements implements XPathFunction {
         public Object evaluate(List args) throws XPathFunctionException {
-            assert args.size() > 2;
-            assert args.size() < 5;
+            if (args.size() <= 2 || args.size() >= 5)
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "splitInvalidSource"), "Invalid arguments"));
+
             if (__log.isDebugEnabled()) {
                 __log.debug("splitToElements call(context=" + _ectx + " args=" + args + ")");
             }
 
-            // Checking the first parameters, should be a proper element or a text node. Java verbosity at its best.
-            String strToSplit = null;
+            String strToSplit;
             try {
-                Node firstParam = null;
-                if (args.get(0) instanceof List) {
-                    List elmts = (List)args.get(0);
-                    if (elmts.size() != 1) throw new XPathFunctionException(
-                            new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "splitInvalidSource"),
-                                    "First parameter of the ode:splitToElements function MUST point to a single " +
-                                            "element or text node."));
-                    firstParam = (Node) elmts.get(0);
-                } else  if (args.get(0) instanceof NodeWrapper) {
-                    firstParam = (Node) ((NodeWrapper)args.get(0)).getUnderlyingNode();
-                } else if (args.get(0) instanceof Node) {
-                    firstParam = (Node) args.get(0);
-                } else {
-                    strToSplit = (String) args.get(0);
-                }
-
-                if (strToSplit == null) {
-                    if (Node.ELEMENT_NODE == firstParam.getNodeType()) {
-                        strToSplit = firstParam.getTextContent().trim();
-                    } else if (Node.TEXT_NODE == firstParam.getNodeType()) {
-                        strToSplit = ((Text)firstParam).getWholeText().trim();
-                    }
-                }
-            } catch (ClassCastException e) {
-                throw new XPathFunctionException(
-                        new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "splitInvalidSource"),
-                                "First parameter of the ode:splitToElements function MUST point to a single " +
-                                        "element node."));
+                strToSplit = Helper.extractString(args.get(0));
+            } catch (IllegalArgumentException e) {
+                throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "splitInvalidSource"), e));
             }
 
             // Other parameters
@@ -352,5 +338,227 @@
 
             return wrapper;
         }
+
+    }
+
+    /**
+     * Takes the relative URL and combines it with the base URL to return a new absolute URL.
+     * If the relative parameter is an absolute URL, returns it instead.
+     * <p/>
+     * As described in section 5 of <a href="http://www.ietf.org/rfc/rfc2396.txt">rfc2396</a>.
+     * <p/>
+     * This implementation relies heavily on {@link java.net.URL}. As thus, the same restrictions apply, especially regarding encoding.
+     * <p/>
+     * <i>"The URL class does not itself encode or decode any URL components according
+     * to the escaping mechanism defined in RFC2396. It is the responsibility of the caller
+     * to encode any fields, which need to be escaped prior to calling URL, and also to decode
+     * any escaped fields, that are returned from URL."</i>
+     *
+     * @see java.net.URL
+     * @see URL#URL(java.net.URL, String)
+     */
+    public static class CombineUrl implements XPathFunction {
+        public Object evaluate(List args) throws XPathFunctionException {
+            final QName FAULT_QNAME = new QName(Namespaces.ODE_EXTENSION_NS, "combineUrlInvalidSource");
+            if (args.size() != 2) {
+                throw new XPathFunctionException(new FaultException(FAULT_QNAME, "Invalid arguments"));
+            }
+
+
+            String base;
+            try {
+                base = Helper.extractString(args.get(0));
+            } catch (IllegalArgumentException e) {
+                throw new XPathFunctionException(new FaultException(FAULT_QNAME, "Invalid argument: " + args.get(0), e));
+            }
+            String relative;
+            try {
+                relative = Helper.extractString(args.get(1));
+            } catch (IllegalArgumentException e) {
+                throw new XPathFunctionException(new FaultException(FAULT_QNAME, "Invalid argument: " + args.get(1), e));
+            }
+
+            URL baseURL;
+            try {
+                baseURL = new URL(base);
+            } catch (MalformedURLException e) {
+                throw new XPathFunctionException(new FaultException(FAULT_QNAME, "First parameter [" + base + "] MUST point to a well-formed URL.", e));
+            }
+            try {
+                URL combined = new URL(baseURL, relative);
+                return combined.toExternalForm();
+            } catch (MalformedURLException e) {
+                throw new XPathFunctionException(new FaultException(FAULT_QNAME, e.getMessage(), e));
+            }
+        }
     }
+
+    public static class ComposeUrl implements XPathFunction {
+        boolean preserveUndefinedVar = false;
+        String faultLocalPart = "composeUrlInvalidSource";
+        QName faultQName;
+
+        public ComposeUrl() {
+            faultQName = new QName(Namespaces.ODE_EXTENSION_NS, faultLocalPart);
+        }
+
+        public ComposeUrl(boolean preserveUndefinedVar, String faultLocalPart) {
+            this.preserveUndefinedVar = preserveUndefinedVar;
+            this.faultLocalPart = faultLocalPart;
+            faultQName = new QName(Namespaces.ODE_EXTENSION_NS, faultLocalPart);
+        }
+
+        public Object evaluate(List args) throws XPathFunctionException {
+            // prepare these 2 arguments 
+            String uriTemplate;
+            Map<String, String> pairs;
+
+            boolean separareParameteters;
+            if (args.size() == 2) {
+                separareParameteters = false;
+            } else if (args.size() > 2 && args.size() % 2 == 1) {
+                separareParameteters = true;
+            } else {
+                throw new XPathFunctionException(new FaultException(faultQName, "Illegal Arguments"));
+            }
+            try {
+                uriTemplate = Helper.extractString(args.get(0));
+            } catch (IllegalArgumentException e) {
+                throw new XPathFunctionException(new FaultException(faultQName, "Invalid argument: URI Template expected. " + args.get(0), e));
+            }
+            if (separareParameteters) {
+                // /!\ Do NOT get the first element
+                try {
+                    pairs = Helper.buildNameValueMap(args, 1);
+                } catch (IllegalArgumentException e) {
+                    throw new XPathFunctionException(new FaultException(faultQName, "Invalid argument", e));
+                }
+            } else {
+                try {
+                    List elmts = (List) args.get(1);
+                    Element elt = (Element) elmts.get(0);
+                    pairs = Helper.extractNameValueMap(elt);
+                } catch (ClassCastException e) {
+                    throw new XPathFunctionException(new FaultException(faultQName, "Expected an element similar too: <foo><name1>value1</name1>name2>value2</name2>...</foo>"));
+                }
+            }
+
+            try {
+                if (preserveUndefinedVar) {
+                    return URITemplate.expandLazily(uriTemplate, pairs);
+                } else {
+                    return URITemplate.expand(uriTemplate, pairs);
+                }
+            } catch (URIException e) {
+                throw new XPathFunctionException(new FaultException(faultQName, "Invalid argument", e));
+            } catch (UnsupportedOperationException e) {
+                throw new XPathFunctionException(new FaultException(faultQName, "Invalid argument", e));
+            }
+        }
+
+    }
+
+    public static class Helper {
+        /**
+         * Extract a string from the given parameter.<br/>
+         * The parameter could be:
+         * <ol>
+         * <li>a {@link java.util.List} containing exactly one {@link org.w3c.dom.Node}</li>
+         * <li>a {@link net.sf.saxon.dom.NodeWrapper}</li>
+         * <li>a {@link org.w3c.dom.Node}</li>
+         * <li>or a {@link String}</li>
+         * </ol>
+         * In the first 3 cases, if the {@linkplain org.w3c.dom.Node node} type is {@link Node#ELEMENT_NODE} the (trimmed) {@linkplain org.w3c.dom.Node#getTextContent() text content} is returned.
+         * if the {@linkplain org.w3c.dom.Node node} type is {@link Node#TEXT_NODE} the (trimmed) {@linkplain org.w3c.dom.Text#getWholeText() text content} is returned.
+         * <p/>
+         *
+         * @param arg
+         * @return a string
+         * @throws IllegalArgumentException if none of the conditions mentioned above are met
+         */
+        public static String extractString(Object arg) throws IllegalArgumentException {
+            // Checking the parameter, should be a proper element or a text node. Java verbosity at its best.
+            String res = null;
+            try {
+                Node node = null;
+                if (arg instanceof List) {
+                    List elmts = (List) arg;
+                    if (elmts.size() != 1)
+                        throw new IllegalArgumentException("Parameter MUST point to a string, single element or text node.");
+                    node = (Node) elmts.get(0);
+                } else if (arg instanceof NodeWrapper) {
+                    node = (Node) ((NodeWrapper) arg).getUnderlyingNode();
+                } else if (arg instanceof Node) {
+                    node = (Node) arg;
+                } else {
+                    res = (String) arg;
+                }
+
+                if (res == null) {
+                    if (Node.ELEMENT_NODE == node.getNodeType()) {
+                        res = node.getTextContent().trim();
+                    } else if (Node.TEXT_NODE == node.getNodeType()) {
+                        res = ((Text) node).getWholeText().trim();
+                    }
+                }
+            } catch (ClassCastException e) {
+                throw new IllegalArgumentException("Parameter MUST point to a string, single element or text node.", e);
+            }
+            return res;
+        }
+
+        /**
+         * Extract the name/value from an xml element similar too:
+         * <br/>
+         * {@literal <elt>
+         * <foovar>bar</foovar>
+         * <myvar>value1</myvar>
+         * </elt>}
+         *
+         * <p/>
+         * The local name of the element is the map key, the text content the associated value.
+         *
+         * @return a Map of name/value pair
+         */
+        public static Map<String, String> extractNameValueMap(Element elt) {
+            Map<String, String> pairs = new HashMap<String, String>();
+
+            for (int i = 0; i < elt.getChildNodes().getLength(); i++) {
+                Node n = elt.getChildNodes().item(i);
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+                    pairs.put(n.getLocalName(), DOMUtils.getTextContent(n));
+                }
+            }
+            return pairs;
+        }
+
+        /**
+         * Same as {@link #buildNameValueMap(java.util.List, int)} but index equals zero. 
+         * @see #buildNameValueMap(java.util.List, int)
+         */
+        public static Map<String, String> buildNameValueMap(List args) {
+            return buildNameValueMap(args, 0);
+        }
+
+        /**
+         * {@linkplain #extractString(Object) Extract a string} from each list element and build a map with them.
+         * <br/>Elements at even indices would be the keys, Elements at odd indices the values.
+         * 
+         * @param args the list containing a serie of name, value, name, value, and so on
+         * @param begin index of the first name to include in the map, (args.size - begin) must be an even number
+         * or an IndexOutOfBoundsException will be thrown 
+         * @return a Map of name/value pairs
+         * @throws IndexOutOfBoundsException
+         * @see #extractString(Object)
+         */
+        public static Map<String, String> buildNameValueMap(List args, int begin) {
+            Map<String, String> pairs;
+            pairs = new HashMap<String, String>();
+            for (int i = begin; i < args.size(); i = i + 2) {
+                pairs.put(Helper.extractString(args.get(i)), Helper.extractString(args.get(i + 1)));
+            }
+            return pairs;
+        }
+    }
+
 }

Added: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/CombineUrlTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/CombineUrlTest.java?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/CombineUrlTest.java (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/CombineUrlTest.java Wed May 21 16:40:35 2008
@@ -0,0 +1,87 @@
+/*
+ * 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.bpel.elang.xpath20.runtime;
+
+import junit.framework.TestCase;
+
+import javax.xml.xpath.XPathFunctionException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
+ */
+public class CombineUrlTest extends TestCase {
+
+    public void testCombineUrl() throws XPathFunctionException {
+        final String baseURL = "http://WebReference.com/html/";
+
+        // key: the relative URL,  value: the expected result
+        Map m = new TreeMap();
+
+        // relative-path references
+        m.put("about.html", "http://WebReference.com/html/about.html");
+        m.put("tutorial1/", "http://WebReference.com/html/tutorial1/");
+        m.put("tutorial1/2.html", "http://WebReference.com/html/tutorial1/2.html");
+        m.put("../", "http://WebReference.com/");
+        m.put("../experts/", "http://WebReference.com/experts/");
+        m.put("./", "http://WebReference.com/html/");
+        m.put("./about.html", "http://WebReference.com/html/about.html");
+
+        // absolute-path references
+        m.put("/", "http://WebReference.com/");
+        m.put("/experts/", "http://WebReference.com/experts/");
+
+        // network-path references
+        m.put("//www.internet.com/", "http://www.internet.com/");
+
+        // absolute urls
+        m.put("http://www.google.com", "http://www.google.com");
+        m.put("file://mybox/dev/null", "file://mybox/dev/null");
+
+        /*
+        m.put("../../../", "http://WebReference.com/");
+        m.put("../../../", "http://WebReference.com/../../");
+
+         This case is considered as an error by rfc2396.
+         but several options are left to the implementation.
+         So the result is implementation specific.
+         see section 5.2, step 6.g
+
+         "Implementations may handle this error
+         by retaining these components in the resolved path (i.e.,
+         treating them as part of the final URI), by removing them from
+         the resolved path (i.e., discarding relative levels above the
+         root), or by avoiding traversal of the reference."
+
+         http://www.ietf.org/rfc/rfc2396.txt
+         */
+
+        final JaxpFunctionResolver.CombineUrl f = new JaxpFunctionResolver.CombineUrl();
+
+        for (Iterator it = m.entrySet().iterator(); it.hasNext();) {
+            Map.Entry e = (Map.Entry) it.next();
+            assertEquals(e.getValue(), f.evaluate(Arrays.asList(baseURL, e.getKey())));
+        }
+    }
+
+}

Added: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/FunctionHelperTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/FunctionHelperTest.java?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/FunctionHelperTest.java (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/FunctionHelperTest.java Wed May 21 16:40:35 2008
@@ -0,0 +1,63 @@
+/*
+ * 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.bpel.elang.xpath20.runtime;
+
+import junit.framework.TestCase;
+import net.sf.saxon.Configuration;
+import net.sf.saxon.dom.DocumentWrapper;
+import net.sf.saxon.dom.NodeWrapper;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Text;
+
+import javax.xml.xpath.XPathFunctionException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
+ */
+public class FunctionHelperTest extends TestCase {
+
+    public void testExtractString() throws XPathFunctionException {
+        List inputs = new ArrayList();
+        final String data = " a dummy text with leading and trailing whitespaces ";
+
+        // if a raw string is passed, the result must not be trimmed
+        assertEquals(data, JaxpFunctionResolver.Helper.extractString(data));
+
+        // else, the result mut be trimmed
+        final String expectedResult = data.trim();
+        Document doc = DOMUtils.newDocument();
+        Text textNode = doc.createTextNode(data);
+        inputs.add(textNode);
+        inputs.add(Arrays.asList(textNode));
+
+        DocumentWrapper dw = new DocumentWrapper(doc, "", new Configuration());
+        NodeWrapper nw = dw.wrap(textNode);
+        inputs.add(nw);
+
+        for (int i = 0; i < inputs.size(); i++) {
+            assertEquals(expectedResult, JaxpFunctionResolver.Helper.extractString(inputs.get(i)));
+        }
+    }
+
+}

Modified: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java?rev=658934&r1=658933&r2=658934&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Test.java Wed May 21 16:40:35 2008
@@ -21,7 +21,15 @@
 import org.junit.Test;
 
 public class DataHandling20Test extends BPELTestAbstract {
-
+    @Test public void testComposeUrl() throws Throwable {
+        go("/bpel/2.0/TestComposeUrl");
+    }
+    @Test public void testCombineUrl() throws Throwable {
+        go("/bpel/2.0/TestCombineUrl");
+    }
+    @Test public void testExpandTemplate() throws Throwable {
+        go("/bpel/2.0/TestExpandTemplate");
+    }
     @Test public void testXPathNamespace1() throws Throwable {
         go("/bpel/2.0/TestXPathNamespace1");
     }
@@ -64,5 +72,4 @@
     @Test public void testDuration() throws Throwable {
         go("/bpel/2.0/TestDuration");
     }
-
 }

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.bpel?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.bpel (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.bpel Wed May 21 16:40:35 2008
@@ -0,0 +1,64 @@
+<!--
+  ~ 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="TestCombineUrl"
+         targetNamespace="http://ode/bpel/unit-test"
+         xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/unit-test"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:ode="http://www.apache.org/ode/type/extension"
+         xmlns:test="http://ode/bpel/unit-test.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="TestCombineUrl.wsdl"
+            namespace="http://ode/bpel/unit-test.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/"/>
+
+    <partnerLinks>
+        <partnerLink name="testCombineUrlPartnerLink"
+                     partnerLinkType="test:TestCombineUrlPartnerLinkType"
+                     myRole="me"/>
+    </partnerLinks>
+
+    <variables>
+        <variable name="myVar" messageType="test:TestCombineUrlMessage"/>
+    </variables>
+
+    <sequence>
+        <receive name="start" partnerLink="testCombineUrlPartnerLink" portType="test:TestCombineUrlPortType"
+                 operation="combineUrl" variable="myVar" createInstance="yes"/>
+
+        <assign name="assign1">
+            <!-- the combined would be in the base part -->
+            <copy>
+                <from>ode:combineUrl($myVar.base, $myVar.relative)</from>
+                <to variable="myVar" part="base"/>
+            </copy>
+            <!-- reset the relative part to avoid confusion-->
+            <copy>
+                <from>""</from>
+                <to variable="myVar" part="relative"/>
+            </copy>
+        </assign>
+        <reply name="end" partnerLink="testCombineUrlPartnerLink" portType="test:TestCombineUrlPortType"
+               operation="combineUrl" variable="myVar"/>
+    </sequence>
+</process>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.wsdl
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.wsdl?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.wsdl (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/TestCombineUrl.wsdl Wed May 21 16:40:35 2008
@@ -0,0 +1,70 @@
+<?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://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:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+    
+    <wsdl:message name="TestCombineUrlMessage">
+        <wsdl:part name="base" type="xsd:string"/>
+        <wsdl:part name="relative" type="xsd:string"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="TestCombineUrlPortType">
+        <wsdl:operation name="combineUrl">
+            <wsdl:input message="tns:TestCombineUrlMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestCombineUrlMessage" name="TestOut"/>
+        </wsdl:operation>    
+    </wsdl:portType>
+    
+     <wsdl:binding name="TestCombineUrlSoapBinding" type="tns:TestCombineUrlPortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="combineUrl">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl"
+                    use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl" 
+                    use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestCombineUrlService">
+		<wsdl:port name="TestCombineUrlPort" binding="tns:TestCombineUrlSoapBinding">
+     		<soap:address location="http://localhost:8080/ode/processes/testCombineUrl"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="TestCombineUrlPartnerLinkType">
+       <plnk:role name="me" portType="tns:TestCombineUrlPortType"/>
+       <plnk:role name="you" portType="tns:TestCombineUrlPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
+

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/deploy.xml
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/deploy.xml?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/deploy.xml (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/deploy.xml Wed May 21 16:40:35 2008
@@ -0,0 +1,30 @@
+<!--
+  ~ 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:pns="http://ode/bpel/unit-test" 
+	xmlns:wns="http://ode/bpel/unit-test.wsdl">
+
+
+	<process name="pns:TestCombineUrl">
+		<active>true</active>
+		<provide partnerLink="testCombineUrlPartnerLink">
+			<service name="wns:TestCombineUrlService" port="TestCombineUrlPort"/>
+		</provide>
+	</process>
+</deploy>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/test.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/test.properties?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/test.properties (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestCombineUrl/test.properties Wed May 21 16:40:35 2008
@@ -0,0 +1,23 @@
+#
+#    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.
+#
+
+namespace=http://ode/bpel/unit-test.wsdl
+service=TestCombineUrlService
+operation=combineUrl
+request1=<message><base>http://example.com/html/about.html</base><relative>../experts/</relative></message>
+response1=.*<base>http://example.com/experts/</base>.*
+

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.bpel?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.bpel (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.bpel Wed May 21 16:40:35 2008
@@ -0,0 +1,73 @@
+<!--
+  ~ 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="TestComposeUrl"
+         targetNamespace="http://ode/bpel/unit-test"
+         xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/unit-test"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:ode="http://www.apache.org/ode/type/extension"
+         xmlns:test="http://ode/bpel/unit-test.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="TestComposeUrl.wsdl"
+            namespace="http://ode/bpel/unit-test.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/"/>
+
+    <partnerLinks>
+        <partnerLink name="testComposeUrlPartnerLink"
+                     partnerLinkType="test:TestComposeUrlPartnerLinkType"
+                     myRole="me"/>
+    </partnerLinks>
+
+    <variables>
+        <variable name="myVar" messageType="test:TestComposeUrlMessage"/>
+    </variables>
+
+
+    <sequence>
+        <receive name="start1" partnerLink="testComposeUrlPartnerLink" portType="test:TestComposeUrlPortType"
+                 operation="composeUrl" variable="myVar" createInstance="yes"/>
+
+        <!-- the composed url would be sent back in the template part -->
+
+        <if>
+            <condition>count($myVar.pairs/tag) = 0</condition>
+            <assign>
+                <copy>
+                    <from>ode:composeUrl($myVar.template, $myVar.name, $myVar.value)</from>
+                    <to variable="myVar" part="template"/>
+                </copy>
+            </assign>
+            <else>
+                <assign>
+                    <copy>
+                        <from>ode:composeUrl($myVar.template, $myVar.pairs)</from>
+                        <to variable="myVar" part="template"/>
+                    </copy>
+                </assign>
+            </else>
+        </if>
+
+        <reply name="end1" partnerLink="testComposeUrlPartnerLink" portType="test:TestComposeUrlPortType"
+               operation="composeUrl" variable="myVar"/>
+    </sequence>
+</process>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.wsdl
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.wsdl?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.wsdl (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/TestComposeUrl.wsdl Wed May 21 16:40:35 2008
@@ -0,0 +1,84 @@
+<?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://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:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+    <wsdl:types>
+        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ode/bpel/unit-test.wsdl">
+            <xsd:complexType name="pairsType">
+                <xsd:sequence>
+                    <xsd:element name="user" type="xsd:string"/>
+                    <xsd:element name="tag" type="xsd:string"/>
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </wsdl:types>
+
+    
+    <wsdl:message name="TestComposeUrlMessage">
+        <wsdl:part name="template" type="xsd:string"/>
+        <wsdl:part name="name" type="xsd:string"/>
+        <wsdl:part name="value" type="xsd:string"/>
+        <wsdl:part name="pairs" type="tns:pairsType"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="TestComposeUrlPortType">
+        <wsdl:operation name="composeUrl">
+            <wsdl:input message="tns:TestComposeUrlMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestComposeUrlMessage" name="TestOut"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    
+     <wsdl:binding name="TestComposeUrlSoapBinding" type="tns:TestComposeUrlPortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="composeUrl">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl"
+                    use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl" 
+                    use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestComposeUrlService">
+		<wsdl:port name="TestComposeUrlPort" binding="tns:TestComposeUrlSoapBinding">
+     		<soap:address location="http://localhost:8080/ode/processes/testComposeUrl"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="TestComposeUrlPartnerLinkType">
+       <plnk:role name="me" portType="tns:TestComposeUrlPortType"/>
+       <plnk:role name="you" portType="tns:TestComposeUrlPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
+

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/deploy.xml
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/deploy.xml?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/deploy.xml (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/deploy.xml Wed May 21 16:40:35 2008
@@ -0,0 +1,30 @@
+<!--
+  ~ 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:pns="http://ode/bpel/unit-test" 
+	xmlns:wns="http://ode/bpel/unit-test.wsdl">
+
+
+	<process name="pns:TestComposeUrl">
+		<active>true</active>
+		<provide partnerLink="testComposeUrlPartnerLink">
+			<service name="wns:TestComposeUrlService" port="TestComposeUrlPort"/>
+		</provide>
+	</process>
+</deploy>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/test.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/test.properties?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/test.properties (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestComposeUrl/test.properties Wed May 21 16:40:35 2008
@@ -0,0 +1,26 @@
+#
+#    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.
+#
+
+namespace=http://ode/bpel/unit-test.wsdl
+service=TestComposeUrlService
+operation=composeUrl
+# this test will use composeUrl with the element argument
+request1=<message><template>http://example.com/{user}/{tag}/{a_missing_var}</template><name/><value/><pairs><user>bill</user><tag>ruby</tag></pairs></message>
+response1=.*<template>http://example.com/bill/ruby/</template>.*
+# this test will use composeUrl with a list of name, value, name, value, etc
+request2=<message><template>http://example.com/{user}/{a_missing_var}</template><name>user</name><value>bill</value><pairs/></message>
+response2=.*<template>http://example.com/bill/</template>.*

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.bpel?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.bpel (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.bpel Wed May 21 16:40:35 2008
@@ -0,0 +1,73 @@
+<!--
+  ~ 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="TestExpandTemplate"
+         targetNamespace="http://ode/bpel/unit-test"
+         xmlns:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/unit-test"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:ode="http://www.apache.org/ode/type/extension"
+         xmlns:test="http://ode/bpel/unit-test.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="TestExpandTemplate.wsdl"
+            namespace="http://ode/bpel/unit-test.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/"/>
+
+    <partnerLinks>
+        <partnerLink name="testExpandTemplatePartnerLink"
+                     partnerLinkType="test:TestExpandTemplatePartnerLinkType"
+                     myRole="me"/>
+    </partnerLinks>
+
+    <variables>
+        <variable name="myVar" messageType="test:TestExpandTemplateMessage"/>
+    </variables>
+
+
+    <sequence>
+        <receive name="start1" partnerLink="testExpandTemplatePartnerLink" portType="test:TestExpandTemplatePortType"
+                 operation="expandTemplate" variable="myVar" createInstance="yes"/>
+
+        <!-- the expanded template would be sent back in the template part -->
+
+        <if>
+            <condition>count($myVar.pairs/tag) = 0</condition>
+            <assign>
+                <copy>
+                    <from>ode:expandTemplate($myVar.template, $myVar.name, $myVar.value)</from>
+                    <to variable="myVar" part="template"/>
+                </copy>
+            </assign>
+            <else>
+                <assign>
+                    <copy>
+                        <from>ode:expandTemplate($myVar.template, $myVar.pairs)</from>
+                        <to variable="myVar" part="template"/>
+                    </copy>
+                </assign>
+            </else>
+        </if>
+
+        <reply name="end1" partnerLink="testExpandTemplatePartnerLink" portType="test:TestExpandTemplatePortType"
+               operation="expandTemplate" variable="myVar"/>
+    </sequence>
+</process>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.wsdl
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.wsdl?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.wsdl (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/TestExpandTemplate.wsdl Wed May 21 16:40:35 2008
@@ -0,0 +1,84 @@
+<?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://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:bpws="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+    <wsdl:types>
+        <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ode/bpel/unit-test.wsdl">
+            <xsd:complexType name="pairsType">
+                <xsd:sequence>
+                    <xsd:element name="user" type="xsd:string"/>
+                    <xsd:element name="tag" type="xsd:string"/>
+                </xsd:sequence>
+            </xsd:complexType>
+        </xsd:schema>
+    </wsdl:types>
+
+    
+    <wsdl:message name="TestExpandTemplateMessage">
+        <wsdl:part name="template" type="xsd:string"/>
+        <wsdl:part name="name" type="xsd:string"/>
+        <wsdl:part name="value" type="xsd:string"/>
+        <wsdl:part name="pairs" type="tns:pairsType"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="TestExpandTemplatePortType">
+        <wsdl:operation name="expandTemplate">
+            <wsdl:input message="tns:TestExpandTemplateMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestExpandTemplateMessage" name="TestOut"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    
+     <wsdl:binding name="TestExpandTemplateSoapBinding" type="tns:TestExpandTemplatePortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="expandTemplate">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl"
+                    use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body
+                    namespace="http://ode/bpel/unit-test.wsdl" 
+                    use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestExpandTemplateService">
+		<wsdl:port name="TestExpandTemplatePort" binding="tns:TestExpandTemplateSoapBinding">
+     		<soap:address location="http://localhost:8080/ode/processes/testExpandTemplate"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="TestExpandTemplatePartnerLinkType">
+       <plnk:role name="me" portType="tns:TestExpandTemplatePortType"/>
+       <plnk:role name="you" portType="tns:TestExpandTemplatePortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
+

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/deploy.xml
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/deploy.xml?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/deploy.xml (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/deploy.xml Wed May 21 16:40:35 2008
@@ -0,0 +1,30 @@
+<!--
+  ~ 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:pns="http://ode/bpel/unit-test" 
+	xmlns:wns="http://ode/bpel/unit-test.wsdl">
+
+
+	<process name="pns:TestExpandTemplate">
+		<active>true</active>
+		<provide partnerLink="testExpandTemplatePartnerLink">
+			<service name="wns:TestExpandTemplateService" port="TestExpandTemplatePort"/>
+		</provide>
+	</process>
+</deploy>

Added: ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/test.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/test.properties?rev=658934&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/test.properties (added)
+++ ode/branches/APACHE_ODE_1.1/bpel-test/src/test/resources/bpel/2.0/TestExpandTemplate/test.properties Wed May 21 16:40:35 2008
@@ -0,0 +1,26 @@
+#
+#    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.
+#
+
+namespace=http://ode/bpel/unit-test.wsdl
+service=TestExpandTemplateService
+operation=expandTemplate
+# this test will use expandTemplate with the element argument
+request1=<message><template>http://example.com/{user}/{tag}/{a_missing_var}/{another_missing_var=but_with_a_default}</template><name/><value/><pairs><user>bill</user><tag>ruby</tag></pairs></message>
+response1=.*<template>http://example.com/bill/ruby/\\{a_missing_var\\}/but_with_a_default</template>.*
+# this test will use expandTemplate with a list of name, value, name, value, etc
+request2=<message><template>http://example.com/{user}/{a_missing_var}/{another_missing_var=but_with_a_default}</template><name>user</name><value>bill</value><pairs/></message>
+response2=.*<template>http://example.com/bill/\\{a_missing_var\\}/but_with_a_default</template>.*