You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/10/06 13:05:34 UTC

svn commit: r1394998 - in /axis/axis1/java/trunk/interop-mock/src/main: java/org/apache/axis/test/interop/mock/ resources/w3c/ resources/w3c/variants/ resources/whitemesa/ webapp/WEB-INF/

Author: veithen
Date: Sat Oct  6 11:05:32 2012
New Revision: 1394998

URL: http://svn.apache.org/viewvc?rev=1394998&view=rev
Log:
Enhanced the interop mock. It is slowly converging towards a solution that enables us to run the WhiteMesaSoap12AddTestSvcTestCase again.

Added:
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java   (with props)
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java   (with props)
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java   (with props)
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt   (with props)
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-13.xml
      - copied, changed from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-request.xml
      - copied, changed from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-response.xml
      - copied, changed from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-request.xml
      - copied, changed from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-response.xml
      - copied, changed from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml   (with props)
Removed:
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml
Modified:
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Exchange.java
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java
    axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/README.txt
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml
    axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml

Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Exchange.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Exchange.java?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Exchange.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Exchange.java Sat Oct  6 11:05:32 2012
@@ -20,18 +20,48 @@ package org.apache.axis.test.interop.moc
 
 import javax.el.ELContext;
 import javax.el.ExpressionFactory;
+import javax.xml.XMLConstants;
+import javax.xml.namespace.QName;
 
 import org.apache.commons.lang.ObjectUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.core.io.Resource;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.w3c.dom.Text;
 
+/**
+ * Describes a request-response message exchange supported by a {@link MockPostHandler}. An instance
+ * of this class matches a given request against an expected request (specified by a
+ * {@link Resource}), and if the request matches, returns a configurable response (specified by
+ * another {@link Resource}). The configured request and response messages can contain simple
+ * template constructs. During request matching, these templates are used to infer variable values,
+ * and these variables can then be substituted in the response. The following template constructs
+ * are supported:
+ * <ol>
+ * <li><code>${<i>expression</i>}</code> appearing in text nodes. In a request message, the
+ * expression must be a simple variable expression (e.g. <code>${myInputParameter}</code>). During
+ * request matching, the value of the variable will be set to the content of the text node in the
+ * actual request. In a response message, the expression can be any EL expression as defined by the
+ * <code>javax.el</code> API.
+ * <li>Element templates in the form
+ * <code>&lt;t:element t:name="${var}" xmlns:t="http://axis.apache.org/mock/template">...&lt;/t:element></code>.
+ * In a request message this template matches any element, and the {@link QName} of that element
+ * is assigned to the variable specified by the <tt>t:name</tt> attribute. In a response message the
+ * template element will be substituted by an element with the given name. Note that the template
+ * element may have children as well as additional attributes (not in the
+ * <tt>http://axis.apache.org/mock/template</tt> namespace). They are matched/copied as any other
+ * node.
+ * </ol>
+ */
 public class Exchange implements InitializingBean {
+    private static final String MOCK_NS = "http://axis.apache.org/mock/template";
+    
     private static final Log log = LogFactory.getLog(Exchange.class);
     
     private Resource request;
@@ -105,30 +135,87 @@ public class Exchange implements Initial
         return buffer.toString();
     }
     
