summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test')
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java85
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java125
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java80
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java74
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java65
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java77
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java68
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java126
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java82
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite55
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType33
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl26
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl58
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd136
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl58
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl45
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd33
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl63
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl76
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl62
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl67
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl49
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd29
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd22
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/name.xsd29
25 files changed, 1623 insertions, 0 deletions
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
new file mode 100644
index 0000000000..1e66f7c4e4
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
@@ -0,0 +1,85 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for InterfaceWSDLIntrospectorImpl.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+ private PortType portType;
+ private WSDLDefinition definition;
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ ProcessorContext context = new ProcessorContext();
+ definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public final void testIntrospectPortType() throws InvalidInterfaceException {
+ WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver, null);
+ Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
+ List<Operation> operations = contract.getOperations();
+ Assert.assertEquals(1, operations.size());
+ Operation operation = operations.get(0);
+ Assert.assertEquals("getLastTradePrice", operation.getName());
+ DataType<List<DataType>> inputType = operation.getInputType();
+ Assert.assertEquals(1, inputType.getLogical().size());
+ DataType<XMLType> returnType = operation.getOutputType();
+ Assert.assertNotNull(returnType);
+ Assert.assertEquals(0, operation.getFaultTypes().size());
+ // Assert.assertEquals(1,
+ // operation.getWrapper().getInputChildElements().size());
+ // Assert.assertEquals(1,
+ // operation.getWrapper().getOutputChildElements().size());
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
new file mode 100644
index 0000000000..c4549f8180
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
@@ -0,0 +1,125 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.introspect;
+
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME =
+ new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public final void testWrappedOperation() throws Exception {
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ ProcessorContext context = new ProcessorContext();
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+
+ DataType<List<DataType>> inputType = op.getInputType();
+ Assert.assertEquals(1, inputType.getLogical().size());
+ DataType<XMLType> type = inputType.getLogical().get(0);
+ Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());
+
+ DataType<XMLType> outputType = op.getOutputType();
+ Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
+ outputType.getLogical().getElementName());
+ Assert.assertTrue(op.isWrapperStyle());
+
+ DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
+ List<DataType> childTypes = unwrappedInputType.getLogical();
+ Assert.assertEquals(1, childTypes.size());
+ DataType<XMLType> childType = childTypes.get(0);
+ Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());
+
+ childType = op.getWrapper().getUnwrappedOutputType();
+ Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
+ }
+
+ @Test
+ public final void testUnwrappedOperation() throws Exception {
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
+ Assert.assertFalse(op.isWrapperStyle());
+ Assert.assertEquals(1, op.getInputType().getLogical().size());
+
+ op = (WSDLOperation) wi.getOperations().get(2);
+ Assert.assertFalse(op.isWrapperStyle());
+ Assert.assertEquals(2, op.getInputType().getLogical().size());
+ }
+
+ @Test
+ public final void testInvalidWSDL() throws Exception {
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("../xml/invalid-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("invalid-stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ try {
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+
+ op.isWrapperStyle();
+ fail("InvalidWSDLException should have been thrown");
+ } catch (InvalidInterfaceException e) {
+ // Expected
+ }
+
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
new file mode 100644
index 0000000000..45f4fa78f9
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
@@ -0,0 +1,80 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.apache.tuscany.sca.policy.Intent;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for InterfaceWSDLIntrospectorImpl.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+ private static final QName INTENT = new QName("http://example.com/stockquote.wsdl", "PolicyIntent");
+
+ private PortType portType;
+ private WSDLDefinition definition;
+ private ProcessorContext context;
+
+
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ context = new ProcessorContext();
+ URL url = getClass().getResource("/policy/stockquote_policy.wsdl");
+ definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ }
+
+ @Test
+ public final void testIntrospectPortType() throws InvalidInterfaceException {
+ WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
+
+ boolean foundIntent = false;
+
+ for(Intent intent : contract.getRequiredIntents()) {
+ if(INTENT.equals(intent.getName())) {
+ foundIntent = true;
+ }
+ }
+
+ Assert.assertTrue(foundIntent);
+
+ }
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
new file mode 100644
index 0000000000..ea02d8c3d6
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
@@ -0,0 +1,74 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+ @Test
+ public final void testWrappedOperation() throws Exception {
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+ Assert.assertTrue(op.isWrapperStyle());
+ Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
+ Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
+ }
+
+ @Test
+ public final void testUnwrappedOperation() throws Exception {
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url, context);
+ resolver.addModel(definition, context);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver, context.getMonitor());
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
+ Assert.assertFalse(op.isWrapperStyle());
+ op = (WSDLOperation) wi.getOperations().get(2);
+ Assert.assertFalse(op.isWrapperStyle());
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
new file mode 100644
index 0000000000..143aa47d49
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
@@ -0,0 +1,65 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.xml;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.xsd.XSDFactory;
+import org.junit.Before;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class AbstractWSDLTestCase {
+ protected URLArtifactProcessor<Object> documentProcessor;
+ protected ModelResolver resolver;
+ protected WSDLFactory wsdlFactory;
+ protected XSDFactory xsdFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
+ xsdFactory = modelFactories.getFactory(XSDFactory.class);
+
+ ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+ Contribution contribution = contributionFactory.createContribution();
+ ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
+ resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
+ contribution.setModelResolver(resolver);
+
+ URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
new file mode 100644
index 0000000000..df06553931
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
@@ -0,0 +1,77 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test reading WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadTestCase {
+
+ private static XMLInputFactory inputFactory;
+ private static StAXArtifactProcessor<Object> staxProcessor;
+
+ private static ProcessorContext context;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ context = new ProcessorContext(extensionPoints);
+ inputFactory = XMLInputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null);
+ }
+
+ @Test
+ public void testReadComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ ComponentType componentType = (ComponentType)staxProcessor.read(reader, context);
+ assertNotNull(componentType);
+ }
+
+ @Test
+ public void testReadComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("Calculator.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite)staxProcessor.read(reader, context);
+ assertNotNull(composite);
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
new file mode 100644
index 0000000000..513cb383e4
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
@@ -0,0 +1,68 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Import;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase {
+
+ @Test
+ public void testWSDL() throws Exception {
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("/wsdl/helloworld-service.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url, context);
+
+ Assert.assertNull(definition.getDefinition());
+ Assert.assertEquals("http://helloworld", definition.getNamespace());
+ URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl");
+ WSDLDefinition definition1 = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1, context);
+ Assert.assertNull(definition1.getDefinition());
+ Assert.assertEquals("http://helloworld", definition1.getNamespace());
+
+ resolver.addModel(definition, context);
+ resolver.addModel(definition1, context);
+ resolver.resolveModel(WSDLDefinition.class, definition, context);
+ resolver.resolveModel(WSDLDefinition.class, definition1, context);
+ WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition, context);
+ List imports = (List)definition.getDefinition().getImports().get("http://helloworld");
+ Assert.assertNotNull(imports);
+ Assert.assertNotNull(((Import)imports.get(0)).getDefinition());
+ Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld")));
+ Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService")));
+
+ assertNotNull(resolved.getXmlSchemaType(new QName("http://greeting", "Name")));
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
new file mode 100644
index 0000000000..90054230ff
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
@@ -0,0 +1,126 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test reading WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLTestCase {
+
+ private ExtensibleURLArtifactProcessor documentProcessor;
+ private ContributionFactory contributionFactory;
+ private WSDLModelResolver wsdlResolver;
+ private ModelResolver resolver;
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
+
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+ Contribution contribution = contributionFactory.createContribution();
+ ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
+ resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
+ contribution.setModelResolver(resolver);
+ wsdlResolver = new WSDLModelResolver(contribution, modelFactories);
+ }
+
+ @Test
+ public void testReadWSDLDocument() throws Exception {
+ URL url = getClass().getResource("example.wsdl");
+ WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, null, WSDLDefinition.class);
+ assertNotNull(definition);
+ assertNull(definition.getDefinition());
+ assertEquals(definition.getNamespace(), "http://www.example.org");
+ }
+
+ @Test
+ public void testReadWSDLImports() throws Exception {
+ QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
+ QName aPortType = new QName("http://helloworld", "HelloWorld");
+
+ URL url = getClass().getResource("test1.wsdl");
+ WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, null, WSDLDefinition.class);
+ assertNotNull(test1Defn);
+ ProcessorContext context = new ProcessorContext();
+ wsdlResolver.addModel(test1Defn, context);
+ test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn, context);
+ //binding is a part of test1.wsdl
+ assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
+ //porttype is part of test2.wsdl
+ assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
+ }
+
+ @Test
+ public void testReadSameNamespaceWSDLDocument() throws Exception {
+ QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
+ QName aPortType = new QName("http://helloworld", "HelloWorld");
+
+ ProcessorContext context = new ProcessorContext();
+ URL url = getClass().getResource("test2.wsdl");
+ WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, null, WSDLDefinition.class);
+ assertNotNull(test2Defn);
+ wsdlResolver.addModel(test2Defn, context);
+ test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn, context);
+
+ //bindings are a part of test1.wsdl so should not be found
+ assertNull(test2Defn.getDefinition().getBinding(aBinding));
+ assertNotNull(test2Defn.getDefinition().getPortType(aPortType));
+
+ url = getClass().getResource("test1.wsdl");
+ WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, null, WSDLDefinition.class);
+ assertNotNull(test1Defn);
+ wsdlResolver.addModel(test1Defn, context);
+
+ test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn, context);
+
+ assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
+ assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
new file mode 100644
index 0000000000..118f44f1a0
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
@@ -0,0 +1,82 @@
+/*
+ * 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.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test reading/write WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WriteTestCase {
+
+ private static XMLInputFactory inputFactory;
+ private static XMLOutputFactory outputFactory;
+ private static StAXArtifactProcessor<Object> staxProcessor;
+
+ private static ProcessorContext context;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ context = new ProcessorContext(extensionPoints);
+ inputFactory = XMLInputFactory.newInstance();
+ outputFactory = XMLOutputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
+ }
+
+ @Test
+ public void testReadWriteComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
+ ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is), context);
+ assertNotNull(componentType);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos), context);
+ }
+
+ @Test
+ public void testReadWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("Calculator.composite");
+ Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is), context);
+ assertNotNull(composite);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), context);
+ }
+
+}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
new file mode 100644
index 0000000000..9d714e8169
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:calc="http://sample.calculator"
+ targetNamespace="http://calc"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
+ name="Calculator">
+
+ <service name="CalculatorService" promote="CalculatorServiceComponent">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
+ wsdli:wsdlLocation="http://tempuri.org" requires="calc:intent1" policySets="calc:policySet1"/>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent"/>
+ <reference name="subtractService" target="SubtractServiceComponent"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
new file mode 100644
index 0000000000..eaf8d1b8ee
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance">
+
+ <service name="CalculatorService">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
+ wsdli:wsdlLocation="http://tempuri.org"/>
+ </service>
+
+ <reference name="divideService">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/>
+ </reference>
+
+</componentType>
+ \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
new file mode 100644
index 0000000000..5e8e5dad0d
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://www.example.org"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ name="example">
+
+ <wsdl:portType name="HelloWorld">
+ </wsdl:portType>
+</wsdl:definitions>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
new file mode 100644
index 0000000000..ad81fc7867
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice1">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ </portType>
+
+</definitions> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
new file mode 100644
index 0000000000..241ec15d36
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
@@ -0,0 +1,136 @@
+<!--
+ * 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.
+-->
+<schema targetNamespace="http://www.example.com/IPO"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+
+ <annotation>
+ <documentation xml:lang="en">
+ International Purchase order schema for Example.com
+ Copyright 2000 Example.com. All rights reserved.
+ </documentation>
+ </annotation>
+
+
+ <element name="purchaseOrder" type="ipo:PurchaseOrderType" />
+
+ <element name="comment" type="string" />
+
+ <complexType name="PurchaseOrderType">
+ <sequence>
+ <element name="shipTo" type="ipo:Address" />
+ <element name="billTo" type="ipo:Address" />
+ <element ref="ipo:comment" minOccurs="0" />
+ <element name="items" type="ipo:Items" />
+ </sequence>
+ <attribute name="orderDate" type="date" />
+ </complexType>
+
+ <complexType name="Items">
+ <sequence>
+ <element name="item" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="productName" type="string" />
+ <element name="quantity">
+ <simpleType>
+ <restriction base="positiveInteger">
+ <maxExclusive value="100" />
+ </restriction>
+ </simpleType>
+ </element>
+ <element name="USPrice" type="decimal" />
+ <element ref="ipo:comment" minOccurs="0" />
+ <element name="shipDate" type="date"
+ minOccurs="0" />
+ </sequence>
+ <attribute name="partNum" type="ipo:SKU"
+ use="required" />
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <simpleType name="SKU">
+ <restriction base="string">
+ <pattern value="\d{3}-[A-Z]{2}" />
+ </restriction>
+ </simpleType>
+
+ <complexType name="Address">
+ <sequence>
+ <element name="name" type="string" />
+ <element name="street" type="string" />
+ <element name="city" type="string" />
+ </sequence>
+ </complexType>
+
+ <complexType name="USAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="state" type="ipo:USState" />
+ <element name="zip" type="positiveInteger" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="UKAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="postcode" type="ipo:UKPostcode" />
+ </sequence>
+ <attribute name="exportCode" type="positiveInteger"
+ fixed="1" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- other Address derivations for more countries -->
+
+ <simpleType name="USState">
+ <restriction base="string">
+ <enumeration value="AK" />
+ <enumeration value="AL" />
+ <enumeration value="AR" />
+ <enumeration value="CA" />
+ <enumeration value="PA" />
+ <!-- and so on ... -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="Postcode">
+ <restriction base="string">
+ <length value="7" fixed="true" />
+ </restriction>
+ </simpleType>
+
+
+ <simpleType name="UKPostcode">
+ <restriction base="ipo:Postcode">
+ <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" />
+ </restriction>
+ </simpleType>
+
+
+
+</schema>
+
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
new file mode 100644
index 0000000000..39cd5547d9
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ </portType>
+
+</definitions> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
new file mode 100644
index 0000000000..8e26f7b4b5
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:import location="test2.wsdl" namespace="http://helloworld"></wsdl:import>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction="" />
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
new file mode 100644
index 0000000000..c2210f4a94
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
@@ -0,0 +1,33 @@
+<!--
+ * 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.
+-->
+<schema targetNamespace="http://www.example.com/Customer" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO" xmlns:tns="http://www.example.com/Customer">
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
+
+ <complexType name="Customer">
+ <sequence>
+ <element name="customerID" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="order" type="ipo:PurchaseOrderType" />
+ </sequence>
+ </complexType>
+ <element name="customer" type="tns:Customer"></element>
+
+</schema>
+
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
new file mode 100644
index 0000000000..529b395fd5
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
new file mode 100644
index 0000000000..666a7e4069
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput1">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput1">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <message name="GetLastTradePriceInput2">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ <part name="other" type="xsd:string"/>
+ </message>
+
+ <message name="GetLastTradePriceOutput2">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput1" />
+ <output message="tns:GetLastTradePriceOutput1" />
+ </operation>
+ <operation name="getLastTradePrice1">
+ <input message="tns:GetLastTradePriceInput1" />
+ <output message="tns:GetLastTradePriceOutput1" />
+ </operation>
+ <operation name="getLastTradePrice2">
+ <input message="tns:GetLastTradePriceInput2" />
+ <output message="tns:GetLastTradePriceOutput2" />
+ </operation>
+ </portType>
+
+</definitions> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl
new file mode 100644
index 0000000000..86cbe39af9
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!--
+ * 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.
+-->
+<definitions name="StockQuote"
+ targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl"
+ xmlns:xsd="http://example.com/stockquote.xsd"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType" sca:requires="sca:conversational tns:PolicyIntent">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ <operation name="cancel" sca:endsConversation="true"/>
+ </portType>
+
+</definitions> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl
new file mode 100644
index 0000000000..9d9376ad6c
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:g="http://greeting">
+
+ <!--
+ <import namespace="http://greeting" schemaLocation="../xsd/greeting.xsd" />
+ -->
+ <include schemaLocation="../xsd/helloworld.xsd" />
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="g:Name" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="g:Greeting" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl
new file mode 100644
index 0000000000..3885357625
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:import location="helloworld-interface.wsdl" namespace="http://helloworld"></wsdl:import>
+ <!--
+ <wsdl:import namespace="http://helloworld"></wsdl:import>
+ -->
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction="" />
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address
+ location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd
new file mode 100644
index 0000000000..635ca25bfc
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
+ <include schemaLocation="name.xsd" />
+ <complexType name="Greeting">
+ <sequence>
+ <element name="message" type="string" />
+ <element name="name" type="Name" />
+ </sequence>
+ </complexType>
+
+</schema> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd
new file mode 100644
index 0000000000..bb0c9bc7b7
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://greeting" schemaLocation="greeting.xsd" />
+</schema> \ No newline at end of file
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/name.xsd b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/name.xsd
new file mode 100644
index 0000000000..300de931ec
--- /dev/null
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/interface-wsdl/src/test/resources/xsd/name.xsd
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <complexType name="Name">
+ <sequence>
+ <element name="firstName" type="string" />
+ <element name="lastName" type="string" />
+ </sequence>
+ </complexType>
+
+</schema> \ No newline at end of file