tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r449084 - in /incubator/tuscany/java/sca: kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ kernel/spi/src/main/java/org/apache/tuscany/spi/model/ services/databinding/databinding-axiom/ services/databinding/databinding-axiom/src/main/ja...
Date Fri, 22 Sep 2006 20:49:00 GMT
Author: rfeng
Date: Fri Sep 22 13:48:58 2006
New Revision: 449084

URL: http://svn.apache.org/viewvc?view=rev&rev=449084
Log:
Refactor the IDL Wrapper/Element/Type into SPI to be IDL-independent 

Added:
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java   (with props)
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java   (with props)
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java   (with props)
Modified:
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java
    incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
    incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml
    incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java
    incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java
    incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementWrapperTransformerTestCase.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/pom.xml
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/Java2SimpleTypeTransformer.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleType2JavaTransformer.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtension.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Input2InputTransformer.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Output2OutputTransformer.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/SimpleTypeMapper.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/WrapperHandler.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/impl/DataBindingInteceptor.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/DOMWrapperHandler.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/Object2Node.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtensionTestCase.java
    incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/idl/IDLTransformerTestCase.java
    incubator/tuscany/java/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java
    incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java
    incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java
    incubator/tuscany/java/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java
    incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java
    incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java?view=auto&rev=449084
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java Fri Sep 22 13:48:58 2006
@@ -0,0 +1,54 @@
+/*
+ * 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.spi.idl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema elements
+ */
+public class ElementInfo {
+    private QName name;
+    private TypeInfo type;
+
+    /**
+     * @param name
+     * @param type
+     */
+    public ElementInfo(QName name, TypeInfo type) {
+        super();
+        this.name = name;
+        this.type = type;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the type
+     */
+    public TypeInfo getType() {
+        return type;
+    }
+}

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java Fri Sep 22 13:48:58 2006
@@ -24,6 +24,8 @@
  * @version $Rev$ $Date$
  */
 public class OverloadedOperationException extends InvalidServiceContractException {
+    private static final long serialVersionUID = -4658711318608885638L;
+
     public OverloadedOperationException() {
     }
 

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java?view=auto&rev=449084
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java Fri Sep 22 13:48:58 2006
@@ -0,0 +1,66 @@
+/*
+ * 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.spi.idl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema types
+ */
+public class TypeInfo {
+    private QName name;
+
+    private boolean isSimpleType;
+
+    private TypeInfo baseType;
+
+    /**
+     * @param name
+     * @param isSimpleType
+     */
+    public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) {
+        super();
+        this.name = name;
+        this.isSimpleType = isSimpleType;
+        this.baseType = baseType;
+    }
+
+    /**
+     * @return the isSimpleType
+     */
+    public boolean isSimpleType() {
+        return isSimpleType;
+    }
+
+    /**
+     * @return the name
+     */
+    public QName getQName() {
+        return name;
+    }
+
+    /**
+     * @return the baseType
+     */
+    public TypeInfo getBaseType() {
+        return baseType;
+    }
+
+}

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java?view=auto&rev=449084
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java Fri Sep 22 13:48:58 2006
@@ -0,0 +1,117 @@
+/*
+ * 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.spi.idl;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.spi.model.DataType;
+
+/**
+ * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based Web Services (JAX-WS) 2.0
+ * specification, section 2.3.1.2 Wrapper Style.
+ * <p>
+ * A WSDL operation qualifies for wrapper style mapping only if the following criteria are met:
+ * <ul>
+ * <li>(i) The operation’s input and output messages (if present) each contain only a single part
+ * <li>(ii) The input message part refers to a global element declaration whose localname is equal to the operation
+ * name
+ * <li>(iii) The output message part refers to a global element declaration
+ * <li>(iv) The elements referred to by the input and output message parts (henceforth referred to as wrapper
+ * elements) are both complex types defined using the xsd:sequence compositor
+ * <li>(v) The wrapper elements only contain child elements, they must not contain other structures such as
+ * wildcards (element or attribute), xsd:choice, substitution groups (element references are not permitted) or
+ * attributes; furthermore, they must not be nillable.
+ * </ul>
+ */
+public class WrapperInfo {
+    private ElementInfo inputWrapperElement;
+
+    private ElementInfo outputWrapperElement;
+
+    private List<ElementInfo> inputChildElements;
+
+    private List<ElementInfo> outputChildElements;
+
+    private DataType<List<DataType<QName>>> unwrappedInputType;
+
+    private DataType<QName> unwrappedOutputType;
+
+    /**
+     * @param inputWrapperElement
+     * @param outputWrapperElement
+     * @param inputElements
+     * @param outputElements
+     * @param unwrappedInputType
+     * @param unwrappedOutputType
+     */
+    public WrapperInfo(ElementInfo inputWrapperElement, ElementInfo outputWrapperElement, List<ElementInfo> inputElements, List<ElementInfo> outputElements, DataType<List<DataType<QName>>> unwrappedInputType, DataType<QName> unwrappedOutputType) {
+        super();
+        this.inputWrapperElement = inputWrapperElement;
+        this.outputWrapperElement = outputWrapperElement;
+        this.inputChildElements = inputElements;
+        this.outputChildElements = outputElements;
+        this.unwrappedInputType = unwrappedInputType;
+        this.unwrappedOutputType = unwrappedOutputType;
+    }
+    
+    /**
+     * @return the inputElements
+     */
+    public List<ElementInfo> getInputChildElements() {
+        return inputChildElements;
+    }
+
+    /**
+     * @return the inputWrapperElement
+     */
+    public ElementInfo getInputWrapperElement() {
+        return inputWrapperElement;
+    }
+
+    /**
+     * @return the outputElements
+     */
+    public List<ElementInfo> getOutputChildElements() {
+        return outputChildElements;
+    }
+
+    /**
+     * @return the outputWrapperElement
+     */
+    public ElementInfo getOutputWrapperElement() {
+        return outputWrapperElement;
+    }
+
+    /**
+     * @return the unwrappedInputType
+     */
+    public DataType<List<DataType<QName>>> getUnwrappedInputType() {
+        return unwrappedInputType;
+    }
+
+    /**
+     * @return the unwrappedOutputType
+     */
+    public DataType<QName> getUnwrappedOutputType() {
+        return unwrappedOutputType;
+    }
+}
\ No newline at end of file

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/WrapperInfo.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java Fri Sep 22 13:48:58 2006
@@ -23,6 +23,8 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.tuscany.spi.idl.WrapperInfo;
+
 /**
  * Represents an operation that is part of a service contract. The type paramter of this operation identifies the
  * logical type system for all data types.
@@ -49,6 +51,9 @@
     private boolean callback;
 
     private String dataBinding;
+    
+    private boolean wrapperStyle;
+    private WrapperInfo wrapper;
 
     /**
      * Construct a minimally-specified operation
@@ -293,5 +298,38 @@
         }
     }
 
+    /**
+     * Returns true if the operation is wrapper style
+     * @return the wrapperStyle
+     */
+    public boolean isWrapperStyle() {
+        return wrapperStyle;
+    }
+    
+    /**
+     * Return the Wrapper information for this operation is it's wrapper style
+     * @return The Wrapper
+     */
+    public WrapperInfo getWrapper() {
+        if (!isWrapperStyle()) {
+            throw new IllegalStateException("The operation is not wrapper style.");
+        } else {
+            return wrapper;
+        }
+    }
+
+    /**
+     * @param wrapper the wrapper to set
+     */
+    public void setWrapper(WrapperInfo wrapper) {
+        this.wrapper = wrapper;
+    }
+
+    /**
+     * @param wrapperStyle the wrapperStyle to set
+     */
+    public void setWrapperStyle(boolean wrapperStyle) {
+        this.wrapperStyle = wrapperStyle;
+    }
 
 }