-    private boolean matchName(String expected, String actual) {
-        if ("__any__".equals(expected)) {
-            return true;
-        } else {
-            return ObjectUtils.equals(expected, actual);
+    private String getLocation(Attr attr) {
+        StringBuilder buffer = new StringBuilder();
+        getLocation(buffer, attr.getOwnerElement());
+        buffer.append("/@");
+        String prefix = attr.getPrefix();
+        if (prefix != null) {
+            buffer.append(prefix);
+            buffer.append(':');
         }
+        buffer.append(attr.getLocalName());
+        return buffer.toString();
     }
     
     private boolean match(Element expected, Element actual, Variables inferredVariables) {
-        // Compare local name and namespace URI
-        if (!matchName(expected.getLocalName(), actual.getLocalName())) {
-            if (log.isDebugEnabled()) {
-                log.debug("Local name mismatch: expected=" + expected.getLocalName() + "; actual=" + actual.getLocalName());
-            }
-            return false;
-        }
-        if (!matchName(expected.getNamespaceURI(), actual.getNamespaceURI())) {
-            if (log.isDebugEnabled()) {
-                log.debug("Namespace mismatch: expected=" + expected.getNamespaceURI() + "; actual=" + actual.getNamespaceURI());
+        String namespaceURI = expected.getNamespaceURI();
+        String localName = expected.getLocalName();
+        // Check if the element in the actual request is a template construct
+        if (MOCK_NS.equals(namespaceURI)) {
+            if (localName.equals("element")) {
+                inferredVariables.bind(checkVariable(expected.getAttributeNS(MOCK_NS, "name")),
+                        QName.class, new QName(actual.getNamespaceURI(), actual.getLocalName()));
+            } else {
+                log.error("Unexpected template element " + localName);
+                return false;
+            }
+        } else {
+            // Compare local name and namespace URI
+            if (!ObjectUtils.equals(localName, actual.getLocalName())) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Local name mismatch: expected=" + expected.getLocalName() + "; actual=" + actual.getLocalName());
+                }
+                return false;
+            }
+            if (!ObjectUtils.equals(namespaceURI, actual.getNamespaceURI())) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Namespace mismatch: expected=" + expected.getNamespaceURI() + "; actual=" + actual.getNamespaceURI());
+                }
+                return false;
             }
-            return false;
         }
         
-        // TODO: compare attributes first
+        // Compare attributes
+        NamedNodeMap expectedAttributes = expected.getAttributes();
+        NamedNodeMap actualAttributes = actual.getAttributes();
+        // Check that all expected attributes are present and have matching values
+        for (int i=0; i<expectedAttributes.getLength(); i++) {
+            Attr expectedAttribute = (Attr)expectedAttributes.item(i);
+            String attrNamespaceURI = expectedAttribute.getNamespaceURI();
+            // Ignore namespace declarations and attributes used in template constructs
+            if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(attrNamespaceURI)
+                    && !MOCK_NS.equals(attrNamespaceURI)) {
+                Attr actualAttribute = (Attr)actualAttributes.getNamedItemNS(attrNamespaceURI, expectedAttribute.getLocalName());
+                if (actualAttribute == null) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Attribute " + getLocation(expectedAttribute) + " not found in actual request");
+                    }
+                    return false;
+                }
+                if (!actualAttribute.getValue().equals(expectedAttribute.getValue())) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("Attribute value mismatch at " + getLocation(expectedAttribute)
+                                + ": expected=" + expectedAttribute.getValue()
+                                + "; actual=" + actualAttribute.getValue());
+                    }
+                    return false;
+                }
+            }
+        }
+        // Check that there are no unexpected attributes
+        for (int i=0; i<actualAttributes.getLength(); i++) {
+            Attr actualAttribute = (Attr)actualAttributes.item(i);
+            String attrNamespaceURI = actualAttribute.getNamespaceURI();
+            if (!XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(attrNamespaceURI) &&
+                    expectedAttributes.getNamedItemNS(attrNamespaceURI, actualAttribute.getLocalName()) == null) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Unexpected attribute at " + getLocation(expected) + ": uri=" + actualAttribute.getNamespaceURI()
+                            + "; name=" + actualAttribute.getLocalName());
+                }
+                return false;
+            }
+        }
         
         // Compare children
         NodeList expectedChildren = expected.getChildNodes();
