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/04 22:15:25 UTC
svn commit: r1394241 - in /axis/axis1/java/trunk: interop-mock/
interop-mock/src/main/java/org/apache/axis/test/interop/mock/
interop-mock/src/main/resources/w3c/
interop-mock/src/main/resources/w3c/variants/
interop-mock/src/main/webapp/WEB-INF/ inter...
Author: veithen
Date: Thu Oct 4 20:15:24 2012
New Revision: 1394241
URL: http://svn.apache.org/viewvc?rev=1394241&view=rev
Log:
Added more endpoints and messages to the mock service for www.whitemesa.net and fixed some issues in WhiteMesaSoap12AddTestSvcTestCase so that the request messages match the ones specified in http://www.w3.org/TR/2007/REC-soap12-testcollection-20070427/.
Added:
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java (with props)
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java (with props)
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java (with props)
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java (with props)
axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml (with props)
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml (with props)
Modified:
axis/axis1/java/trunk/interop-mock/pom.xml
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/MockGetHandler.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/resources/w3c/README.txt
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-request.xml
axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-response.xml
axis/axis1/java/trunk/interop-mock/src/main/webapp/WEB-INF/dispatcher-servlet.xml
axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
Modified: axis/axis1/java/trunk/interop-mock/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/pom.xml?rev=1394241&r1=1394240&r2=1394241&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/pom.xml (original)
+++ axis/axis1/java/trunk/interop-mock/pom.xml Thu Oct 4 20:15:24 2012
@@ -41,6 +41,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
Added: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java Thu Oct 4 20:15:24 2012
@@ -0,0 +1,51 @@
+/*
+ * 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 javax.el.BeanELResolver;
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.VariableMapper;
+
+public class Context extends ELContext {
+ private final BeanELResolver resolver = new BeanELResolver();
+ private final FunctionMapper functionMapper = new Functions();
+ private final Variables variables;
+
+ public Context(Variables variables) {
+ this.variables = variables;
+ }
+
+ @Override
+ public ELResolver getELResolver() {
+ return resolver;
+ }
+
+ @Override
+ public FunctionMapper getFunctionMapper() {
+ return functionMapper;
+ }
+
+ @Override
+ public VariableMapper getVariableMapper() {
+ return variables;
+ }
+}
Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Context.java
------------------------------------------------------------------------------
svn:eol-style = native
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=1394241&r1=1394240&r2=1394241&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 Thu Oct 4 20:15:24 2012
@@ -18,8 +18,8 @@
*/
package org.apache.axis.test.interop.mock;
-import java.util.HashMap;
-import java.util.Map;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.logging.Log;
@@ -38,19 +38,12 @@ public class Exchange implements Initial
private Resource response;
private Element requestMessage;
private Element responseMessage;
-
- public Resource getRequest() {
- return request;
- }
+ private String requestContentType;
public void setRequest(Resource request) {
this.request = request;
}
- public Resource getResponse() {
- return response;
- }
-
public void setResponse(Resource response) {
this.response = response;
}
@@ -58,19 +51,26 @@ public class Exchange implements Initial
public void afterPropertiesSet() throws Exception {
requestMessage = DOMUtil.parse(request).getDocumentElement();
DOMUtil.removeWhitespace(requestMessage);
+ requestContentType = SOAPUtil.getContentType(requestMessage);
responseMessage = DOMUtil.parse(response).getDocumentElement();
DOMUtil.removeWhitespace(responseMessage);
}
+ public String getRequestContentType() {
+ return requestContentType;
+ }
+
public Element matchRequest(Element root) {
if (log.isDebugEnabled()) {
log.debug("Attempting to match " + request);
}
- Map<String,String> inferredVariables = new HashMap<String,String>();
+ Variables inferredVariables = new Variables();
if (match(requestMessage, root, inferredVariables)) {
log.debug("Message matches");
Element clonedResponseMessage = (Element)DOMUtil.newDocument().importNode(responseMessage, true);
- substituteVariables(clonedResponseMessage, inferredVariables);
+ ExpressionFactory factory = ExpressionFactory.newInstance();
+ Context context = new Context(inferredVariables);
+ substituteVariables(clonedResponseMessage, factory, context);
return clonedResponseMessage;
} else {
log.debug("Message doesn't match");
@@ -105,15 +105,23 @@ public class Exchange implements Initial
return buffer.toString();
}
- private boolean match(Element expected, Element actual, Map<String,String> inferredVariables) {
+ private boolean matchName(String expected, String actual) {
+ if ("__any__".equals(expected)) {
+ return true;
+ } else {
+ return ObjectUtils.equals(expected, actual);
+ }
+ }
+
+ private boolean match(Element expected, Element actual, Variables inferredVariables) {
// Compare local name and namespace URI
- if (!ObjectUtils.equals(expected.getLocalName(), actual.getLocalName())) {
+ if (!matchName(expected.getLocalName(), actual.getLocalName())) {
if (log.isDebugEnabled()) {
log.debug("Local name mismatch: expected=" + expected.getLocalName() + "; actual=" + actual.getLocalName());
}
return false;
}
- if (!ObjectUtils.equals(expected.getNamespaceURI(), actual.getNamespaceURI())) {
+ if (!matchName(expected.getNamespaceURI(), actual.getNamespaceURI())) {
if (log.isDebugEnabled()) {
log.debug("Namespace mismatch: expected=" + expected.getNamespaceURI() + "; actual=" + actual.getNamespaceURI());
}
@@ -125,51 +133,59 @@ public class Exchange implements Initial
// Compare children
NodeList expectedChildren = expected.getChildNodes();
NodeList actualChildren = actual.getChildNodes();
- if (expectedChildren.getLength() != actualChildren.getLength()) {
- if (log.isDebugEnabled()) {
- log.debug("Children count mismatch at " + getLocation(expected) + ": expected=" + expectedChildren.getLength() + "; actual=" + actualChildren.getLength());
- }
- return false;
- }
- for (int i=0; i<expectedChildren.getLength(); i++) {
- Node expectedChild = expectedChildren.item(i);
- Node actualChild = actualChildren.item(i);
- if (expectedChild.getNodeType() != actualChild.getNodeType()) {
+ int expectedChildrenLength = expectedChildren.getLength();
+ int actualChildrenLength = actualChildren.getLength();
+ // We need to handle the situation where we expect a single child of type text and where there actually is no child
+ // in a special way. Otherwise variable inference doesn't work if the value is the empty string.
+ if (expectedChildrenLength == 1 && expectedChildren.item(0).getNodeType() == Node.TEXT_NODE && actualChildrenLength == 0) {
+ return match((Text)expectedChildren.item(0), null, inferredVariables);
+ } else {
+ if (expectedChildrenLength != actualChildrenLength) {
if (log.isDebugEnabled()) {
- log.debug("Child type mismatch");
+ log.debug("Children count mismatch at " + getLocation(expected) + ": expected=" + expectedChildrenLength + "; actual=" + actualChildrenLength);
}
return false;
}
- switch (expectedChild.getNodeType()) {
- case Node.ELEMENT_NODE:
- if (!match((Element)expectedChild, (Element)actualChild, inferredVariables)) {
- return false;
- }
- break;
- case Node.TEXT_NODE:
- if (!match((Text)expectedChild, (Text)actualChild, inferredVariables)) {
- return false;
- }
- break;
- default:
+ for (int i=0; i<expectedChildrenLength; i++) {
+ Node expectedChild = expectedChildren.item(i);
+ Node actualChild = actualChildren.item(i);
+ if (expectedChild.getNodeType() != actualChild.getNodeType()) {
if (log.isDebugEnabled()) {
- log.debug("Unexpected node type " + expectedChild.getNodeType());
+ log.debug("Child type mismatch");
}
- throw new IllegalStateException("Unexpected node type");
+ return false;
+ }
+ switch (expectedChild.getNodeType()) {
+ case Node.ELEMENT_NODE:
+ if (!match((Element)expectedChild, (Element)actualChild, inferredVariables)) {
+ return false;
+ }
+ break;
+ case Node.TEXT_NODE:
+ if (!match((Text)expectedChild, (Text)actualChild, inferredVariables)) {
+ return false;
+ }
+ break;
+ default:
+ if (log.isDebugEnabled()) {
+ log.debug("Unexpected node type " + expectedChild.getNodeType());
+ }
+ throw new IllegalStateException("Unexpected node type");
+ }
}
+ return true;
}
- return true;
}
- private boolean match(Text expected, Text actual, Map<String,String> inferredVariables) {
+ private boolean match(Text expected, Text actual, Variables inferredVariables) {
String expectedContent = expected.getData();
- String actualContent = actual.getData();
+ String actualContent = actual == null ? "" : actual.getData();
String varName = checkVariable(expectedContent);
if (varName != null) {
if (log.isDebugEnabled()) {
log.debug("Inferred variable: " + varName + "=" + actualContent);
}
- inferredVariables.put(varName, actualContent);
+ inferredVariables.bind(varName, actualContent);
return true;
} else {
if (expectedContent.equals(actualContent)) {
@@ -185,29 +201,23 @@ public class Exchange implements Initial
}
private String checkVariable(String text) {
- if (text.startsWith("@") && text.endsWith("@")) {
- return text.substring(1, text.length()-1);
+ if (text.startsWith("${") && text.endsWith("}")) {
+ return text.substring(2, text.length()-1);
} else {
return null;
}
}
- private void substituteVariables(Element element, Map<String,String> variables) {
+ private void substituteVariables(Element element, ExpressionFactory expressionFactory, ELContext context) {
Node child = element.getFirstChild();
while (child != null) {
switch (child.getNodeType()) {
case Node.ELEMENT_NODE:
- substituteVariables((Element)child, variables);
+ substituteVariables((Element)child, expressionFactory, context);
break;
case Node.TEXT_NODE:
Text text = (Text)child;
- String varName = checkVariable(text.getData());
- if (varName != null) {
- text.setData(variables.get(varName));
- if (log.isDebugEnabled()) {
- log.debug("Substituted variable " + varName + " at " + getLocation(element));
- }
- }
+ text.setData((String)expressionFactory.createValueExpression(context, text.getData(), String.class).getValue(context));
break;
}
child = child.getNextSibling();
Added: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java Thu Oct 4 20:15:24 2012
@@ -0,0 +1,42 @@
+/*
+ * 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 java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Locale;
+
+import javax.el.FunctionMapper;
+
+public class Functions extends FunctionMapper {
+ public Method resolveFunction(String prefix, String localName) {
+ if (prefix.equals("fn")) {
+ for (Method method : Functions.class.getMethods()) {
+ if (Modifier.isStatic(method.getModifiers()) && method.getName().equals(localName)) {
+ return method;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String toUpperCase(String s) {
+ return s.toUpperCase(Locale.ENGLISH);
+ }
+}
\ No newline at end of file
Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Functions.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java?rev=1394241&r1=1394240&r2=1394241&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/MockGetHandler.java Thu Oct 4 20:15:24 2012
@@ -19,7 +19,6 @@
package org.apache.axis.test.interop.mock;
import java.io.IOException;
-import java.io.InputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -29,34 +28,39 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
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.springframework.web.HttpRequestHandler;
+import org.w3c.dom.Element;
-public class MockGetHandler implements HttpRequestHandler {
+public class MockGetHandler implements HttpRequestHandler, InitializingBean {
private static final Log log = LogFactory.getLog(MockGetHandler.class);
- private String contentType;
private Resource response;
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
+ private Element responseMessage;
+ private String responseContentType;
public void setResponse(Resource response) {
this.response = response;
}
+ public void afterPropertiesSet() throws Exception {
+ responseMessage = DOMUtil.parse(response).getDocumentElement();
+ DOMUtil.removeWhitespace(responseMessage);
+ responseContentType = SOAPUtil.getContentType(responseMessage);
+ }
+
public void handleRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException {
if (!httpRequest.getMethod().equals("GET")) {
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "This endpoint only supports GET requests");
return;
}
- httpResponse.setContentType(contentType + "; " + Constants.CHARSET_PARAM + "=UTF-8");
+ httpResponse.setContentType(responseContentType + "; " + Constants.CHARSET_PARAM + "=UTF-8");
Transformer transformer;
try {
transformer = TransformerFactory.newInstance().newTransformer();
@@ -67,13 +71,10 @@ public class MockGetHandler implements H
if (log.isDebugEnabled()) {
log.debug("Returning " + response);
}
- InputStream in = response.getInputStream();
try {
- transformer.transform(new StreamSource(in), new StreamResult(httpResponse.getOutputStream()));
+ transformer.transform(new DOMSource(responseMessage), new StreamResult(httpResponse.getOutputStream()));
} catch (TransformerException ex) {
throw new ServletException(ex);
- } finally {
- in.close();
}
}
}
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=1394241&r1=1394240&r2=1394241&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 Thu Oct 4 20:15:24 2012
@@ -19,8 +19,10 @@
package org.apache.axis.test.interop.mock;
import java.io.IOException;
+import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
@@ -37,25 +39,29 @@ import javax.xml.transform.stream.Stream
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.HttpRequestHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-public class MockPostHandler implements HttpRequestHandler {
+public class MockPostHandler implements HttpRequestHandler, InitializingBean {
private static final Log log = LogFactory.getLog(MockPostHandler.class);
- private String contentType;
private List<Exchange> exchanges;
+ private Set<String> supportedContentTypes;
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
public void setExchanges(List<Exchange> exchanges) {
this.exchanges = exchanges;
}
+ public void afterPropertiesSet() throws Exception {
+ supportedContentTypes = new HashSet<String>();
+ for (Exchange exchange : exchanges) {
+ supportedContentTypes.add(exchange.getRequestContentType());
+ }
+ }
+
public void handleRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException {
if (!httpRequest.getMethod().equals("POST")) {
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "This endpoint only supports POST requests");
@@ -73,8 +79,9 @@ public class MockPostHandler implements
httpResponse.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid Content-Type header: " + ex.getMessage());
return;
}
- if (!requestContentType.getBaseType().toLowerCase(Locale.ENGLISH).equals(contentType)) {
- httpResponse.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, "Only " + contentType + " is supported");
+ String requestBaseContentType = requestContentType.getBaseType().toLowerCase(Locale.ENGLISH);
+ if (!supportedContentTypes.contains(requestBaseContentType)) {
+ httpResponse.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE, "Only " + supportedContentTypes + " are supported");
return;
}
String charset = requestContentType.getParameter(Constants.CHARSET_PARAM);
@@ -93,9 +100,11 @@ public class MockPostHandler implements
}
Element responseMessage = null;
for (Exchange exchange : exchanges) {
- responseMessage = exchange.matchRequest(requestDocument.getDocumentElement());
- if (responseMessage != null) {
- break;
+ if (exchange.getRequestContentType().equals(requestBaseContentType)) {
+ responseMessage = exchange.matchRequest(requestDocument.getDocumentElement());
+ if (responseMessage != null) {
+ break;
+ }
}
}
if (responseMessage == null) {
@@ -104,7 +113,7 @@ public class MockPostHandler implements
}
MimeType responseContentType;
try {
- responseContentType = new MimeType(contentType);
+ responseContentType = new MimeType(SOAPUtil.getContentType(responseMessage));
} catch (MimeTypeParseException ex) {
throw new ServletException("Unexpected exception", ex);
}
Added: 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=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java Thu Oct 4 20:15:24 2012
@@ -0,0 +1,36 @@
+/*
+ * 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 final class SOAPUtil {
+ private SOAPUtil() {}
+
+ public static String getContentType(Element envelope) {
+ String namespaceURI = envelope.getNamespaceURI();
+ if ("http://www.w3.org/2003/05/soap-envelope".equals(namespaceURI)) {
+ return "application/soap+xml";
+ } else if ("http://schemas.xmlsoap.org/soap/envelope/".equals(namespaceURI)) {
+ return "text/xml";
+ } else {
+ return null;
+ }
+ }
+}
Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/SOAPUtil.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java Thu Oct 4 20:15:24 2012
@@ -0,0 +1,78 @@
+/*
+ * 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 javax.el.ELContext;
+import javax.el.PropertyNotWritableException;
+import javax.el.ValueExpression;
+
+import org.apache.commons.lang.ObjectUtils;
+
+public final class ValueExpressionLiteral extends ValueExpression {
+ private static final long serialVersionUID = -3847213439349942695L;
+
+ private String value;
+
+ public ValueExpressionLiteral(String value) {
+ if (value == null) {
+ throw new IllegalArgumentException();
+ }
+ this.value = value;
+ }
+
+ public Object getValue(ELContext context) {
+ return this.value;
+ }
+
+ public void setValue(ELContext context, Object value) {
+ throw new PropertyNotWritableException();
+ }
+
+ public boolean isReadOnly(ELContext context) {
+ return true;
+ }
+
+ public Class<?> getType(ELContext context) {
+ return String.class;
+ }
+
+ public Class<?> getExpectedType() {
+ return String.class;
+ }
+
+ public String getExpressionString() {
+ return value;
+ }
+
+ public boolean equals(Object obj) {
+ return (obj instanceof ValueExpressionLiteral && equals((ValueExpressionLiteral)obj));
+ }
+
+ public boolean equals(ValueExpressionLiteral ve) {
+ return ve != null && ObjectUtils.equals(value, ve.value);
+ }
+
+ public int hashCode() {
+ return value.hashCode();
+ }
+
+ public boolean isLiteralText() {
+ return true;
+ }
+}
Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/ValueExpressionLiteral.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java Thu Oct 4 20:15:24 2012
@@ -0,0 +1,41 @@
+/*
+ * 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 java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
+
+public class Variables extends VariableMapper {
+ private final Map<String,ValueExpression> variables = new HashMap<String,ValueExpression>();
+
+ public void bind(String name, String value) {
+ variables.put(name, new ValueExpressionLiteral(value));
+ }
+
+ public ValueExpression resolveVariable(String name) {
+ return variables.get(name);
+ }
+
+ public ValueExpression setVariable(String name, ValueExpression valueExpression) {
+ return (variables.put(name, valueExpression));
+ }
+}
\ No newline at end of file
Propchange: axis/axis1/java/trunk/interop-mock/src/main/java/org/apache/axis/test/interop/mock/Variables.java
------------------------------------------------------------------------------
svn:eol-style = native
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=1394241&r1=1394240&r2=1394241&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 Thu Oct 4 20:15:24 2012
@@ -6,5 +6,12 @@ with corrections for the following mista
code and subcode values.
* Request messages for the echoSimpleTypesAsStruct operation use inputInt as parameter name, but
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, request values echoed in responses have been replaced by template variables.
\ No newline at end of file
+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
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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:Body>
+ <sb:echoInteger xmlns:sb="http://soapinterop.org/"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputInteger xsi:type="xsd:int">${inputInteger}</inputInteger>
+ </sb:echoInteger>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,20 @@
+<?xml version="1.0" ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:Sender</env:Value>
+ <env:Subcode>
+ <env:Value xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
+ rpc:BadArguments
+ </env:Value>
+ </env:Subcode>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en">
+ Bad parameter: 'inputInteger' on method 'echoInteger'.
+ </env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-11-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,8 @@
+<?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:Body>
+ <sb:unknownMethodThatShouldNotBeThere xmlns:sb="http://soapinterop.org/" />
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,17 @@
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:rpc="http://www.w3.org/2003/05/soap-rpc">
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:Sender</env:Value>
+ <env:Subcode>
+ <env:Value>rpc:ProcedureNotPresent</env:Value>
+ </env:Subcode>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en-US"> Procedure Not Present </env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-12-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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/w3c/XMLP-13.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-13.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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: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/w3c/XMLP-13.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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/w3c/XMLP-14-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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: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/w3c/XMLP-14-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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/w3c/XMLP-14-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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:Body>
+ <sb:echoString xmlns:sb="http://soapinterop.org/"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString xsi:type="xsd:string">${fn:toUpperCase(inputString)}</inputString>
+ </sb:echoString>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-14-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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/w3c/XMLP-15-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,15 @@
+<?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>
+ <sb:__any__ env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
+ xmlns:sb="__any__">${headerContent}</sb:__any__>
+ </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/w3c/XMLP-15-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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/w3c/XMLP-15-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-15-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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: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/w3c/XMLP-15-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-request.xml?rev=1394241&r1=1394240&r2=1394241&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-request.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-request.xml Thu Oct 4 20:15:24 2012
@@ -5,9 +5,9 @@
<env:Body>
<sb:echoSimpleTypesAsStruct xmlns:sb="http://soapinterop.org/"
env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
- <inputFloat xsi:type="xsd:float">@floatValue@</inputFloat>
- <inputInteger xsi:type="xsd:int">@intValue@</inputInteger>
- <inputString xsi:type="xsd:string">@stringValue@</inputString>
+ <inputFloat xsi:type="xsd:float">${floatValue}</inputFloat>
+ <inputInteger xsi:type="xsd:int">${intValue}</inputInteger>
+ <inputString xsi:type="xsd:string">${stringValue}</inputString>
</sb:echoSimpleTypesAsStruct>
</env:Body>
</env:Envelope>
\ No newline at end of file
Modified: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-response.xml?rev=1394241&r1=1394240&r2=1394241&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-response.xml (original)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-4-response.xml Thu Oct 4 20:15:24 2012
@@ -9,9 +9,9 @@
<rpc:result>return</rpc:result>
<return xsi:type="ns1:SOAPStruct"
xmlns:ns1="http://soapinterop.org/xsd">
- <varString xsi:type="xsd:string">@stringValue@</varString>
- <varInt xsi:type="xsd:int">@intValue@</varInt>
- <varFloat xsi:type="xsd:float">@floatValue@</varFloat>
+ <varString xsi:type="xsd:string">${stringValue}</varString>
+ <varInt xsi:type="xsd:int">${intValue}</varInt>
+ <varFloat xsi:type="xsd:float">${floatValue}</varFloat>
</return>
</sb:echoSimpleTypesAsStructResponse>
</env:Body>
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" ?>
+<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
+ xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">
+ <env:Body env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
+ <sb:echoVoid xmlns:sb="http://soapinterop.org/" />
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <env:Upgrade>
+ <env:SupportedEnvelope qname="ns1:Envelope"
+ xmlns:ns1="http://www.w3.org/2003/05/soap-envelope"/>
+ </env:Upgrade>
+ </env:Header>
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:VersionMismatch</env:Value>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en-US">Wrong Version</env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-5-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,12 @@
+<?xml version="1.0" ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <h:__any__ xmlns:h="__any__"
+ env:mustUnderstand="1"
+ env:role="http://www.w3.org/2003/05/soap-envelope/role/next">${content}</h:__any__>
+ </env:Header>
+ <env:Body>
+ <sb:echoVoid xmlns:sb="http://soapinterop.org/"
+ env:encodingstyle="http://www.w3.org/2003/05/soap-encoding" />
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,17 @@
+<?xml version='1.0' ?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Header>
+ <env:NotUnderstood qname="h:Unknown"
+ xmlns:h="http://example.org/"/>
+ </env:Header>
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:MustUnderstand</env:Value>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en-US"> Header not understood </env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-6-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <env:Body>
+ <sb:echoSenderFault xmlns:sb="http://soapinterop.org/"
+ xsi:type="xsd:string">${content}</sb:echoSenderFault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:Sender</env:Value>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en">This is a Sender fault.</env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-7-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <env:Body>
+ <sb:echoReceiverFault xmlns:sb="http://soapinterop.org/"
+ xsi:type="xsd:string">${content}</sb:echoReceiverFault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:Receiver</env:Value>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en">This is a Receiver fault.</env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-8-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,11 @@
+<?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:Body>
+ <sb:echoString xmlns:sb="http://soapinterop.org/"
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
+ <inputString env:encodingStyle="unknown">${inputString}</inputString>
+ </sb:echoString>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-request.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml?rev=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
+ <env:Body>
+ <env:Fault>
+ <env:Code>
+ <env:Value>env:DataEncodingUnknown</env:Value>
+ </env:Code>
+ <env:Reason>
+ <env:Text xml:lang="en-US"> Unknown Data Encoding Style </env:Text>
+ </env:Reason>
+ </env:Fault>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/XMLP-9-response.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1394241&view=auto
==============================================================================
--- axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml (added)
+++ axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.xml Thu Oct 4 20:15:24 2012
@@ -0,0 +1,10 @@
+<?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:Body>
+ <sb:unknownFreakyMethod xmlns:sb="http://soapinterop.org/">
+ <inputInteger>${inputInteger}</inputInteger>
+ </sb:unknownFreakyMethod>
+ </env:Body>
+</env:Envelope>
Propchange: axis/axis1/java/trunk/interop-mock/src/main/resources/w3c/variants/XMLP-12-request.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=1394241&r1=1394240&r2=1394241&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 Thu Oct 4 20:15:24 2012
@@ -25,7 +25,6 @@
<!-- Endpoints that mock http://www.whitemesa.net -->
<bean name="/soap12/add-test-rpc" class="org.apache.axis.test.interop.mock.MockPostHandler">
- <property name="contentType" value="application/soap+xml"/>
<property name="exchanges">
<list>
<bean class="org.apache.axis.test.interop.mock.Exchange">
@@ -36,17 +35,80 @@
<property name="request" value="classpath:w3c/XMLP-4-request.xml"/>
<property name="response" value="classpath:w3c/XMLP-4-response.xml"/>
</bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-5-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-5-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-6-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-6-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-9-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-9-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-11-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-11-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-12-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-12-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/variants/XMLP-12-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-12-response.xml"/>
+ </bean>
</list>
</property>
</bean>
<bean name="/soap12/add-test-doc/getTime" class="org.apache.axis.test.interop.mock.MockGetHandler">
- <property name="contentType" value="application/soap+xml"/>
<property name="response" value="classpath:w3c/XMLP-2-response.xml"/>
</bean>
<bean name="/soap12/add-test-rpc/getTime" class="org.apache.axis.test.interop.mock.MockGetHandler">
- <property name="contentType" value="application/soap+xml"/>
<property name="response" value="classpath:w3c/XMLP-3-response.xml"/>
</bean>
+
+ <bean name="/soap12/add-test-doc" class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <property name="exchanges">
+ <list>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-7-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-7-response.xml"/>
+ </bean>
+ <bean class="org.apache.axis.test.interop.mock.Exchange">
+ <property name="request" value="classpath:w3c/XMLP-8-request.xml"/>
+ <property name="response" value="classpath:w3c/XMLP-8-response.xml"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="/soap12/add-test-doc-int" class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <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"/>
+ </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"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
+
+ <bean name="/soap12/add-test-doc-int-uc" class="org.apache.axis.test.interop.mock.MockPostHandler">
+ <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"/>
+ </bean>
+ </list>
+ </property>
+ </bean>
</beans>
Modified: axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java?rev=1394241&r1=1394240&r2=1394241&view=diff
==============================================================================
--- axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java (original)
+++ axis/axis1/java/trunk/interop/src/test/java/test/wsdl/soap12/additional/WhiteMesaSoap12AddTestSvcTestCase.java Thu Oct 4 20:15:24 2012
@@ -52,8 +52,8 @@ public class WhiteMesaSoap12AddTestSvcTe
// Endpoints
// TODO : Shouldn't be hardcoded!
-// public static final String HOST = "http://localhost:8080";
- public static String HOST = "http://www.whitemesa.net";
+ public static String HOST = "http://localhost:9080";
+// public static String HOST = "http://www.whitemesa.net";
public static String RPC_ENDPOINT = HOST + "/soap12/add-test-rpc";
public static String DOC_ENDPOINT = HOST + "/soap12/add-test-doc";
public static String GET_DOC_ENDPOINT = HOST + "/soap12/add-test-doc/getTime";
@@ -424,7 +424,7 @@ public class WhiteMesaSoap12AddTestSvcTe
Call call = new Call(DOC_INT_ENDPOINT);
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.setOperationStyle(Style.WRAPPED);
- call.addParameter(new QName(TEST_NS, "inputString"),
+ call.addParameter(new QName("", "inputString"),
Constants.XSD_STRING, ParameterMode.IN);
call.setReturnType(Constants.XSD_STRING);
@@ -443,7 +443,7 @@ public class WhiteMesaSoap12AddTestSvcTe
Call call = new Call(DOC_INT_UC_ENDPOINT);
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.setOperationStyle(Style.WRAPPED);
- call.addParameter(new QName(TEST_NS, "inputString"),
+ call.addParameter(new QName("", "inputString"),
Constants.XSD_STRING, ParameterMode.IN);
call.setReturnType(Constants.XSD_STRING);
@@ -466,6 +466,8 @@ public class WhiteMesaSoap12AddTestSvcTe
header.setObjectValue(HEADER_VAL);
call.addHeader(header);
+ call.addParameter(new QName("", "inputString"),
+ Constants.XSD_STRING, ParameterMode.IN);
call.invoke(ECHO_STRING_QNAME, new Object [] { "body string" });
SOAPEnvelope respEnv = call.getMessageContext().getResponseMessage().getSOAPEnvelope();