Modified: incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-axiom/pom.xml Fri Sep 22 13:48:58 2006
@@ -47,7 +47,13 @@
             <version>${pom.version}</version>
             <scope>compile</scope>
         </dependency>
-		<dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca.services.idl</groupId>
+            <artifactId>wsdl</artifactId>
+            <version>${pom.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
 			<groupId>org.apache.ws.commons.axiom</groupId>
 			<artifactId>axiom-api</artifactId>
 		</dependency>

Modified: incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java Fri Sep 22 13:48:58 2006
@@ -24,7 +24,7 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.Transformer;
 import org.apache.tuscany.databinding.extension.Java2SimpleTypeTransformer;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 import org.osoa.sca.annotations.Service;
 
 /**
@@ -40,7 +40,7 @@
         factory = OMAbstractFactory.getOMFactory();
     }
 
-    protected OMElement createElement(XmlSchemaElement element, String text, TransformationContext context) {
+    protected OMElement createElement(ElementInfo element, String text, TransformationContext context) {
         OMElement omElement = factory.createOMElement(element.getQName(), null);
         factory.createOMText(omElement, text);
         return omElement;

Modified: incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java Fri Sep 22 13:48:58 2006
@@ -26,7 +26,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.WrapperHandler;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 
 /**
  * OMElement wrapper handler implementation
@@ -40,12 +40,12 @@
         this.factory = OMAbstractFactory.getOMFactory();
     }
 
-    public OMElement create(XmlSchemaElement element, TransformationContext context) {
+    public OMElement create(ElementInfo element, TransformationContext context) {
         OMElement wrapper = factory.createOMElement(element.getQName(), null);
         return wrapper;
     }
 
-    public Object getChild(OMElement wrapper, int i, XmlSchemaElement element) {
+    public Object getChild(OMElement wrapper, int i, ElementInfo element) {
         int index = 0;
         for (Iterator e = wrapper.getChildElements(); e.hasNext();) {
             OMElement child = (OMElement) e.next();
@@ -59,7 +59,7 @@
         return null;
     }
 
-    public void setChild(OMElement wrapper, int i, XmlSchemaElement childElement, Object value) {
+    public void setChild(OMElement wrapper, int i, ElementInfo childElement, Object value) {
         wrapper.addChild((OMElement) value);
     }
 

Modified: incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementWrapperTransformerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementWrapperTransformerTestCase.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementWrapperTransformerTestCase.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-axiom/src/test/java/org/apache/tuscany/databinding/axiom/OMElementWrapperTransformerTestCase.java Fri Sep 22 13:48:58 2006
@@ -79,7 +79,8 @@
         Definition definition = registry.loadDefinition(null, url);
         PortType portType = definition.getPortType(PORTTYPE_NAME);
         Operation operation = portType.getOperation("checkOrderStatus", null, null);
-        WSDLOperation op = new WSDLOperation(operation, AxiomDataBinding.NAME, registry.getSchemaRegistry());
+        WSDLOperation wsdlOp = new WSDLOperation(operation, AxiomDataBinding.NAME, registry.getSchemaRegistry());
+        org.apache.tuscany.spi.model.Operation<?> op = wsdlOp.getOperation();
         Assert.assertTrue(op.isWrapperStyle());
 
         MediatorImpl m = new MediatorImpl();
@@ -115,8 +116,8 @@
 
         TransformationContext context1 = new TransformationContextImpl();
         DataType<DataType> sourceType = new DataType<DataType>("idl:output", Object.class, op.getOutputType());
-        sourceType.setMetadata(WSDLOperation.class.getName(), op.getOutputType().getMetadata(
-                WSDLOperation.class.getName()));
+        sourceType.setMetadata(org.apache.tuscany.spi.model.Operation.class.getName(), op.getOutputType().getMetadata(
+                org.apache.tuscany.spi.model.Operation.class.getName()));
         
         context1.setSourceDataType(sourceType);
         DataType<DataType> targetType =

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/pom.xml?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/pom.xml (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/pom.xml Fri Sep 22 13:48:58 2006
@@ -39,14 +39,8 @@
             <groupId>org.apache.tuscany.sca.services.idl</groupId>
             <artifactId>wsdl</artifactId>
             <version>${pom.version}</version>
-            <scope>compile</scope>
+            <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons</groupId>
-            <artifactId>XmlSchema</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
         <dependency>
             <groupId>woodstox</groupId>
             <artifactId>wstx-asl</artifactId>

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/Java2SimpleTypeTransformer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/Java2SimpleTypeTransformer.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/Java2SimpleTypeTransformer.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/Java2SimpleTypeTransformer.java Fri Sep 22 13:48:58 2006
@@ -21,8 +21,8 @@
 import org.apache.tuscany.databinding.PullTransformer;
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.SimpleTypeMapper;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.ElementInfo;
+import org.apache.tuscany.spi.idl.TypeInfo;
 
 /**
  * Transformer to convert data from a simple java object to a databinding's representation
@@ -41,9 +41,9 @@
     }
 
     public T transform(Object source, TransformationContext context) {
-        XmlSchemaElement element =
-                (XmlSchemaElement) context.getTargetDataType().getMetadata(XmlSchemaElement.class.getName());
-        XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType) element.getSchemaType();
+        ElementInfo element =
+                (ElementInfo) context.getTargetDataType().getMetadata(ElementInfo.class.getName());
+        TypeInfo simpleType = (TypeInfo) element.getType();
         String text = mapper.toXMLLiteral(simpleType, source, context);
         return createElement(element, text, context);
     }
@@ -56,6 +56,6 @@
         return 10;
     }
 
-    protected abstract T createElement(XmlSchemaElement element, String literal, TransformationContext context);
+    protected abstract T createElement(ElementInfo element, String literal, TransformationContext context);
 
 }

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleType2JavaTransformer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleType2JavaTransformer.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleType2JavaTransformer.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleType2JavaTransformer.java Fri Sep 22 13:48:58 2006
@@ -21,8 +21,8 @@
 import org.apache.tuscany.databinding.PullTransformer;
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.SimpleTypeMapper;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.ElementInfo;
+import org.apache.tuscany.spi.idl.TypeInfo;
 
 /**
  * Transformer to convert data from a databinding's representation of simple types to Java Objects
@@ -41,9 +41,9 @@
     }
 
     public Object transform(T source, TransformationContext context) {
-        XmlSchemaElement element =
-                (XmlSchemaElement) context.getSourceDataType().getMetadata(XmlSchemaElement.class.getName());
-        XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType) element.getSchemaType();
+        ElementInfo element =
+                (ElementInfo) context.getSourceDataType().getMetadata(ElementInfo.class.getName());
+        TypeInfo simpleType = (TypeInfo) element.getType();
         return mapper.toJavaObject(simpleType, getText(source), context);
     }
 

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtension.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtension.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtension.java Fri Sep 22 13:48:58 2006
@@ -19,34 +19,6 @@
 
 package org.apache.tuscany.databinding.extension;
 
-import static org.apache.ws.commons.schema.constants.Constants.XSD_BASE64;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_BOOLEAN;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_BYTE;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DATE;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DATETIME;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DAY;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DECIMAL;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DOUBLE;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_DURATION;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_FLOAT;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_HEXBIN;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_INT;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_INTEGER;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_LONG;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_MONTH;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_MONTHDAY;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_NOTATION;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_QNAME;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_SHORT;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_STRING;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_TIME;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_UNSIGNEDBYTE;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_UNSIGNEDINT;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_UNSIGNEDLONG;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_UNSIGNEDSHORT;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_YEAR;
-import static org.apache.ws.commons.schema.constants.Constants.XSD_YEARMONTH;
-
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
@@ -61,14 +33,62 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.SimpleTypeMapper;
 import org.apache.tuscany.databinding.util.XSDDataTypeConverter;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.TypeInfo;
 
 public class SimpleTypeMapperExtension extends XSDDataTypeConverter implements SimpleTypeMapper {
     private DatatypeFactory factory;
 
     public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
-
+    public static final QName XSD_STRING = new QName(URI_2001_SCHEMA_XSD, "string");
+    public static final QName XSD_BOOLEAN = new QName(URI_2001_SCHEMA_XSD, "boolean");
+    public static final QName XSD_DOUBLE = new QName(URI_2001_SCHEMA_XSD, "double");
+    public static final QName XSD_FLOAT = new QName(URI_2001_SCHEMA_XSD, "float");
+    public static final QName XSD_INT = new QName(URI_2001_SCHEMA_XSD, "int");
+    public static final QName XSD_INTEGER = new QName(URI_2001_SCHEMA_XSD, "integer");
+    public static final QName XSD_LONG = new QName(URI_2001_SCHEMA_XSD, "long");
+    public static final QName XSD_SHORT = new QName(URI_2001_SCHEMA_XSD, "short");
+    public static final QName XSD_BYTE = new QName(URI_2001_SCHEMA_XSD, "byte");
+    public static final QName XSD_DECIMAL = new QName(URI_2001_SCHEMA_XSD, "decimal");
+    public static final QName XSD_BASE64 = new QName(URI_2001_SCHEMA_XSD, "base64Binary");
+    public static final QName XSD_HEXBIN = new QName(URI_2001_SCHEMA_XSD, "hexBinary");
+    public static final QName XSD_ANYSIMPLETYPE = new QName(URI_2001_SCHEMA_XSD, "anySimpleType");
+    public static final QName XSD_ANYTYPE = new QName(URI_2001_SCHEMA_XSD, "anyType");
+    public static final QName XSD_ANY = new QName(URI_2001_SCHEMA_XSD, "any");
+    public static final QName XSD_QNAME = new QName(URI_2001_SCHEMA_XSD, "QName");
+    public static final QName XSD_DATETIME = new QName(URI_2001_SCHEMA_XSD, "dateTime");
+    public static final QName XSD_DATE = new QName(URI_2001_SCHEMA_XSD, "date");
+    public static final QName XSD_TIME = new QName(URI_2001_SCHEMA_XSD, "time");
+
+    public static final QName XSD_NORMALIZEDSTRING = new QName(URI_2001_SCHEMA_XSD, "normalizedString");
+    public static final QName XSD_TOKEN = new QName(URI_2001_SCHEMA_XSD, "token");
+
+    public static final QName XSD_UNSIGNEDLONG = new QName(URI_2001_SCHEMA_XSD, "unsignedLong");
+    public static final QName XSD_UNSIGNEDINT = new QName(URI_2001_SCHEMA_XSD, "unsignedInt");
+    public static final QName XSD_UNSIGNEDSHORT = new QName(URI_2001_SCHEMA_XSD, "unsignedShort");
+    public static final QName XSD_UNSIGNEDBYTE = new QName(URI_2001_SCHEMA_XSD, "unsignedByte");
+    public static final QName XSD_POSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "positiveInteger");
+    public static final QName XSD_NEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "negativeInteger");
+    public static final QName XSD_NONNEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonNegativeInteger");
+    public static final QName XSD_NONPOSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonPositiveInteger");
+
+    public static final QName XSD_YEARMONTH = new QName(URI_2001_SCHEMA_XSD, "gYearMonth");
+    public static final QName XSD_MONTHDAY = new QName(URI_2001_SCHEMA_XSD, "gMonthDay");
+    public static final QName XSD_YEAR = new QName(URI_2001_SCHEMA_XSD, "gYear");
+    public static final QName XSD_MONTH = new QName(URI_2001_SCHEMA_XSD, "gMonth");
+    public static final QName XSD_DAY = new QName(URI_2001_SCHEMA_XSD, "gDay");
+    public static final QName XSD_DURATION = new QName(URI_2001_SCHEMA_XSD, "duration");
+
+    public static final QName XSD_NAME = new QName(URI_2001_SCHEMA_XSD, "Name");
+    public static final QName XSD_NCNAME = new QName(URI_2001_SCHEMA_XSD, "NCName");
+    public static final QName XSD_NMTOKEN = new QName(URI_2001_SCHEMA_XSD, "NMTOKEN");
+    public static final QName XSD_NMTOKENS = new QName(URI_2001_SCHEMA_XSD, "NMTOKENS");
+    public static final QName XSD_NOTATION = new QName(URI_2001_SCHEMA_XSD, "NOTATION");
+    public static final QName XSD_ENTITY = new QName(URI_2001_SCHEMA_XSD, "ENTITY");
+    public static final QName XSD_ENTITIES = new QName(URI_2001_SCHEMA_XSD, "ENTITIES");
+    public static final QName XSD_IDREF = new QName(URI_2001_SCHEMA_XSD, "IDREF");
+    public static final QName XSD_IDREFS = new QName(URI_2001_SCHEMA_XSD, "IDREFS");
+    public static final QName XSD_ANYURI = new QName(URI_2001_SCHEMA_XSD, "anyURI");
+    
     private static final String[] typeNames =
             { "string", "boolean", "double", "float", "int", "integer", "long", "short", "byte", "decimal",
                     "base64Binary", "hexBinary", "anySimpleType", "anyType", "any", "QName", "dateTime", "date",
@@ -77,16 +97,12 @@
                     "gYearMonth", "gMonthDay", "gYear", "gMonth", "gDay", "duration", "Name", "NCName", "NMTOKEN",
                     "NMTOKENS", "NOTATION", "ENTITY", "ENTITIES", "IDREF", "IDREFS", "anyURI", "language", "ID" };
 
-    public static final Map<String, XmlSchemaSimpleType> XSD_SIMPLE_TYPES = new HashMap<String, XmlSchemaSimpleType>();
+    public static final Map<String, TypeInfo> XSD_SIMPLE_TYPES = new HashMap<String, TypeInfo>();
 
     static {
-        XmlSchemaCollection collection = new XmlSchemaCollection();
         for (String type : typeNames) {
-            XmlSchemaSimpleType simpleType =
-                    (XmlSchemaSimpleType) collection.getTypeByQName(new QName(URI_2001_SCHEMA_XSD, type));
-            if (simpleType != null) {
-                XSD_SIMPLE_TYPES.put(type, simpleType);
-            }
+            TypeInfo simpleType = new TypeInfo(new QName(URI_2001_SCHEMA_XSD, type), true, null);
+            XSD_SIMPLE_TYPES.put(type, simpleType);
         }
     }
 
@@ -99,7 +115,7 @@
         }
     }
 
-    public Object toJavaObject(XmlSchemaSimpleType simpleType, String value, TransformationContext context) {
+    public Object toJavaObject(TypeInfo simpleType, String value, TransformationContext context) {
         /**
          * <ul>
          * <li>xsd:string --- java.lang.String
@@ -129,9 +145,9 @@
          * </ul>
          */
 
-        XmlSchemaSimpleType baseType = simpleType;
-        while (baseType.getBaseSchemaType() != null) {
-            baseType = (XmlSchemaSimpleType) baseType.getBaseSchemaType();
+        TypeInfo baseType = simpleType;
+        while (baseType.getBaseType() != null) {
+            baseType = (TypeInfo) baseType.getBaseType();
         }
         QName type = baseType.getQName();
         if (type.equals(XSD_STRING)) {
@@ -178,11 +194,11 @@
             return parseBase64Binary(value);
         } else if (type.equals(XSD_QNAME)) {
             NamespaceContext namespaceContext =
-                (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
+                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
             return parseQName(value, namespaceContext);
         } else if (type.equals(XSD_NOTATION)) {
             NamespaceContext namespaceContext =
-                (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
+                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
             return parseQName(value, namespaceContext);
         } else if (type.equals(XSD_YEAR)) {
             return factory.newXMLGregorianCalendar(value);
@@ -199,7 +215,7 @@
         }
     }
 
-    public String toXMLLiteral(XmlSchemaSimpleType simpleType, Object obj, TransformationContext context) {
+    public String toXMLLiteral(TypeInfo simpleType, Object obj, TransformationContext context) {
         if (obj instanceof Float || obj instanceof Double) {
             if (obj instanceof Float) {
                 return printDouble(((Float) obj).floatValue());
@@ -220,10 +236,10 @@
             } else if (simpleType.getQName().equals(XSD_HEXBIN)) {
                 return printHexBinary((byte[]) obj);
             }
-        } else if(obj instanceof QName) {
+        } else if (obj instanceof QName) {
             NamespaceContext namespaceContext =
-                (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
-           return printQName((QName) obj, namespaceContext);
+                    (NamespaceContext) ((context != null) ? context.getMetadata().get(NamespaceContext.class) : null);
+            return printQName((QName) obj, namespaceContext);
         }
         return obj.toString();
     }

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Input2InputTransformer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Input2InputTransformer.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Input2InputTransformer.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Input2InputTransformer.java Fri Sep 22 13:48:58 2006
@@ -31,10 +31,11 @@
 import org.apache.tuscany.databinding.TransformationException;
 import org.apache.tuscany.databinding.Transformer;
 import org.apache.tuscany.databinding.extension.TransformerExtension;
-import org.apache.tuscany.idl.wsdl.WSDLOperation;
 import org.apache.tuscany.spi.annotation.Autowire;
+import org.apache.tuscany.spi.idl.ElementInfo;
+import org.apache.tuscany.spi.idl.WrapperInfo;
 import org.apache.tuscany.spi.model.DataType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.model.Operation;
 import org.osoa.sca.annotations.Service;
 
 /**
@@ -106,7 +107,7 @@
     @SuppressWarnings("unchecked")
     public Object[] transform(Object[] source, TransformationContext context) {
         DataType<List<DataType<?>>> sourceType = context.getSourceDataType();
-        WSDLOperation sourceOp = (WSDLOperation) sourceType.getMetadata(WSDLOperation.class.getName());
+        Operation<?> sourceOp = (Operation<?>) sourceType.getMetadata(Operation.class.getName());
         boolean sourceWrapped = (sourceOp != null && sourceOp.isWrapperStyle());
 
         WrapperHandler sourceWrapperHandler = null;
@@ -115,7 +116,7 @@
         }
 
         DataType<List<DataType<QName>>> targetType = context.getTargetDataType();
-        WSDLOperation targetOp = (WSDLOperation) targetType.getMetadata(WSDLOperation.class.getName());
+        Operation<?> targetOp = (Operation<?>) targetType.getMetadata(Operation.class.getName());
         boolean targetWrapped = (targetOp != null && targetOp.isWrapperStyle());
         WrapperHandler targetWrapperHandler = null;
         if (targetWrapped) {
@@ -124,14 +125,14 @@
 
         if ((!sourceWrapped) && targetWrapped) {
             // Unwrapped --> Wrapped
-            WSDLOperation.Wrapper wrapper = targetOp.getWrapper();
-            XmlSchemaElement wrapperElement = wrapper.getInputWrapperElement();
+            WrapperInfo wrapper = targetOp.getWrapper();
+            ElementInfo wrapperElement = wrapper.getInputWrapperElement();
 
             // If the source can be wrapped, wrapped it first
             if (sourceWrapperHandler != null) {
                 Object sourceWrapper = sourceWrapperHandler.create(wrapperElement, context);
                 for (int i = 0; i < source.length; i++) {
-                    XmlSchemaElement argElement = wrapper.getInputChildElements().get(i);
+                    ElementInfo argElement = wrapper.getInputChildElements().get(i);
                     sourceWrapperHandler.setChild(sourceWrapper, i, argElement, source[0]);
                 }
             }
@@ -142,7 +143,7 @@
             List<DataType<QName>> argTypes = wrapper.getUnwrappedInputType().getLogical();
 
             for (int i = 0; i < source.length; i++) {
-                XmlSchemaElement argElement = wrapper.getInputChildElements().get(i);
+                ElementInfo argElement = wrapper.getInputChildElements().get(i);
                 DataType<QName> argType = argTypes.get(i);
                 Object child = source[i];
                 child = mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata());
@@ -152,12 +153,12 @@
         } else if (sourceWrapped && (!targetWrapped)) {
             // Wrapped to Unwrapped
             Object sourceWrapper = source[0];
-            List<XmlSchemaElement> childElements = sourceOp.getWrapper().getInputChildElements();
+            List<ElementInfo> childElements = sourceOp.getWrapper().getInputChildElements();
             Object[] target = new Object[childElements.size()];
 
             targetWrapperHandler = getWapperHandler(targetType.getLogical().get(0).getDataBinding(), false);
             if (targetWrapperHandler != null) {
-                XmlSchemaElement wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
+                ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
                 // Object targetWrapper = targetWrapperHandler.create(wrapperElement, context);
                 DataType<QName> targetWrapperType =
                         new DataType<QName>(targetType.getLogical().get(0).getDataBinding(), Object.class,
@@ -166,12 +167,12 @@
                         mediator.mediate(sourceWrapper, sourceType.getLogical().get(0), targetWrapperType, context
                                 .getMetadata());
                 for (int i = 0; i < childElements.size(); i++) {
-                    XmlSchemaElement childElement = childElements.get(i);
+                    ElementInfo childElement = childElements.get(i);
                     target[i] = targetWrapperHandler.getChild(targetWrapper, i, childElement);
                 }
             } else {
                 for (int i = 0; i < childElements.size(); i++) {
-                    XmlSchemaElement childElement = childElements.get(i);
+                    ElementInfo childElement = childElements.get(i);
                     Object child = sourceWrapperHandler.getChild(sourceWrapper, i, childElement);
                     DataType<QName> childType = sourceOp.getWrapper().getUnwrappedInputType().getLogical().get(i);
                     target[i] =

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Output2OutputTransformer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Output2OutputTransformer.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Output2OutputTransformer.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/Output2OutputTransformer.java Fri Sep 22 13:48:58 2006
@@ -31,11 +31,11 @@
 import org.apache.tuscany.databinding.TransformationException;
 import org.apache.tuscany.databinding.Transformer;
 import org.apache.tuscany.databinding.extension.TransformerExtension;
-import org.apache.tuscany.idl.wsdl.WSDLOperation;
 import org.apache.tuscany.spi.annotation.Autowire;
-import org.apache.tuscany.spi.idl.InvalidServiceContractException;
+import org.apache.tuscany.spi.idl.ElementInfo;
+import org.apache.tuscany.spi.idl.WrapperInfo;
 import org.apache.tuscany.spi.model.DataType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.model.Operation;
 import org.osoa.sca.annotations.Service;
 
 /**
@@ -106,13 +106,9 @@
         return 10;
     }
 
-    private WrapperHandler getWapperHandler(WSDLOperation sourceOp) {
+    private WrapperHandler getWapperHandler(Operation<?> operation) {
         String dataBindingId;
-        try {
-            dataBindingId = sourceOp.getOperation().getDataBinding();
-        } catch (InvalidServiceContractException e) {
-            throw new TransformationException(e);
-        }
+        dataBindingId = operation.getDataBinding();
         DataBinding dataBinding = dataBindingRegistry.getDataBinding(dataBindingId);
         WrapperHandler wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler();
         if (wrapperHandler == null) {
@@ -130,7 +126,7 @@
     public Object transform(Object response, TransformationContext context) {
         try {
             DataType<DataType> sourceType = context.getSourceDataType();
-            WSDLOperation sourceOp = (WSDLOperation) sourceType.getMetadata(WSDLOperation.class.getName());
+            Operation<?> sourceOp = (Operation<?>) sourceType.getMetadata(Operation.class.getName());
             boolean sourceWrapped = (sourceOp != null && sourceOp.isWrapperStyle());
             WrapperHandler sourceWrapperHandler = null;
             if (sourceWrapped) {
@@ -138,7 +134,7 @@
             }
 
             DataType<DataType> targetType = context.getTargetDataType();
-            WSDLOperation targetOp = (WSDLOperation) targetType.getMetadata(WSDLOperation.class.getName());
+            Operation<?> targetOp = (Operation<?>) targetType.getMetadata(Operation.class.getName());
             boolean targetWrapped = (targetOp != null && targetOp.isWrapperStyle());
             WrapperHandler targetWrapperHandler = null;
             if (targetWrapped) {
@@ -147,13 +143,13 @@
 
             if ((!sourceWrapped) && targetWrapped) {
                 // Unwrapped --> Wrapped
-                WSDLOperation.Wrapper wrapper = targetOp.getWrapper();
+                WrapperInfo wrapper = targetOp.getWrapper();
                 Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context);
                 if (response == null) {
                     return targetWrapper;
                 }
 
-                XmlSchemaElement argElement = wrapper.getOutputChildElements().get(0);
+                ElementInfo argElement = wrapper.getOutputChildElements().get(0);
                 DataType<QName> argType = wrapper.getUnwrappedOutputType();
                 Object child = response;
                 child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata());
@@ -162,12 +158,12 @@
             } else if (sourceWrapped && (!targetWrapped)) {
                 // Wrapped to Unwrapped
                 Object sourceWrapper = response;
-                List<XmlSchemaElement> childElements = sourceOp.getWrapper().getOutputChildElements();
-                XmlSchemaElement childElement = childElements.get(0);
+                List<ElementInfo> childElements = sourceOp.getWrapper().getOutputChildElements();
+                ElementInfo childElement = childElements.get(0);
 
                 targetWrapperHandler = getWapperHandler(targetType.getLogical().getDataBinding());
                 if (targetWrapperHandler != null) {
-                    XmlSchemaElement wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
+                    ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement();
                     // Object targetWrapper = targetWrapperHandler.create(wrapperElement, context);
                     DataType<QName> targetWrapperType =
                             new DataType<QName>(targetType.getLogical().getDataBinding(), Object.class, wrapperElement

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/SimpleTypeMapper.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/SimpleTypeMapper.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/SimpleTypeMapper.java Fri Sep 22 13:48:58 2006
@@ -20,7 +20,7 @@
 package org.apache.tuscany.databinding.idl;
 
 import org.apache.tuscany.databinding.TransformationContext;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.TypeInfo;
 
 /**
  * Type Mapper between XML schema simple data types and java objects
@@ -33,7 +33,7 @@
      * @param context The context of the transformation
      * @return A java object for the XML value
      */
-    Object toJavaObject(XmlSchemaSimpleType simpleType, String value, TransformationContext context);
+    Object toJavaObject(TypeInfo simpleType, String value, TransformationContext context);
     /**
      * Create the XML lexical representation for a java object
      * @param simpleType The XSD simple type
@@ -41,5 +41,5 @@
      * @param context The context of the transformation
      * @return The XML lexical representation
      */
-    String toXMLLiteral(XmlSchemaSimpleType simpleType, Object obj, TransformationContext context);
+    String toXMLLiteral(TypeInfo simpleType, Object obj, TransformationContext context);
 }

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/WrapperHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/WrapperHandler.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/WrapperHandler.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/idl/WrapperHandler.java Fri Sep 22 13:48:58 2006
@@ -20,7 +20,7 @@
 package org.apache.tuscany.databinding.idl;
 
 import org.apache.tuscany.databinding.TransformationContext;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 
 /**
  * A contract for transformers to deal with wrapping/unwrapping for WSDL wrapper style operations
@@ -33,7 +33,7 @@
      * @param context The transformation context
      * @return An object representing the wrapper element
      */
-    T create(XmlSchemaElement element, TransformationContext context);
+    T create(ElementInfo element, TransformationContext context);
 
     /**
      * Set child element for the wrapper
@@ -43,7 +43,7 @@
      * @param childElement The XSD element
      * @param value The value of the child
      */
-    void setChild(T wrapper, int i, XmlSchemaElement childElement, Object value);
+    void setChild(T wrapper, int i, ElementInfo childElement, Object value);
 
     /**
      * Get child element from the wrapper
@@ -53,5 +53,5 @@
      * @param element The XSD element
      * @return The value of the child
      */
-    Object getChild(T wrapper, int i, XmlSchemaElement element);
+    Object getChild(T wrapper, int i, ElementInfo element);
 }

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/impl/DataBindingInteceptor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/impl/DataBindingInteceptor.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/impl/DataBindingInteceptor.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/impl/DataBindingInteceptor.java Fri Sep 22 13:48:58 2006
@@ -23,7 +23,6 @@
 import java.util.Map;
 
 import org.apache.tuscany.databinding.Mediator;
-import org.apache.tuscany.idl.wsdl.WSDLOperation;
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.model.DataType;
 import org.apache.tuscany.spi.model.Operation;
@@ -79,12 +78,13 @@
             // FIXME: Should we fix the Operation model so that getOutputType returns DataType<DataType<T>>?
             DataType<DataType> targetType =
                     new DataType<DataType>("idl:output", Object.class, targetOperation.getOutputType());
-            targetType.setMetadata(WSDLOperation.class.getName(), targetOperation.getOutputType().getMetadata(
-                    WSDLOperation.class.getName()));
+            
+            targetType.setMetadata(Operation.class.getName(), targetOperation.getOutputType().getMetadata(
+                    Operation.class.getName()));
             DataType<DataType> sourceType =
                     new DataType<DataType>("idl:output", Object.class, sourceOperation.getOutputType());
-            sourceType.setMetadata(WSDLOperation.class.getName(), sourceOperation.getOutputType().getMetadata(
-                    WSDLOperation.class.getName()));
+            sourceType.setMetadata(Operation.class.getName(), sourceOperation.getOutputType().getMetadata(
+                    Operation.class.getName()));
 
             result = transform(result, targetType, sourceType);
             resultMsg.setBody(result);

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/DOMWrapperHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/DOMWrapperHandler.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/DOMWrapperHandler.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/DOMWrapperHandler.java Fri Sep 22 13:48:58 2006
@@ -25,7 +25,7 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.TransformationException;
 import org.apache.tuscany.databinding.idl.WrapperHandler;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -43,12 +43,12 @@
         }
     }
 
-    public Node create(XmlSchemaElement element, TransformationContext context) {
+    public Node create(ElementInfo element, TransformationContext context) {
         QName name = element.getQName();
         return DOMHelper.createElement(document, name);
     }
 
-    public Object getChild(Node wrapper, int i, XmlSchemaElement element) {
+    public Object getChild(Node wrapper, int i, ElementInfo element) {
         int index = 0;
         NodeList nodes = wrapper.getChildNodes();
         for (int j = 0; j < nodes.getLength(); j++) {
@@ -68,7 +68,7 @@
         return null;
     }
 
-    public void setChild(Node wrapper, int i, XmlSchemaElement childElement, Object value) {
+    public void setChild(Node wrapper, int i, ElementInfo childElement, Object value) {
         Node node = (Node) value;
         if (node.getNodeType() == Node.DOCUMENT_NODE) {
             node = ((Document) node).getDocumentElement();

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/Object2Node.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/Object2Node.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/Object2Node.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/main/java/org/apache/tuscany/databinding/xml/Object2Node.java Fri Sep 22 13:48:58 2006
@@ -25,7 +25,7 @@
 import org.apache.tuscany.databinding.TransformationException;
 import org.apache.tuscany.databinding.Transformer;
 import org.apache.tuscany.databinding.extension.Java2SimpleTypeTransformer;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 import org.osoa.sca.annotations.Service;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -47,7 +47,7 @@
         }
     }
 
-    protected Node createElement(XmlSchemaElement element, String text, TransformationContext context) {
+    protected Node createElement(ElementInfo element, String text, TransformationContext context) {
         QName name = element.getQName();
         Node root = DOMHelper.createElement(factory, name);
         root.appendChild(factory.createTextNode(text));

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtensionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtensionTestCase.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtensionTestCase.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/extension/SimpleTypeMapperExtensionTestCase.java Fri Sep 22 13:48:58 2006
@@ -28,7 +28,7 @@
 
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.impl.TransformationContextImpl;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.TypeInfo;
 import org.easymock.EasyMock;
 
 /**
@@ -87,8 +87,8 @@
         EasyMock.expect(namespaceContext.getPrefix(EasyMock.eq("http://foo"))).andReturn("f").anyTimes();
         EasyMock.replay(namespaceContext);
         context.getMetadata().put(NamespaceContext.class, namespaceContext);
-        for (XmlSchemaSimpleType simpleType : SimpleTypeMapperExtension.XSD_SIMPLE_TYPES.values()) {
-            String name = simpleType.getName();
+        for (TypeInfo simpleType : SimpleTypeMapperExtension.XSD_SIMPLE_TYPES.values()) {
+            String name = simpleType.getQName().getLocalPart();
             Object value = sampleValues.get(name);
             if (value instanceof String[]) {
                 for (String s : (String[]) value) {

Modified: incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/idl/IDLTransformerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/idl/IDLTransformerTestCase.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/idl/IDLTransformerTestCase.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-framework/src/test/java/org/apache/tuscany/databinding/idl/IDLTransformerTestCase.java Fri Sep 22 13:48:58 2006
@@ -82,7 +82,8 @@
         Definition definition = registry.loadDefinition(null, url);
         PortType portType = definition.getPortType(PORTTYPE_NAME);
         Operation operation = portType.getOperation("checkOrderStatus", null, null);
-        WSDLOperation op = new WSDLOperation(operation, Node.class.getName(), registry.getSchemaRegistry());
+        WSDLOperation wsdlOp = new WSDLOperation(operation, Node.class.getName(), registry.getSchemaRegistry());
+        org.apache.tuscany.spi.model.Operation<?> op = wsdlOp.getOperation();
         assertTrue(op.isWrapperStyle());
 
         MediatorImpl m = new MediatorImpl();
@@ -119,8 +120,8 @@
 
         TransformationContext context1 = new TransformationContextImpl();
         DataType<DataType> sourceType = new DataType<DataType>("idl:output", Object.class, op.getOutputType());
-        sourceType.setMetadata(WSDLOperation.class.getName(), op.getOutputType().getMetadata(
-                WSDLOperation.class.getName()));
+        sourceType.setMetadata(org.apache.tuscany.spi.model.Operation.class.getName(), op.getOutputType().getMetadata(
+                org.apache.tuscany.spi.model.Operation.class.getName()));
         
         context1.setSourceDataType(sourceType);
         DataType<DataType> targetType =

Modified: incubator/tuscany/java/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java Fri Sep 22 13:48:58 2006
@@ -31,14 +31,14 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.TransformationException;
 import org.apache.tuscany.databinding.idl.WrapperHandler;
-import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.tuscany.spi.idl.ElementInfo;
 
 /**
  * JAXB WrapperHandler implementation
  */
 public class JAXBWrapperHandler implements WrapperHandler<JAXBElement<?>> {
 
-    public JAXBElement<?> create(XmlSchemaElement element, TransformationContext context) {
+    public JAXBElement<?> create(ElementInfo element, TransformationContext context) {
         try {
             String packageName = null;
             String factoryClassName = packageName + ".ObjectFactory";
@@ -67,7 +67,7 @@
         }
     }
 
-    public Object getChild(JAXBElement<?> wrapper, int i, XmlSchemaElement element) {
+    public Object getChild(JAXBElement<?> wrapper, int i, ElementInfo element) {
         try {
             Object value = wrapper.getValue();
             PropertyDescriptor descriptors[] =
@@ -83,7 +83,7 @@
         }
     }
 
-    public void setChild(JAXBElement<?> wrapper, int i, XmlSchemaElement childElement, Object value) {
+    public void setChild(JAXBElement<?> wrapper, int i, ElementInfo childElement, Object value) {
         try {
             Object wrapperValue = wrapper.getValue();
             PropertyDescriptor descriptors[] =

Modified: incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java Fri Sep 22 13:48:58 2006
@@ -24,7 +24,7 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.SimpleTypeMapper;
 import org.apache.tuscany.sdo.util.SDOUtil;
-import org.apache.ws.commons.schema.XmlSchemaSimpleType;
+import org.apache.tuscany.spi.idl.TypeInfo;
 
 import commonj.sdo.Type;
 import commonj.sdo.helper.TypeHelper;
@@ -39,7 +39,7 @@
         super();
     }
 
-    public Object toJavaObject(XmlSchemaSimpleType simpleType, String value, TransformationContext context) {
+    public Object toJavaObject(TypeInfo simpleType, String value, TransformationContext context) {
         QName typeName = simpleType.getQName();
         Type type = null;
         if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {
@@ -51,7 +51,7 @@
         return SDOUtil.createFromString(type, value);
     }
 
-    public String toXMLLiteral(XmlSchemaSimpleType simpleType, Object obj, TransformationContext context) {
+    public String toXMLLiteral(TypeInfo simpleType, Object obj, TransformationContext context) {
         QName typeName = simpleType.getQName();
         Type type = null;
         if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) {

Modified: incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java (original)
+++ incubator/tuscany/java/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java Fri Sep 22 13:48:58 2006
@@ -24,8 +24,8 @@
 import org.apache.tuscany.databinding.TransformationContext;
 import org.apache.tuscany.databinding.idl.WrapperHandler;
 import org.apache.tuscany.sdo.util.SDOUtil;
+import org.apache.tuscany.spi.idl.ElementInfo;
 import org.apache.tuscany.spi.model.DataType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.helper.DataFactory;
@@ -39,10 +39,10 @@
 public class SDOWrapperHandler implements WrapperHandler<Object> {
 
     /**
-     * @see org.apache.tuscany.databinding.idl.WrapperHandler#create(org.apache.ws.commons.schema.XmlSchemaElement,
+     * @see org.apache.tuscany.databinding.idl.WrapperHandler#create(ElementInfo,
      *      TransformationContext)
      */
-    public Object create(XmlSchemaElement element, TransformationContext context) {
+    public Object create(ElementInfo element, TransformationContext context) {
         TypeHelper typeHelper = TypeHelper.INSTANCE;
         if (context != null) {
             DataType targetType = context.getTargetDataType();
@@ -53,7 +53,7 @@
                 }
             }
         }
-        QName typeName = element.getSchemaTypeName();
+        QName typeName = element.getType().getQName();
         DataFactory dataFactory = SDOUtil.createDataFactory(typeHelper);
         DataObject root = dataFactory.create(typeName.getNamespaceURI(), typeName.getLocalPart());
         XMLHelper xmlHelper = SDOUtil.createXMLHelper(typeHelper);
@@ -62,22 +62,22 @@
 
     /**
      * @see org.apache.tuscany.databinding.idl.WrapperHandler#getChild(java.lang.Object, int,
-     *      org.apache.ws.commons.schema.XmlSchemaElement)
+     *      ElementInfo)
      */
-    public Object getChild(Object wrapper, int i, XmlSchemaElement element) {
+    public Object getChild(Object wrapper, int i, ElementInfo element) {
         DataObject wrapperDO =
                 (wrapper instanceof XMLDocument) ? ((XMLDocument) wrapper).getRootObject() : (DataObject) wrapper;
-        return wrapperDO.get(element.getName());
+        return wrapperDO.get(element.getQName().getLocalPart());
     }
 
     /**
      * @see org.apache.tuscany.databinding.idl.WrapperHandler#setChild(java.lang.Object, int,
-     *      org.apache.ws.commons.schema.XmlSchemaElement, java.lang.Object)
+     *      ElementInfo, java.lang.Object)
      */
-    public void setChild(Object wrapper, int i, XmlSchemaElement childElement, Object value) {
+    public void setChild(Object wrapper, int i, ElementInfo childElement, Object value) {
         DataObject wrapperDO =
                 (wrapper instanceof XMLDocument) ? ((XMLDocument) wrapper).getRootObject() : (DataObject) wrapper;
-        wrapperDO.set(childElement.getName(), value);
+        wrapperDO.set(childElement.getQName().getLocalPart(), value);
     }
 
 }

Modified: incubator/tuscany/java/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java (original)
+++ incubator/tuscany/java/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java Fri Sep 22 13:48:58 2006
@@ -32,7 +32,10 @@
 import javax.wsdl.Part;
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.spi.idl.ElementInfo;
 import org.apache.tuscany.spi.idl.InvalidServiceContractException;
+import org.apache.tuscany.spi.idl.TypeInfo;
+import org.apache.tuscany.spi.idl.WrapperInfo;
 import org.apache.tuscany.spi.model.DataType;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
@@ -40,12 +43,15 @@
 import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
 import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
 /**
  * Metadata for a WSDL operation
  */
 public class WSDLOperation {
+    private static final String OPERATION_KEY = org.apache.tuscany.spi.model.Operation.class.getName();
+
     protected XMLSchemaRegistry schemaRegistry;
 
     protected Operation operation;
@@ -108,7 +114,7 @@
             Input input = operation.getInput();
             Message message = (input == null) ? null : input.getMessage();
             inputType = getMessageType(message);
-            inputType.setMetadata(WSDLOperation.class.getName(), this);
+            // inputType.setMetadata(WSDLOperation.class.getName(), this);
             inputType.setDataBinding("idl:input");
         }
         return inputType;
@@ -131,7 +137,7 @@
                 }
                 Part part = (Part) outputParts.get(0);
                 outputType = new WSDLPart(part).getDataType();
-                outputType.setMetadata(WSDLOperation.class.getName(), this);
+                // outputType.setMetadata(WSDLOperation.class.getName(), this);
             }
         }
         return outputType;
@@ -183,16 +189,20 @@
             operationModel =
                     new org.apache.tuscany.spi.model.Operation<QName>(operation.getName(), getInputType(),
                             getOutputType(), getFaultTypes(), oneway, dataBinding);
-            operationModel.setMetaData(WSDLOperation.class.getName(), this);
+            operationModel.setWrapperStyle(isWrapperStyle());
+            // operationModel.setMetaData(WSDLOperation.class.getName(), this);
             if (isWrapperStyle()) {
+                operationModel.setWrapper(getWrapper().getWrapperInfo());
                 // Register the operation with the types
                 for (DataType<?> d : wrapper.getUnwrappedInputType().getLogical()) {
-                    d.setMetadata(org.apache.tuscany.spi.model.Operation.class.getName(), operationModel);
+                    d.setMetadata(OPERATION_KEY, operationModel);
                 }
-                wrapper.getUnwrappedOutputType().setMetadata(org.apache.tuscany.spi.model.Operation.class.getName(),
+                wrapper.getUnwrappedOutputType().setMetadata(OPERATION_KEY,
                         operationModel);
             }
         }
+        inputType.setMetadata(OPERATION_KEY, operationModel);
+        outputType.setMetadata(OPERATION_KEY, operationModel);
         return operationModel;
     }
 
@@ -230,7 +240,8 @@
                 }
             }
             dataType = new DataType<QName>(dataBinding, Object.class, element.getQName());
-            dataType.setMetadata(WSDLPart.class.getName(), this);
+            // dataType.setMetadata(WSDLPart.class.getName(), this);
+            dataType.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
         }
 
         /**
@@ -284,6 +295,8 @@
         private DataType<List<DataType<QName>>> unwrappedInputType;
 
         private DataType<QName> unwrappedOutputType;
+        
+        private transient WrapperInfo wrapperInfo;
 
         private List<XmlSchemaElement> getChildElements(XmlSchemaElement element) {
             if (element == null) {
@@ -415,7 +428,7 @@
                 List<DataType<QName>> childTypes = new ArrayList<DataType<QName>>();
                 for (XmlSchemaElement element : getInputChildElements()) {
                     DataType<QName> type = new DataType<QName>(dataBinding, Object.class, element.getQName());
-                    type.setMetadata(XmlSchemaElement.class.getName(), element);
+                    type.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
                     childTypes.add(type);
                 }
                 unwrappedInputType =
@@ -434,10 +447,50 @@
                     }
                     XmlSchemaElement element = elements.get(0);
                     unwrappedOutputType = new DataType<QName>(dataBinding, Object.class, element.getQName());
-                    unwrappedOutputType.setMetadata(XmlSchemaElement.class.getName(), element);
+                    unwrappedOutputType.setMetadata(ElementInfo.class.getName(), getElementInfo(element));
                 }
             }
             return unwrappedOutputType;
         }
+
+        public WrapperInfo getWrapperInfo() throws InvalidServiceContractException {
+            if (wrapperInfo == null) {
+                ElementInfo in = getElementInfo(getInputWrapperElement());
+                ElementInfo out = getElementInfo(getOutputWrapperElement());
+                List<ElementInfo> inChildren = new ArrayList<ElementInfo>();
+                for (XmlSchemaElement e : getInputChildElements()) {
+                    inChildren.add(getElementInfo(e));
+                }
+                List<ElementInfo> outChildren = new ArrayList<ElementInfo>();
+                for (XmlSchemaElement e : getOutputChildElements()) {
+                    outChildren.add(getElementInfo(e));
+                }
+                wrapperInfo =
+                        new WrapperInfo(in, out, inChildren, outChildren, getUnwrappedInputType(), getUnwrappedOutputType());
+            }
+            return wrapperInfo;
+        }
     }
+
+    private static ElementInfo getElementInfo(XmlSchemaElement element) {
+        if (element == null) {
+            return null;
+        }
+        return new ElementInfo(element.getQName(), getTypeInfo(element.getSchemaType()));
+    }
+
+    private static TypeInfo getTypeInfo(XmlSchemaType type) {
+        if (type == null) {
+            return null;
+        }
+        XmlSchemaType baseType = (XmlSchemaType) type.getBaseSchemaType();
+        QName name = type.getQName();
+        boolean simple = (type instanceof XmlSchemaSimpleType);
+        if (baseType == null) {
+            return new TypeInfo(name, simple, null);
+        } else {
+            return new TypeInfo(name, simple, getTypeInfo(baseType));
+        }
+    }
+
 }

Modified: incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java (original)
+++ incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java Fri Sep 22 13:48:58 2006
@@ -68,11 +68,8 @@
         DataType<QName> returnType = operation.getOutputType();
         Assert.assertNotNull(returnType);
         Assert.assertEquals(0, operation.getFaultTypes().size());
-        WSDLOperation op = 
-            (WSDLOperation) operation.getMetaData().get(WSDLOperation.class.getName());
-        Assert.assertNotNull(op);
-        Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
-        Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
+        Assert.assertEquals(1, operation.getWrapper().getInputChildElements().size());
+        Assert.assertEquals(1, operation.getWrapper().getOutputChildElements().size());
     }
 
     public final void testIntrospectPortTypePortType() throws InvalidServiceContractException {

Modified: incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java?view=diff&rev=449084&r1=449083&r2=449084
==============================================================================
--- incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java (original)
+++ incubator/tuscany/java/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java Fri Sep 22 13:48:58 2006
@@ -27,12 +27,12 @@
 import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.spi.model.DataType;
-import org.apache.ws.commons.schema.XmlSchemaElement;
-
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
+import org.apache.tuscany.spi.idl.ElementInfo;
+import org.apache.tuscany.spi.model.DataType;
+
 /**
  * Test case for WSDLOperation
  */
@@ -59,7 +59,6 @@
         WSDLOperation op = new WSDLOperation(operation, "org.w3c.dom.Node", registry.getSchemaRegistry());
         
         DataType<List<DataType<QName>>> inputType = op.getInputType();
-        Assert.assertSame(op, inputType.getMetadata(WSDLOperation.class.getName()));
         Assert.assertEquals(1, inputType.getLogical().size());
         Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), inputType.getLogical()
                 .get(0).getLogical());
@@ -74,12 +73,12 @@
         Assert.assertEquals(1, childTypes.size());
         DataType<QName> childType = childTypes.get(0);
         Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical());
-        XmlSchemaElement element = (XmlSchemaElement) childType.getMetadata(XmlSchemaElement.class.getName());
+        ElementInfo element = (ElementInfo) childType.getMetadata(ElementInfo.class.getName());
         Assert.assertNotNull(element);
         
         childType = op.getWrapper().getUnwrappedOutputType();
         Assert.assertEquals(new QName(null, "price"), childType.getLogical());
-        element = (XmlSchemaElement) childType.getMetadata(XmlSchemaElement.class.getName());
+        element = (ElementInfo) childType.getMetadata(ElementInfo.class.getName());
         Assert.assertNotNull(element);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message