@@ -182,10 +269,7 @@ public class Exchange implements Initial
         String actualContent = actual == null ? "" : actual.getData();
         String varName = checkVariable(expectedContent);
         if (varName != null) {
-            if (log.isDebugEnabled()) {
-                log.debug("Inferred variable: " + varName + "=" + actualContent);
-            }
-            inferredVariables.bind(varName, actualContent);
+            inferredVariables.bind(varName, String.class, actualContent);
             return true;
         } else {
             if (expectedContent.equals(actualContent)) {

Added: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java?rev=1394998&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java Sat Oct  6 11:05:32 2012
@@ -0,0 +1,25 @@
+/*
+ * 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.axis.test.interop.mock;
+
+import org.w3c.dom.Element;
+
+public interface MessageProcessor {
+    void process(Element message);
+}

Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MessageProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockPostHandler.java Sat Oct  6 11:05:32 2012
@@ -48,9 +48,14 @@ import org.xml.sax.SAXException;
 public class MockPostHandler implements HttpRequestHandler, InitializingBean {
     private static final Log log = LogFactory.getLog(MockPostHandler.class);
     
+    private List<MessageProcessor> requestProcessors;
     private List<Exchange> exchanges;
     private Set<String> supportedContentTypes;
     
+    public void setRequestProcessors(List<MessageProcessor> requestProcessors) {
+        this.requestProcessors = requestProcessors;
+    }
+
     public void setExchanges(List<Exchange> exchanges) {
         this.exchanges = exchanges;
     }
@@ -98,10 +103,19 @@ public class MockPostHandler implements 
                 log.debug("Setting charset from request entity: " + charset);
             }
         }
+        Element request = requestDocument.getDocumentElement();
+        if (requestProcessors != null) {
+            for (MessageProcessor processor : requestProcessors) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Executing message processor " + processor);
+                }
+                processor.process(request);
+            }
+        }
         Element responseMessage = null;
         for (Exchange exchange : exchanges) {
             if (exchange.getRequestContentType().equals(requestBaseContentType)) {
-                responseMessage = exchange.matchRequest(requestDocument.getDocumentElement());
+                responseMessage = exchange.matchRequest(request);
                 if (responseMessage != null) {
                     break;
                 }

Added: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java?rev=1394998&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java Sat Oct  6 11:05:32 2012
@@ -0,0 +1,76 @@
+/*
+ * 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.axis.test.interop.mock;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class MustUnderstandNormalizer implements MessageProcessor {
+    private static final Log log = LogFactory.getLog(MustUnderstandNormalizer.class);
+    
+    public void process(Element message) {
+        if (SOAPConstants.SOAP12_ENV_NAMESPACE.equals(message.getNamespaceURI())
+                && message.getLocalName().equals("Envelope")) {
+            log.debug("Found SOAP 1.2 envelope");
+            NodeList children = message.getChildNodes();
+            for (int i=0, l=children.getLength(); i<l; i++) {
+                Node child = children.item(i);
+                if (child instanceof Element) {
+                    Element childElement = (Element)child;
+                    if (SOAPConstants.SOAP12_ENV_NAMESPACE.equals(childElement.getNamespaceURI())
+                            && childElement.getLocalName().equals("Header")) {
+                        processSOAPHeader(childElement);
+                        break;
+                    }
+                }
+            }
+        }
+    }
+    
+    private void processSOAPHeader(Element header) {
+        NodeList children = header.getChildNodes();
+        for (int i=0, l=children.getLength(); i<l; i++) {
+            Node child = children.item(i);
+            if (child instanceof Element) {
+                processHeaderElement((Element)child);
+            }
+        }
+    }
+    
+    private void processHeaderElement(Element header) {
+        if (log.isDebugEnabled()) {
+            log.debug("Found header: uri=" + header.getNamespaceURI() + "; name=" + header.getLocalName());
+        }
+        Attr muAttr = header.getAttributeNodeNS(SOAPConstants.SOAP12_ENV_NAMESPACE, "mustUnderstand");
+        if (muAttr != null) {
+            String value = muAttr.getValue();
+            if (value.equals("0") || value.equals("false")) {
+                log.debug("Removing unnecessary mustUnderstand attribute");
+                header.removeAttributeNode(muAttr);
+            } else if (value.equals("true")) {
+                log.debug("Normalizing mustUnderstand attribute value");
+                muAttr.setValue("1");
+            }
+        }
+    }
+}

Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MustUnderstandNormalizer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java?rev=1394998&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java Sat Oct  6 11:05:32 2012
@@ -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.
+ */
+package org.apache.axis.test.interop.mock;
+
+public final class SOAPConstants {
+    private SOAPConstants() {}
+    
+    public static final String SOAP11_ENV_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
+    public static final String SOAP12_ENV_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
+}

Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java Sat Oct  6 11:05:32 2012
@@ -25,9 +25,9 @@ public final class SOAPUtil {
     
     public static String getContentType(Element envelope) {
         String namespaceURI = envelope.getNamespaceURI();
-        if ("http://www.w3.org/2003/05/soap-envelope".equals(namespaceURI)) {
+        if (SOAPConstants.SOAP12_ENV_NAMESPACE.equals(namespaceURI)) {
             return "application/soap+xml";
-        } else if ("http://schemas.xmlsoap.org/soap/envelope/".equals(namespaceURI)) {
+        } else if (SOAPConstants.SOAP11_ENV_NAMESPACE.equals(namespaceURI)) {
             return "text/xml";
         } else {
             return null;

Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java Sat Oct  6 11:05:32 2012
@@ -24,15 +24,17 @@ import javax.el.ValueExpression;
 
 import org.apache.commons.lang.ObjectUtils;
 
-public final class ValueExpressionLiteral extends ValueExpression {
+public final class ValueExpressionLiteral<T> extends ValueExpression {
     private static final long serialVersionUID = -3847213439349942695L;
     
-    private String value;
+    private final Class<T> clazz;
+    private final T value;
 
-    public ValueExpressionLiteral(String value) {
-        if (value == null) {
+    public ValueExpressionLiteral(Class<T> clazz, T value) {
+        if (clazz == null || value == null) {
             throw new IllegalArgumentException();
         }
+        this.clazz = clazz;
         this.value = value;
     }
 
@@ -49,22 +51,22 @@ public final class ValueExpressionLitera
     }
    
     public Class<?> getType(ELContext context) {
-        return String.class;
+        return clazz;
     }
 
     public Class<?> getExpectedType() {
-        return String.class;
+        return clazz;
     }
 
     public String getExpressionString() {
-        return value;
+        throw new UnsupportedOperationException();
     }
 
     public boolean equals(Object obj) {
-        return (obj instanceof ValueExpressionLiteral && equals((ValueExpressionLiteral)obj));
+        return (obj instanceof ValueExpressionLiteral && equals((ValueExpressionLiteral<?>)obj));
     }
 
-    public boolean equals(ValueExpressionLiteral ve) {
+    public boolean equals(ValueExpressionLiteral<?> ve) {
         return ve != null && ObjectUtils.equals(value, ve.value);
     }
     

Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java Sat Oct  6 11:05:32 2012
@@ -24,11 +24,19 @@ import java.util.Map;
 import javax.el.ValueExpression;
 import javax.el.VariableMapper;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 public class Variables extends VariableMapper {
+    private static final Log log = LogFactory.getLog(Variables.class);
+    
     private final Map<String,ValueExpression> variables =  new HashMap<String,ValueExpression>();
     
-    public void bind(String name, String value) {
-        variables.put(name, new ValueExpressionLiteral(value));
+    public <T> void bind(String name, Class<T> clazz, T value) {
+        if (log.isDebugEnabled()) {
+            log.debug("Binding variable: " + name + "=" + value);
+        }
+        variables.put(name, new ValueExpressionLiteral<T>(clazz, value));
     }
       
     public ValueExpression resolveVariable(String name) {

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/README.txt
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/README.txt?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/README.txt (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/README.txt Sat Oct  6 11:05:32 2012
@@ -8,10 +8,8 @@ with corrections for the following mista
     in the description the parameter is called inputInteger (see XMLP-4).
   * The response shown in XMLP-9 has a typo (</env:value> instead of </env:Value>).
   * The response shown in XMLP-14 has a typo (<inputString> instead of </inputString>).
-  * The request shown in XMLP-15 has a typo (<inputString> instead of </inputString>).
 
 In addition, the following changes have been made:
 
-  * Request values echoed in responses (or that are irrelevant) have been replaced by template
-    variables.
-  * Local names and namespaces that are irrelevant have been replaced by wildcards (__any__).
\ No newline at end of file
+  * Request values (and element names) echoed in responses (or that are irrelevant) have been
+    replaced by template variables.

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml Sat Oct  6 11:05:32 2012
@@ -1,9 +1,9 @@
 <?xml version="1.0" ?>
 <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Header>
-    <h:__any__ xmlns:h="__any__"
+    <t:element xmlns:t="http://axis.apache.org/mock/template" t:name="${headerName}"
          env:mustUnderstand="1"
-         env:role="http://www.w3.org/2003/05/soap-envelope/role/next">${content}</h:__any__>
+         env:role="http://www.w3.org/2003/05/soap-envelope/role/next">${content}</t:element>
   </env:Header>
   <env:Body>
     <sb:echoVoid xmlns:sb="http://soapinterop.org/"

Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml Sat Oct  6 11:05:32 2012
@@ -3,8 +3,8 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Body>
-    <sb:unknownFreakyMethod xmlns:sb="http://soapinterop.org/">
-      <inputInteger>${inputInteger}</inputInteger>
+    <sb:unknownFreakyMethod xmlns:sb="http://soapinterop.org/" env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+      <inputInteger xsi:type="xsd:int">${inputInteger}</inputInteger>
     </sb:unknownFreakyMethod>
   </env:Body>
 </env:Envelope>

Added: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt?rev=1394998&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt Sat Oct  6 11:05:32 2012
@@ -0,0 +1,5 @@
+The request/response messages in this folder have been designed to make the
+WhiteMesaSoap12AddTestSvcTestCase in Axis 1.4 pass (the original endpoint at
+www.whitemesa.net is no longer available). Note that they are not compatible with the messages
+specified in http://www.w3.org/TR/2007/REC-soap12-testcollection-20070427/ because the
+whitemesa endpoint used doc/lit, while the W3C messages use rpc/encoded.
\ No newline at end of file

Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-13.xml (from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-13.xml?p2=axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-13.xml&p1=axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml&r1=1394241&r2=1394998&rev=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-13.xml Sat Oct  6 11:05:32 2012
@@ -3,8 +3,7 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Body>
-    <sb:echoString xmlns:sb="http://soapinterop.org/"
-        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+    <sb:echoString xmlns:sb="http://soapinterop.org/">
       <inputString xsi:type="xsd:string">${inputString}</inputString>
     </sb:echoString>
   </env:Body>

Copied: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-request.xml (from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-request.xml?p2=axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-request.xml&p1=axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml&r1=1394241&r2=1394998&rev=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-request.xml Sat Oct  6 11:05:32 2012
@@ -3,8 +3,7 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Body>
-    <sb:echoString xmlns:sb="http://soapinterop.org/"
-        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+    <sb:echoString xmlns:sb="http://soapinterop.org/">
       <inputString xsi:type="xsd:string">${inputString}</inputString>
     </sb:echoString>
   </env:Body>

Copied: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-response.xml (from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-response.xml?p2=axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-response.xml&p1=axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml&r1=1394241&r2=1394998&rev=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-14-response.xml Sat Oct  6 11:05:32 2012
@@ -3,8 +3,7 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Body>
-    <sb:echoString xmlns:sb="http://soapinterop.org/"
-        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+    <sb:echoString xmlns:sb="http://soapinterop.org/">
       <inputString xsi:type="xsd:string">${fn:toUpperCase(inputString)}</inputString>
     </sb:echoString>
   </env:Body>

Copied: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-request.xml (from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-request.xml?p2=axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-request.xml&p1=axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml&r1=1394241&r2=1394998&rev=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-request.xml Sat Oct  6 11:05:32 2012
@@ -3,12 +3,10 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Header>
-    <sb:__any__ env:role="http://www.w3.org/2003/05/soap-envelope/role/next" 
-                xmlns:sb="__any__">${headerContent}</sb:__any__>
+    <ns:unknown xmlns:ns="http://test-xmlp-15" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" xsi:type="xsd:string">${headerContent}</ns:unknown>
   </env:Header>
   <env:Body>
-    <sb:echoString xmlns:sb="http://soapinterop.org/"
-        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+    <sb:echoString xmlns:sb="http://soapinterop.org/">
       <inputString xsi:type="xsd:string">${inputString}</inputString>
     </sb:echoString>
   </env:Body>

Copied: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-response.xml (from r1394241, axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml)
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-response.xml?p2=axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-response.xml&p1=axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml&r1=1394241&r2=1394998&rev=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-15-response.xml Sat Oct  6 11:05:32 2012
@@ -3,8 +3,7 @@
               xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <env:Body>
-    <sb:echoString xmlns:sb="http://soapinterop.org/"
-        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+    <sb:echoString xmlns:sb="http://soapinterop.org/">
       <inputString xsi:type="xsd:string">${inputString}</inputString>
     </sb:echoString>
   </env:Body>

Added: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml?rev=1394998&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml Sat Oct  6 11:05:32 2012
@@ -0,0 +1,14 @@
+<?xml version="1.0" ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" 
+              xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <env:Header>
+    <ns:unknown xmlns:ns="http://test-xmlp-16" env:role="http://www.w3.org/2003/05/soap-envelope/role/none" xsi:type="xsd:string">${headerContent}</ns:unknown>
+  </env:Header>
+  <env:Body>
+    <sb:echoString xmlns:sb="http://soapinterop.org/"
+        env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+      <inputString xsi:type="xsd:string">${inputString}</inputString>
+    </sb:echoString>
+  </env:Body>
+</env:Envelope>

Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/whitemesa/XMLP-16.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml?rev=1394998&r1=1394997&r2=1394998&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml Sat Oct  6 11:05:32 2012
@@ -25,6 +25,11 @@
     <!-- Endpoints that mock http://www.whitemesa.net -->
     
     <bean name="/soap12/add-test-rpc" class="org.apache.axis.test.interop.mock.MockPostHandler">
+        <property name="requestProcessors">
+            <list>
+                <bean class="org.apache.axis.test.interop.mock.MustUnderstandNormalizer"/>
+            </list>
+        </property>
         <property name="exchanges">
             <list>
                 <bean class="org.apache.axis.test.interop.mock.Exchange">
@@ -87,15 +92,24 @@
     </bean>
     
     <bean name="/soap12/add-test-doc-int" class="org.apache.axis.test.interop.mock.MockPostHandler">
+        <property name="requestProcessors">
+            <list>
+                <bean class="org.apache.axis.test.interop.mock.MustUnderstandNormalizer"/>
+            </list>
+        </property>
         <property name="exchanges">
             <list>
                 <bean class="org.apache.axis.test.interop.mock.Exchange">
-                    <property name="request" value="classpath:w3c/XMLP-13.xml"/>
-                    <property name="response" value="classpath:w3c/XMLP-13.xml"/>
+                    <property name="request" value="classpath:whitemesa/XMLP-13.xml"/>
+                    <property name="response" value="classpath:whitemesa/XMLP-13.xml"/>
+                </bean>
+                <bean class="org.apache.axis.test.interop.mock.Exchange">
+                    <property name="request" value="classpath:whitemesa/XMLP-15-request.xml"/>
+                    <property name="response" value="classpath:whitemesa/XMLP-15-response.xml"/>
                 </bean>
                 <bean class="org.apache.axis.test.interop.mock.Exchange">
-                    <property name="request" value="classpath:w3c/XMLP-15-request.xml"/>
-                    <property name="response" value="classpath:w3c/XMLP-15-response.xml"/>
+                    <property name="request" value="classpath:whitemesa/XMLP-16.xml"/>
+                    <property name="response" value="classpath:whitemesa/XMLP-16.xml"/>
                 </bean>
             </list>
         </property>
@@ -105,8 +119,8 @@
         <property name="exchanges">
             <list>
                 <bean class="org.apache.axis.test.interop.mock.Exchange">
-                    <property name="request" value="classpath:w3c/XMLP-14-request.xml"/>
-                    <property name="response" value="classpath:w3c/XMLP-14-response.xml"/>
+                    <property name="request" value="classpath:whitemesa/XMLP-14-request.xml"/>
+                    <property name="response" value="classpath:whitemesa/XMLP-14-response.xml"/>
                 </bean>
             </list>
         </property>