You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/02/20 23:26:27 UTC

svn commit: r379259 [4/7] - in /incubator/tuscany/sandbox/binding.axis2: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/tuscany/ src/main/java/org/apache/tuscany/binding/ src/main/java/org/apache/...

Added: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd Mon Feb 20 14:26:19 2006
@@ -0,0 +1,535 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!-- Schema for the SOAP/1.1 encoding
+
+     This schema has been produced using W3C's SOAP Version 1.2 schema
+     found at:
+
+     http://www.w3.org/2001/06/soap-encoding
+
+     Copyright 2001 Martin Gudgin, Developmentor.
+	 http://www.develop.co.uk
+
+     Changes made are the following:
+     - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/
+     - reverted root to only allow 0 and 1 as lexical values
+
+	 Further changes:
+
+	 - removed default value from root attribute declaration - 20030314
+
+     Original copyright:
+     
+     Copyright 2001 W3C (Massachusetts Institute of Technology,
+     Institut National de Recherche en Informatique et en Automatique,
+     Keio University). All Rights Reserved.
+     http://www.w3.org/Consortium/Legal/
+
+     This document is governed by the W3C Software License [1] as
+     described in the FAQ [2].
+
+     [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
+     [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/"
+           targetNamespace="http://schemas.xmlsoap.org/soap/encoding/">
+
+    <xs:attribute name="root">
+        <xs:annotation>
+            <xs:documentation>
+                'root' can be used to distinguish serialization roots from other
+                elements that are present in a serialization but are not roots of
+                a serialized value graph
+            </xs:documentation>
+        </xs:annotation>
+        <xs:simpleType>
+            <xs:restriction base='xs:boolean'>
+                <xs:pattern value='0|1'/>
+            </xs:restriction>
+        </xs:simpleType>
+    </xs:attribute>
+
+    <xs:attributeGroup name="commonAttributes">
+        <xs:annotation>
+            <xs:documentation>
+                Attributes common to all elements that function as accessors or
+                represent independent (multi-ref) values. The href attribute is
+                intended to be used in a manner like CONREF. That is, the element
+                content should be empty iff the href attribute appears
+            </xs:documentation>
+        </xs:annotation>
+        <xs:attribute name="id" type="xs:ID"/>
+        <xs:attribute name="href" type="xs:anyURI"/>
+        <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:attributeGroup>
+
+    <!-- Global Attributes.  The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
+
+    <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. -->
+
+    <xs:simpleType name="arrayCoordinate">
+        <xs:restriction base="xs:string"/>
+    </xs:simpleType>
+
+    <xs:attribute name="arrayType" type="xs:string"/>
+    <xs:attribute name="offset" type="tns:arrayCoordinate"/>
+
+    <xs:attributeGroup name="arrayAttributes">
+        <xs:attribute ref="tns:arrayType"/>
+        <xs:attribute ref="tns:offset"/>
+    </xs:attributeGroup>
+
+    <xs:attribute name="position" type="tns:arrayCoordinate"/>
+
+    <xs:attributeGroup name="arrayMemberAttributes">
+        <xs:attribute ref="tns:position"/>
+    </xs:attributeGroup>
+
+    <xs:group name="Array">
+        <xs:sequence>
+            <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+        </xs:sequence>
+    </xs:group>
+
+    <xs:element name="Array" type="tns:Array"/>
+    <xs:complexType name="Array">
+        <xs:annotation>
+            <xs:documentation>
+                'Array' is a complex type for accessors identified by position
+            </xs:documentation>
+        </xs:annotation>
+        <xs:group ref="tns:Array" minOccurs="0"/>
+        <xs:attributeGroup ref="tns:arrayAttributes"/>
+        <xs:attributeGroup ref="tns:commonAttributes"/>
+    </xs:complexType>
+
+    <!-- 'Struct' is a complex type for accessors identified by name.
+Constraint: No element may be have the same name as any other,
+nor may any element have a maxOccurs > 1. -->
+
+    <xs:element name="Struct" type="tns:Struct"/>
+
+    <xs:group name="Struct">
+        <xs:sequence>
+            <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+        </xs:sequence>
+    </xs:group>
+
+    <xs:complexType name="Struct">
+        <xs:group ref="tns:Struct" minOccurs="0"/>
+        <xs:attributeGroup ref="tns:commonAttributes"/>
+    </xs:complexType>
+
+    <!-- 'Base64' can be used to serialize binary data using base64 encoding
+as defined in RFC2045 but without the MIME line length limitation. -->
+
+    <xs:simpleType name="base64">
+        <xs:restriction base="xs:base64Binary"/>
+    </xs:simpleType>
+
+    <!-- Element declarations corresponding to each of the simple types in the
+ XML Schemas Specification. -->
+
+    <xs:element name="duration" type="tns:duration"/>
+    <xs:complexType name="duration">
+        <xs:simpleContent>
+            <xs:extension base="xs:duration">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="dateTime" type="tns:dateTime"/>
+    <xs:complexType name="dateTime">
+        <xs:simpleContent>
+            <xs:extension base="xs:dateTime">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+
+    <xs:element name="NOTATION" type="tns:NOTATION"/>
+    <xs:complexType name="NOTATION">
+        <xs:simpleContent>
+            <xs:extension base="xs:QName">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+
+    <xs:element name="time" type="tns:time"/>
+    <xs:complexType name="time">
+        <xs:simpleContent>
+            <xs:extension base="xs:time">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="date" type="tns:date"/>
+    <xs:complexType name="date">
+        <xs:simpleContent>
+            <xs:extension base="xs:date">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="gYearMonth" type="tns:gYearMonth"/>
+    <xs:complexType name="gYearMonth">
+        <xs:simpleContent>
+            <xs:extension base="xs:gYearMonth">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="gYear" type="tns:gYear"/>
+    <xs:complexType name="gYear">
+        <xs:simpleContent>
+            <xs:extension base="xs:gYear">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="gMonthDay" type="tns:gMonthDay"/>
+    <xs:complexType name="gMonthDay">
+        <xs:simpleContent>
+            <xs:extension base="xs:gMonthDay">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="gDay" type="tns:gDay"/>
+    <xs:complexType name="gDay">
+        <xs:simpleContent>
+            <xs:extension base="xs:gDay">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="gMonth" type="tns:gMonth"/>
+    <xs:complexType name="gMonth">
+        <xs:simpleContent>
+            <xs:extension base="xs:gMonth">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="boolean" type="tns:boolean"/>
+    <xs:complexType name="boolean">
+        <xs:simpleContent>
+            <xs:extension base="xs:boolean">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="base64Binary" type="tns:base64Binary"/>
+    <xs:complexType name="base64Binary">
+        <xs:simpleContent>
+            <xs:extension base="xs:base64Binary">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="hexBinary" type="tns:hexBinary"/>
+    <xs:complexType name="hexBinary">
+        <xs:simpleContent>
+            <xs:extension base="xs:hexBinary">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="float" type="tns:float"/>
+    <xs:complexType name="float">
+        <xs:simpleContent>
+            <xs:extension base="xs:float">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="double" type="tns:double"/>
+    <xs:complexType name="double">
+        <xs:simpleContent>
+            <xs:extension base="xs:double">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="anyURI" type="tns:anyURI"/>
+    <xs:complexType name="anyURI">
+        <xs:simpleContent>
+            <xs:extension base="xs:anyURI">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="QName" type="tns:QName"/>
+    <xs:complexType name="QName">
+        <xs:simpleContent>
+            <xs:extension base="xs:QName">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+
+    <xs:element name="string" type="tns:string"/>
+    <xs:complexType name="string">
+        <xs:simpleContent>
+            <xs:extension base="xs:string">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="normalizedString" type="tns:normalizedString"/>
+    <xs:complexType name="normalizedString">
+        <xs:simpleContent>
+            <xs:extension base="xs:normalizedString">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="token" type="tns:token"/>
+    <xs:complexType name="token">
+        <xs:simpleContent>
+            <xs:extension base="xs:token">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="language" type="tns:language"/>
+    <xs:complexType name="language">
+        <xs:simpleContent>
+            <xs:extension base="xs:language">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="Name" type="tns:Name"/>
+    <xs:complexType name="Name">
+        <xs:simpleContent>
+            <xs:extension base="xs:Name">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="NMTOKEN" type="tns:NMTOKEN"/>
+    <xs:complexType name="NMTOKEN">
+        <xs:simpleContent>
+            <xs:extension base="xs:NMTOKEN">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="NCName" type="tns:NCName"/>
+    <xs:complexType name="NCName">
+        <xs:simpleContent>
+            <xs:extension base="xs:NCName">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="NMTOKENS" type="tns:NMTOKENS"/>
+    <xs:complexType name="NMTOKENS">
+        <xs:simpleContent>
+            <xs:extension base="xs:NMTOKENS">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="ID" type="tns:ID"/>
+    <xs:complexType name="ID">
+        <xs:simpleContent>
+            <xs:extension base="xs:ID">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="IDREF" type="tns:IDREF"/>
+    <xs:complexType name="IDREF">
+        <xs:simpleContent>
+            <xs:extension base="xs:IDREF">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="ENTITY" type="tns:ENTITY"/>
+    <xs:complexType name="ENTITY">
+        <xs:simpleContent>
+            <xs:extension base="xs:ENTITY">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="IDREFS" type="tns:IDREFS"/>
+    <xs:complexType name="IDREFS">
+        <xs:simpleContent>
+            <xs:extension base="xs:IDREFS">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="ENTITIES" type="tns:ENTITIES"/>
+    <xs:complexType name="ENTITIES">
+        <xs:simpleContent>
+            <xs:extension base="xs:ENTITIES">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="decimal" type="tns:decimal"/>
+    <xs:complexType name="decimal">
+        <xs:simpleContent>
+            <xs:extension base="xs:decimal">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="integer" type="tns:integer"/>
+    <xs:complexType name="integer">
+        <xs:simpleContent>
+            <xs:extension base="xs:integer">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger"/>
+    <xs:complexType name="nonPositiveInteger">
+        <xs:simpleContent>
+            <xs:extension base="xs:nonPositiveInteger">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="negativeInteger" type="tns:negativeInteger"/>
+    <xs:complexType name="negativeInteger">
+        <xs:simpleContent>
+            <xs:extension base="xs:negativeInteger">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="long" type="tns:long"/>
+    <xs:complexType name="long">
+        <xs:simpleContent>
+            <xs:extension base="xs:long">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="int" type="tns:int"/>
+    <xs:complexType name="int">
+        <xs:simpleContent>
+            <xs:extension base="xs:int">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="short" type="tns:short"/>
+    <xs:complexType name="short">
+        <xs:simpleContent>
+            <xs:extension base="xs:short">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="byte" type="tns:byte"/>
+    <xs:complexType name="byte">
+        <xs:simpleContent>
+            <xs:extension base="xs:byte">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger"/>
+    <xs:complexType name="nonNegativeInteger">
+        <xs:simpleContent>
+            <xs:extension base="xs:nonNegativeInteger">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="unsignedLong" type="tns:unsignedLong"/>
+    <xs:complexType name="unsignedLong">
+        <xs:simpleContent>
+            <xs:extension base="xs:unsignedLong">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="unsignedInt" type="tns:unsignedInt"/>
+    <xs:complexType name="unsignedInt">
+        <xs:simpleContent>
+            <xs:extension base="xs:unsignedInt">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="unsignedShort" type="tns:unsignedShort"/>
+    <xs:complexType name="unsignedShort">
+        <xs:simpleContent>
+            <xs:extension base="xs:unsignedShort">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="unsignedByte" type="tns:unsignedByte"/>
+    <xs:complexType name="unsignedByte">
+        <xs:simpleContent>
+            <xs:extension base="xs:unsignedByte">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="positiveInteger" type="tns:positiveInteger"/>
+    <xs:complexType name="positiveInteger">
+        <xs:simpleContent>
+            <xs:extension base="xs:positiveInteger">
+                <xs:attributeGroup ref="tns:commonAttributes"/>
+            </xs:extension>
+        </xs:simpleContent>
+    </xs:complexType>
+
+    <xs:element name="anyType"/>
+</xs:schema>
+

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/serialization/mediator/impl/soap-encoding.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java Mon Feb 20 14:26:19 2006
@@ -0,0 +1,42 @@
+package org.apache.tuscany.binding.axis2.utils;
+
+import java.util.List;
+
+import org.apache.tuscany.model.types.wsdl.WSDLOperationType;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.sdo.EProperty;
+import org.eclipse.emf.ecore.sdo.EType;
+import org.eclipse.emf.ecore.util.ExtendedMetaData;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+public class WSDLOperationTypeHelper {
+
+    public static boolean isWrappedStyle(WSDLOperationType wsdlOperationType) {
+        
+        //TODO: moved this into WSDLOperationType?
+        
+        Type inputType = wsdlOperationType.getInputType();
+        if (inputType == null) {
+            return false;
+        }
+        List properties = inputType.getProperties();
+        if (properties.size() != 1) {
+            return false;
+        }
+        Property property = (Property) properties.get(0);
+
+        EProperty p = (EProperty) property;
+        String elementName = ExtendedMetaData.INSTANCE.getName(p.getEStructuralFeature());
+        String operationName = wsdlOperationType.getName();
+        if (!operationName.equals(elementName)) {
+            return false;
+        }
+
+        EType eType = (EType) inputType;
+        List attrs = ExtendedMetaData.INSTANCE.getAttributes((EClass) eType.getEClassifier());
+        return attrs.isEmpty();
+    }
+
+}

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WSDLOperationTypeHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java Mon Feb 20 14:26:19 2006
@@ -0,0 +1,466 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.binding.axis2.utils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.xml.namespace.QName;
+
+/**
+ * Metadata for a WSDL operation
+ * 
+ * TODO: review what methods here are actually used
+ */
+public class WebServiceOperationMetaData {
+    // WSDL Binding and BindingOperation
+    private Binding binding;
+    private BindingOperation bindingOperation;
+
+    // Fields to cache derived metadata
+    private transient Set inputHeaderParts;
+    private transient Set outputHeaderParts;
+    private transient String style;
+    private transient String use;
+    private transient String soapAction;
+    private transient List signature;
+    private transient QName rpcOperationName;
+
+    public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation) {
+        this.binding = binding;
+        this.bindingOperation = bindingOperation;
+    }
+
+    public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation, String style, String use, String soapAction) {
+        this.binding = binding;
+        this.bindingOperation = bindingOperation;
+        this.style = style;
+        this.use = use;
+        this.soapAction = soapAction;
+    }
+
+    public Set getInputHeaderParts() {
+        if (inputHeaderParts == null) {
+            // Build a set of header parts that we need to exclude
+            inputHeaderParts = new HashSet();
+            BindingInput bindingInput = bindingOperation.getBindingInput();
+
+            if (bindingInput != null) {
+                Operation operation = bindingOperation.getOperation();
+                javax.wsdl.Message message = operation.getInput().getMessage();
+                List elements = bindingInput.getExtensibilityElements();
+                for (Iterator i = elements.iterator(); i.hasNext();) {
+                    Object extensibilityElement = i.next();
+                    Part part = getPartFromSOAPHeader(message, extensibilityElement);
+                    if (part != null) {
+                        inputHeaderParts.add(part);
+                    }
+                }
+            }
+        }
+        return inputHeaderParts;
+    }
+
+    public Set getOutputHeaderParts() {
+        if (outputHeaderParts == null) {
+            // Build a set of header parts that we need to exclude
+            outputHeaderParts = new HashSet();
+            BindingOutput bindingOutput = bindingOperation.getBindingOutput();
+
+            if (bindingOutput != null) {
+                Operation operation = bindingOperation.getOperation();
+                javax.wsdl.Message message = operation.getOutput().getMessage();
+                List elements = bindingOutput.getExtensibilityElements();
+                for (Iterator i = elements.iterator(); i.hasNext();) {
+                    Object extensibilityElement = i.next();
+                    Part part = getPartFromSOAPHeader(message, extensibilityElement);
+                    if (part != null) {
+                        outputHeaderParts.add(part);
+                    }
+                }
+            }
+        }
+        return outputHeaderParts;
+    }
+
+    private Part getPartFromSOAPHeader(Message message, Object extensibilityElement) {
+        Part part = null;
+        if (extensibilityElement instanceof SOAPHeader) {
+            SOAPHeader soapHeader = (SOAPHeader) extensibilityElement;
+            QName msgName = soapHeader.getMessage();
+            if (message.getQName().equals(msgName)) {
+                part = message.getPart(soapHeader.getPart());
+            }
+        } else if (extensibilityElement instanceof org.eclipse.wst.wsdl.binding.soap.SOAPHeader) {
+            org.eclipse.wst.wsdl.binding.soap.SOAPHeader soapHeader = (org.eclipse.wst.wsdl.binding.soap.SOAPHeader) extensibilityElement;
+            QName msgName = soapHeader.getMessage().getQName();
+            if (message.getQName().equals(msgName)) {
+                part = soapHeader.getPart();
+            }
+        }
+        return part;
+    }
+
+    public String getStyle() {
+        if (style == null) {
+            SOAPOperation soapOperation = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(bindingOperation.getExtensibilityElements(), SOAPOperation.class);
+            if (soapOperation != null)
+                style = soapOperation.getStyle();
+            if (style == null) {
+                SOAPBinding soapBinding = (SOAPBinding) WebServicePortMetaData.getExtensibilityElement(binding.getExtensibilityElements(), SOAPBinding.class);
+                if (soapBinding != null)
+                    style = soapBinding.getStyle();
+            }
+            if (style == null)
+                style = "document";
+        }
+        return style;
+    }
+
+    /**
+     * Returns the SOAP action for the given operation.
+     *
+     * @param wsdlBindingOperation
+     * @return
+     */
+    public String getSOAPAction() {
+        if (soapAction == null) {
+            final List wsdlBindingOperationExtensions = bindingOperation.getExtensibilityElements();
+            final SOAPOperation soapOp = (SOAPOperation) WebServicePortMetaData.getExtensibilityElement(wsdlBindingOperationExtensions, SOAPOperation.class);
+            if (soapOp != null)
+                soapAction = soapOp.getSoapActionURI();
+        }
+        return soapAction;
+    }
+
+    public QName getRPCOperationName() {
+        if (rpcOperationName == null) {
+            javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true);
+            String ns = (soapBody != null) ? soapBody.getNamespaceURI() : binding.getPortType().getQName().getNamespaceURI();
+            String name = bindingOperation.getOperation().getName();
+            rpcOperationName = new QName(ns, name);
+        }
+        return rpcOperationName;
+    }
+
+    private List getSOAPBodyParts(boolean input) {
+        javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(input);
+        if (soapBody != null) {
+            List parts = soapBody.getParts();
+            List names = new ArrayList();
+            for (Iterator i = parts.iterator(); i.hasNext();) {
+                Object part = i.next();
+                if (part instanceof String)
+                    names.add(part);
+                else if (part instanceof Part) {
+                    names.add(((Part) part).getName());
+                }
+            }
+            return names;
+        } else
+            return null;
+    }
+
+    private javax.wsdl.extensions.soap.SOAPBody getSOAPBody(boolean input) {
+        List elements = null;
+        if (input) {
+            BindingInput bindingInput = bindingOperation.getBindingInput();
+            if (bindingInput == null)
+                return null;
+            elements = bindingInput.getExtensibilityElements();
+        } else {
+            BindingOutput bindingOutput = bindingOperation.getBindingOutput();
+            if (bindingOutput == null)
+                return null;
+            elements = bindingOutput.getExtensibilityElements();
+        }
+        javax.wsdl.extensions.soap.SOAPBody soapBody = (javax.wsdl.extensions.soap.SOAPBody) WebServicePortMetaData.getExtensibilityElement(elements,
+                javax.wsdl.extensions.soap.SOAPBody.class);
+        return soapBody;
+    }
+
+    /**
+     * Returns true if the given binding operation is RPC encoded
+     *
+     * @param wsdlOperation
+     * @return
+     */
+    public String getUse() {
+        if (use == null) {
+            javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true);
+            if (soapBody != null) {
+                use = soapBody.getUse();
+            }
+            if (use == null)
+                use = "literal";
+        }
+        return use;
+    }
+
+    public boolean isDocLitWrapped() {
+        boolean flag = getStyle().equals("document") && getUse().equals("literal");
+        if (!flag)
+            return false;
+        Message msg = getMessage(true);
+        if (msg == null)
+            return false;
+        List parts = msg.getOrderedParts(null);
+        if (parts.size() != 1)
+            return false;
+        Part part = (Part) parts.get(0);
+        QName element = part.getElementName();
+        if (element == null)
+            return false;
+        return element.getLocalPart().equals(bindingOperation.getOperation().getName());
+    }
+
+    /*
+      public SOAPMediator createMediator(boolean serverMode)
+      throws SOAPException {
+      // create a new mediator for each invoke for thread-safety
+      boolean rpcStyle = getStyle().equals("rpc");
+      boolean rpcEncoded = isEncoded();
+
+      SOAPMediator mediator = null;
+
+      if (!rpcStyle) {
+      // Document
+      mediator = new SOAPDocumentLiteralMediatorImpl(this, serverMode);
+      } else {
+      if (!rpcEncoded)
+      mediator = new SOAPRPCLiteralMediatorImpl(this, serverMode); // RPC-literal
+      else
+      mediator = new SOAPRPCEncodedMediatorImpl(this, serverMode); // RPC-encoded
+      }
+      return mediator;
+      }
+      */
+
+    /**
+     * Get the operation signature from the WSDL operation
+     *
+     * @param wsdlBinding
+     * @param bindingOperation
+     * @return
+     */
+    public List getOperationSignature() {
+        if (signature == null) {
+            signature = new ArrayList();
+
+            Operation operation = bindingOperation.getOperation();
+            if (operation == null)
+                return signature;
+
+            final Input input = operation.getInput();
+            if (input == null) {
+                return signature;
+            }
+
+            String style = getStyle();
+
+            if (style.equals("rpc")) {
+                Collection partNames = input.getMessage().getParts().values();
+                for (Iterator i = partNames.iterator(); i.hasNext();) {
+                    Part part = (Part) i.next();
+                    signature.add(part.getName());
+                }
+            } else {
+                /*
+                     * WS-I Basic Profile 1.1 4.7.6 Operation Signatures
+                     * Definition: operation signature
+                     *
+                     * The profile defines the "operation signature" to be the
+                     * fully qualified name of the child element of SOAP body of
+                     * the SOAP input message described by an operation in a
+                     * WSDL binding.
+                     *
+                     * In the case of rpc-literal binding, the operation name is
+                     * used as a wrapper for the part accessors. In the
+                     * document-literal case, since a wrapper with the operation
+                     * name is not present, the message signatures must be
+                     * correctly designed so that they meet this requirement.
+                     *
+                     * An endpoint that supports multiple operations must
+                     * unambiguously identify the operation being invoked based
+                     * on the input message that it receives. This is only
+                     * possible if all the operations specified in the
+                     * wsdl:binding associated with an endpoint have a unique
+                     * operation signature.
+                     *
+                     * R2710 The operations in a wsdl:binding in a DESCRIPTION
+                     * MUST result in operation signatures that are different
+                     * from one another.
+                     */
+                List bodyParts = getSOAPBodyParts(true);
+
+                Collection parts = input.getMessage().getParts().values();
+                // Exclude the parts to be transmitted in SOAP header
+                if (bodyParts == null)
+                    parts.removeAll(getInputHeaderParts());
+                for (Iterator i = parts.iterator(); i.hasNext();) {
+                    Part part = (Part) i.next();
+                    if (bodyParts == null) {
+                        // All parts
+                        QName elementName = part.getElementName();
+                        if (elementName == null) {
+                            elementName = new QName("", part.getName());
+                            // TODO: [rfeng] throw new
+                            // ServiceRuntimeException("Message part for
+                            // document style must refer to an XSD element
+                            // using a QName: " + part);
+                        }
+                        signature.add(elementName);
+                    } else {
+                        // "parts" in soap:body
+                        if (bodyParts.contains(part.getName())) {
+                            QName elementName = part.getElementName();
+                            if (elementName == null) {
+                                elementName = new QName("", part.getName());
+                                // TODO: [rfeng] throw new
+                                // ServiceRuntimeException("Message part for
+                                // document style must refer to an XSD
+                                // element using a QName: " + part);
+                            }
+                            signature.add(elementName);
+                        }
+
+                    }
+                }
+            }
+        }
+        return signature;
+    }
+
+    public Message getMessage(boolean isInput) {
+        Operation operation = bindingOperation.getOperation();
+        if (operation == null)
+            return null;
+
+        if (isInput) {
+            final Input input = operation.getInput();
+            return input == null ? null : input.getMessage();
+        } else {
+            final Output output = operation.getOutput();
+            return output == null ? null : output.getMessage();
+        }
+    }
+
+    public Part getInputPart(int index) {
+        Part part = null;
+        Message message = getMessage(true);
+        if (message == null)
+            return part;
+
+        List parts = message.getOrderedParts(null);
+        return (Part) parts.get(index);
+
+    }
+
+    public Part getOutputPart(int index) {
+        Part part = null;
+        Message message = getMessage(false);
+        if (message == null)
+            return part;
+
+        List parts = message.getOrderedParts(null);
+        return (Part) parts.get(index);
+
+    }
+
+    /**
+     * Get a list of indexes for each part in the SOAP body
+     *
+     * @param isInput TODO
+     * @return
+     */
+    public List getBodyPartIndexes(boolean isInput) {
+        List indexes = new ArrayList();
+
+        Message message = getMessage(isInput);
+        if (message == null)
+            return indexes;
+
+        List bodyParts = getSOAPBodyParts(isInput);
+        List parts = message.getOrderedParts(null);
+        Set headerParts = (isInput) ? getInputHeaderParts() : getOutputHeaderParts();
+
+        int index = 0;
+        for (Iterator i = parts.iterator(); i.hasNext(); index++) {
+            Part part = (Part) i.next();
+            if (headerParts.contains(part))
+                continue;
+            if (bodyParts == null) {
+                // All parts
+                indexes.add(new Integer(index));
+            } else {
+                // "parts" in soap:body
+                if (bodyParts.contains(part.getName()))
+                    indexes.add(new Integer(index));
+
+            }
+        }
+        return indexes;
+    }
+
+    /**
+     * Get the corresponding index for a part in the SOAP header by element
+     * name
+     *
+     * @param elementName
+     * @param isInput     TODO
+     * @return
+     */
+    public int getHeaderPartIndex(QName elementName, boolean isInput) {
+
+        Message message = getMessage(isInput);
+        if (message == null)
+            return -1;
+
+        List parts = message.getOrderedParts(null);
+        Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts();
+
+        int index = 0;
+        for (Iterator i = parts.iterator(); i.hasNext(); index++) {
+            Part part = (Part) i.next();
+            // Test if the part is in header section
+            if (headerParts.contains(part) && elementName.equals(part.getElementName())) {
+                return index;
+            }
+        }
+        return -1;
+    }
+
+    public BindingOperation getBindingOperation() {
+        return bindingOperation;
+	}
+
+}
\ No newline at end of file

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServiceOperationMetaData.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java Mon Feb 20 14:26:19 2006
@@ -0,0 +1,356 @@
+/**
+ *
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.binding.axis2.utils;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.extensions.soap.SOAPBinding;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBodyElement;
+import javax.xml.soap.SOAPElement;
+
+import org.w3c.dom.Element;
+
+import org.apache.tuscany.model.types.wsdl.WSDLInterfaceType;
+import org.apache.tuscany.model.types.wsdl.WSDLTypeHelper;
+
+/**
+ * Metadata for a WSDL port
+ *
+ * TODO: review what methods here are actually used
+ */
+public class WebServicePortMetaData {
+    private final static String SOAP_ENCODING_URI = "http://schemas.xmlsoap.org/wsdl/soap/";
+    private Service wsdlService;
+
+    private QName wsdlServiceName;
+
+    private Port wsdlPort;
+
+    private Binding wsdlBinding;
+
+    private QName wsdlPortName;
+
+    private PortType wsdlPortType;
+
+    private QName wsdlPortTypeName;
+
+    private String endpoint;
+
+    private boolean managed;
+
+    private List allOperationMetaData;
+
+    private WSDLInterfaceType interfaceType;
+
+    /**
+     * Constructor
+     *
+     * @param wsdlDefinition
+     * @param portName
+     */
+    public WebServicePortMetaData(WSDLTypeHelper wsdlTypeHelper, Definition wsdlDefinition, QName portName, String endpoint, boolean managed) {
+
+        // Lookup the named port
+        wsdlPortName = portName;
+        for (Iterator i = wsdlDefinition.getServices().values().iterator(); i.hasNext() && wsdlPort == null;) {
+            wsdlService = (javax.wsdl.Service) i.next();
+            if (wsdlPortName.getNamespaceURI().equals(wsdlService.getQName().getNamespaceURI())) {
+                wsdlPort = wsdlService.getPort(wsdlPortName.getLocalPart());
+                if (wsdlPort != null) {
+                    wsdlServiceName = wsdlService.getQName();
+                    break;
+                }
+            }
+        }
+        if (wsdlPort == null) {
+            throw new IllegalArgumentException("WSDL port cannot be found for " + portName);
+        }
+
+        // Save the binding
+        wsdlBinding = wsdlPort.getBinding();
+        if (wsdlBinding == null) {
+            throw new IllegalArgumentException("WSDL binding cannot be found for " + portName);
+        }
+
+        // Save the portType
+        wsdlPortType = wsdlBinding.getPortType();
+        if (wsdlPortType == null) {
+            throw new IllegalArgumentException("WSDL portType cannot be found for " + portName);
+        }
+        wsdlPortTypeName = wsdlPortType.getQName();
+
+        // Lookup the EClass representing the WSDL portType
+        interfaceType = wsdlTypeHelper.getWSDLInterfaceType(wsdlPortTypeName);
+        if (interfaceType == null) {
+            throw new IllegalArgumentException("WSDL portType interface metadata cannot be found for " + wsdlPortTypeName);
+        }
+
+        // Save the endpoint
+        this.endpoint = endpoint;
+
+        // Track if this endpoint is managed or not
+        this.managed = managed;
+    }
+
+    /**
+     * Constructor
+     *
+     * @param serviceName
+     * @param portName
+     * @param portType
+     */
+    public WebServicePortMetaData(QName serviceName, String portName, QName portTypeName, String endpoint) {
+        wsdlServiceName = serviceName;
+        wsdlPortName = new QName(serviceName.getNamespaceURI(), portName);
+        wsdlPortTypeName = portTypeName;
+        this.endpoint = endpoint;
+    }
+
+    /**
+     * @return Returns the wsdlPort.
+     */
+    public javax.wsdl.Port getPort() {
+        return wsdlPort;
+    }
+
+    /**
+     * @return Returns the wsdlService.
+     */
+    public QName getServiceName() {
+        return wsdlServiceName;
+    }
+
+    /**
+     * @return Returns the wsdlService.
+     */
+    public javax.wsdl.Service getService() {
+        return wsdlService;
+    }
+
+    /**
+     * @return Returns the wsdlPortType.
+     */
+    public PortType getPortType() {
+        return wsdlPortType;
+    }
+
+    /**
+     * @return Returns the wsdlPortType.
+     */
+    public QName getPortTypeName() {
+        return wsdlPortTypeName;
+    }
+
+    /**
+     * @return Returns the wsdlBinding.
+     */
+    public Binding getBinding() {
+        return wsdlBinding;
+    }
+
+    /**
+     * @return Returns the wsdlPortName.
+     */
+    public QName getPortName() {
+        return wsdlPortName;
+    }
+
+    /**
+     * Returns the endpoint of a given port.
+     *
+     * @param wsdlPort
+     * @return
+     */
+    public String getEndpoint() {
+
+        // Return the specified endpoint
+        if (endpoint != null)
+            return endpoint;
+
+        // Find the target endpoint on the port
+        if (wsdlPort != null) {
+            final List wsdlPortExtensions = wsdlPort.getExtensibilityElements();
+            for (Iterator i = wsdlPortExtensions.iterator(); i.hasNext();) {
+                final Object extension = i.next();
+                if (extension instanceof SOAPAddress) {
+                    final SOAPAddress address = (SOAPAddress) extension;
+                    return address.getLocationURI();
+                }
+            }
+        }
+
+        return null;
+    }
+
+    public String getStyle() {
+
+        // Find the binding style
+        String style = null;
+        if (wsdlBinding != null) {
+            final List wsdlBindingExtensions = wsdlBinding.getExtensibilityElements();
+            SOAPBinding soapBinding = (SOAPBinding) getExtensibilityElement(wsdlBindingExtensions, SOAPBinding.class);
+            if (soapBinding != null)
+                style = soapBinding.getStyle();
+        }
+
+        // Default to document
+        return (style == null) ? "document" : style;
+    }
+
+    public String getUse() {
+        List list = getAllOperationMetaData();
+        WebServiceOperationMetaData operationMetaData = (WebServiceOperationMetaData) list.get(0);
+        return operationMetaData.getUse();
+    }
+
+    /**
+     * @return Returns the managed.
+     */
+    public boolean isManaged() {
+        return managed;
+    }
+
+    public static Object getExtensibilityElement(List elements, Class type) {
+        for (Iterator i = elements.iterator(); i.hasNext();) {
+            Object element = i.next();
+            if (type.isInstance(element))
+                return element;
+        }
+        return null;
+    }
+
+    public static List getExtensibilityElements(List elements, Class type) {
+        List result = new ArrayList();
+        for (Iterator i = elements.iterator(); i.hasNext();) {
+            Object element = i.next();
+            if (type.isInstance(element))
+                result.add(element);
+        }
+        return result;
+    }
+
+    /**
+     * Get the operation signature from the SOAP Body
+     *
+     * @param body
+     * @return A list of QNames
+     */
+    public static List getOperationSignature(javax.xml.soap.SOAPBody body) {
+        List signature = new ArrayList();
+        for (Iterator i = body.getChildElements(); i.hasNext();) {
+            Object child = i.next();
+            if (child instanceof SOAPBodyElement) {
+                Name name = ((SOAPBodyElement) child).getElementName();
+                QName qname = new QName(name.getURI(), name.getLocalName(), name.getPrefix());
+                signature.add(qname);
+            }
+        }
+        return signature;
+    }
+
+    public static List getRPCOperationSignature(javax.xml.soap.SOAPBody body) {
+        List signature = new ArrayList();
+        for (Iterator i = body.getChildElements(); i.hasNext();) {
+            Object child = i.next();
+            if (child instanceof SOAPBodyElement) {
+                SOAPBodyElement op = ((SOAPBodyElement) child);
+                for (Iterator j = op.getChildElements(); j.hasNext();) {
+                    Object part = i.next();
+                    if (part instanceof SOAPElement) {
+                        SOAPElement p = (SOAPElement) part;
+                        signature.add(p.getLocalName());
+                    }
+                }
+            }
+        }
+        return signature;
+    }
+
+    public static String getSOAPEncodingAttribute(org.eclipse.wst.wsdl.ExtensibilityElement extensibilityElement, String elementName, String attributeName) {
+        Element element = extensibilityElement.getElement();
+        if (SOAP_ENCODING_URI.equals(element.getNamespaceURI()) && elementName.equals(element.getLocalName())) {
+            return element.getAttribute(attributeName);
+        } else
+            return null;
+    }
+
+    public WebServiceOperationMetaData getOperationMetaData(javax.xml.soap.SOAPBody body) {
+        List s1 = getOperationSignature(body);
+        // List rpcParts = getRPCOperationSignature(body);
+        for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) {
+            WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next();
+
+            String style = descriptor.getStyle();
+
+            if (style.equals("document")) {
+                List s2 = descriptor.getOperationSignature();
+                if (s1.equals(s2))
+                    return descriptor;
+            } else {
+                QName op1 = (QName) s1.get(0);
+                QName op2 = descriptor.getRPCOperationName();
+                if (op1.equals(op2)) {
+                    /*
+                          * // FIXME: [rfeng] We don't support method overloading
+                          * List partNames = getOperationSignature(binding,
+                          * bindingOperation); if (rpcParts.equals(partNames))
+                          */
+                    return descriptor;
+                }
+            }
+        }
+        return null;
+    }
+
+    public List getAllOperationMetaData() {
+        if (allOperationMetaData == null) {
+            allOperationMetaData = new ArrayList();
+            for (Iterator it = wsdlBinding.getBindingOperations().iterator(); it.hasNext();) {
+                final BindingOperation bindingOperation = (BindingOperation) it.next();
+                if (bindingOperation.getOperation() != null)
+                    allOperationMetaData.add(new WebServiceOperationMetaData(wsdlBinding, bindingOperation));
+            }
+        }
+        return allOperationMetaData;
+    }
+
+    public WebServiceOperationMetaData getOperationMetaData(String operationName) {
+        for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) {
+            WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next();
+            String opName = descriptor.getBindingOperation().getOperation().getName();
+
+            if (opName.equals(operationName))
+                return descriptor;
+        }
+        return null;
+    }
+
+    public WSDLInterfaceType getInterfaceType() {
+        return interfaceType;
+	}
+
+}
\ No newline at end of file

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/utils/WebServicePortMetaData.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Added: incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.ecore
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.ecore?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.ecore (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.ecore Mon Feb 20 14:26:19 2006
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ -->
+<ecore:EPackage xmi:version="2.0"
+                xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="assembly"
+                nsURI="http://org.apache.tuscany/xmlns/webservice/0.9" nsPrefix="ws">
+    <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
+        <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+            <details key="name" value=""/>
+            <details key="kind" value="mixed"/>
+        </eAnnotations>
+        <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed" unique="false" upperBound="-1"
+                             eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="elementWildcard"/>
+                <details key="name" value=":mixed"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+        <eStructuralFeatures xsi:type="ecore:EReference" name="xMLNSPrefixMap" upperBound="-1"
+                             eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
+                             transient="true" containment="true" resolveProxies="false">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="attribute"/>
+                <details key="name" value="xmlns:prefix"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+        <eStructuralFeatures xsi:type="ecore:EReference" name="xSISchemaLocation" upperBound="-1"
+                             eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEntry"
+                             transient="true" containment="true" resolveProxies="false">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="attribute"/>
+                <details key="name" value="xsi:schemaLocation"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+        <eStructuralFeatures xsi:type="ecore:EReference" name="bindingWs" upperBound="-2"
+                             eType="#//WebServiceBinding" volatile="true" transient="true" derived="true"
+                             containment="true" resolveProxies="false">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="element"/>
+                <details key="name" value="binding.ws"/>
+                <details key="namespace" value="##targetNamespace"/>
+                <details key="affiliation" value="http://www.osoa.org/xmlns/sca/0.9#binding"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+    </eClassifiers>
+    <eClassifiers xsi:type="ecore:EClass" name="WebServiceBinding" eSuperTypes="sca-assembly.ecore#//Binding">
+        <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+            <details key="name" value="WebServiceBinding"/>
+            <details key="kind" value="elementOnly"/>
+        </eAnnotations>
+        <eStructuralFeatures xsi:type="ecore:EAttribute" name="any" unique="false" upperBound="-1"
+                             eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="elementWildcard"/>
+                <details key="wildcards" value="##other"/>
+                <details key="name" value=":1"/>
+                <details key="processing" value="lax"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+        <eStructuralFeatures xsi:type="ecore:EAttribute" name="port" unique="false" lowerBound="1"
+                             eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//AnyURI">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="attribute"/>
+                <details key="name" value="port"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+        <eStructuralFeatures xsi:type="ecore:EAttribute" name="anyAttribute" unique="false"
+                             upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
+            <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+                <details key="kind" value="attributeWildcard"/>
+                <details key="wildcards" value="##any"/>
+                <details key="name" value=":3"/>
+                <details key="processing" value="lax"/>
+            </eAnnotations>
+        </eStructuralFeatures>
+    </eClassifiers>
+</ecore:EPackage>

Added: incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.genmodel
URL: http://svn.apache.org/viewcvs/incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.genmodel?rev=379259&view=auto
==============================================================================
--- incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.genmodel (added)
+++ incubator/tuscany/sandbox/binding.axis2/src/main/resources/model/sca-assembly-webservice.genmodel Mon Feb 20 14:26:19 2006
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *  Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed 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.
+ -->
+<genmodel:GenModel xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+    xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/tuscany.runtime.binding.axis/src/main/java"
+    editDirectory="/org.apache.tuscany.binding.axis2.edit/src" editorDirectory="/org.apache.tuscany.binding.axis2.editor/src"
+    modelPluginID="tuscany.runtime.binding.axis" modelName="Sca-assembly-webservice"
+    editPluginClass="org.apache.tuscany.binding.axis2.edit.provider.WebServiceAssemblyEditPlugin"
+    editorPluginClass="org.apache.tuscany.binding.axis2.editor.WebServiceAssemblyEditorPlugin"
+    rootExtendsInterface="" rootExtendsClass="org.eclipse.emf.ecore.sdo.impl.EDataObjectImpl"
+    rootImplementsInterface="org.eclipse.emf.ecore.sdo.InternalEDataObject" suppressEMFTypes="true"
+    featureMapWrapperInterface="commonj.sdo.Sequence" featureMapWrapperInternalInterface="org.eclipse.emf.ecore.sdo.util.ESequence"
+    featureMapWrapperClass="org.eclipse.emf.ecore.sdo.util.BasicESequence" testsDirectory="/tuscany.runtime.binding.axis/src/test/java"
+    testSuiteClass="org.apache.tuscany.binding.axis2.assembly.sdo.tests.WebServiceAssemblyTests"
+    booleanFlagsField="" importerID="org.eclipse.xsd.ecore.importer" usedGenPackages="sca-assembly.genmodel#//assembly">
+  <foreignModel>sca-binding-webservice.xsd</foreignModel>
+  <staticPackages>http://www.eclipse.org/emf/2003/SDO</staticPackages>
+  <modelPluginVariables>EMF_COMMONJ_SDO=org.eclipse.emf.commonj.sdo</modelPluginVariables>
+  <modelPluginVariables>EMF_ECORE_SDO=org.eclipse.emf.ecore.sdo</modelPluginVariables>
+  <genPackages prefix="WebServiceAssembly" basePackage="org.apache.tuscany.binding.axis"
+      disposableProviderFactory="true" adapterFactory="false" interfacePackageSuffix="binding"
+      classPackageSuffix="binding.impl" utilityPackageSuffix="binding.util" testsPackageSuffix="binding.tests"
+      ecorePackage="sca-assembly-webservice.ecore#/">
+    <genClasses ecoreClass="sca-assembly-webservice.ecore#//DocumentRoot">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute sca-assembly-webservice.ecore#//DocumentRoot/mixed"/>
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sca-assembly-webservice.ecore#//DocumentRoot/xMLNSPrefixMap"/>
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sca-assembly-webservice.ecore#//DocumentRoot/xSISchemaLocation"/>
+      <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference sca-assembly-webservice.ecore#//DocumentRoot/bindingWs"/>
+    </genClasses>
+    <genClasses ecoreClass="sca-assembly-webservice.ecore#//WebServiceBinding">
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute sca-assembly-webservice.ecore#//WebServiceBinding/any"/>
+      <genFeatures createChild="false" ecoreFeature="ecore:EAttribute sca-assembly-webservice.ecore#//WebServiceBinding/port"/>
+      <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute sca-assembly-webservice.ecore#//WebServiceBinding/anyAttribute"/>
+    </genClasses>
+  </genPackages>
+</genmodel:GenModel>