You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by mv...@apache.org on 2006/10/13 15:29:44 UTC

svn commit: r463711 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ test/java/org/apache/yoko/tools/processors/ test/resources/idl/

Author: mvescovi
Date: Fri Oct 13 08:29:42 2006
New Revision: 463711

URL: http://svn.apache.org/viewvc?view=rev&rev=463711
Log:
[YOKO-192] Adding support for IDL interface attributes

Added:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idl/Attributes.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl   (with props)
Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java

Added: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java?view=auto&rev=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java (added)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java Fri Oct 13 08:29:42 2006
@@ -0,0 +1,349 @@
+/**
+ * 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.yoko.tools.processors.idl;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.PortType;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensionRegistry;
+
+import javax.xml.namespace.QName;
+
+import antlr.ASTVisitor;
+import antlr.collections.AST;
+
+import org.apache.schemas.yoko.bindings.corba.ArgType;
+import org.apache.schemas.yoko.bindings.corba.ModeType;
+import org.apache.schemas.yoko.bindings.corba.OperationType;
+import org.apache.schemas.yoko.bindings.corba.ParamType;
+import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
+
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaType;
+
+import org.apache.yoko.wsdl.CorbaConstants;
+import org.apache.yoko.wsdl.CorbaTypeImpl;
+
+public class AttributeVisitor implements ASTVisitor {
+
+    private static final String GETTER_PREFIX     = "_get_";
+    private static final String SETTER_PREFIX     = "_set_";
+    private static final String RESULT_POSTFIX    = "Result";
+    private static final String RESPONSE_POSTFIX  = "Response";
+    private static final String PART_NAME         = "parameters";
+    private static final String PARAM_NAME        = "_arg";
+    private static final String RETURN_PARAM_NAME = "return";
+    
+    private WSDLASTVisitor      wsdlASTVisitor;
+    private XmlSchema           schema;
+    private XmlSchemaCollection schemas;
+    private TypeMappingType     typeMap;
+    private Definition          definition;
+    private ExtensionRegistry   extReg;
+    private PortType            portType;
+    private Binding             binding;
+    
+    public AttributeVisitor(WSDLASTVisitor visitor,
+                            PortType wsdlPortType,
+                            Binding wsdlBinding) {
+        wsdlASTVisitor = visitor;
+        // REVISIT: there has to be a better way to access schema and schemas
+        TypesVisitor typesVisitor = wsdlASTVisitor.getTypesVisitor();
+        schema = typesVisitor.getSchema();
+        schemas = typesVisitor.getSchemas();
+        typeMap = typesVisitor.getCorbaTypeMapping();
+        //
+        definition = visitor.getDefinition();
+        extReg = definition.getExtensionRegistry();
+        portType = wsdlPortType;
+        binding = wsdlBinding;
+    }
+    
+    public void visit(AST attributeNode) {
+        AST node = attributeNode.getFirstChild();
+        
+        AST readonlyNode = null;
+        AST typeNode = null;
+        AST nameNode = null;
+        
+        if (node.getType() == IDLTokenTypes.LITERAL_readonly) {
+            readonlyNode = node;
+            typeNode = readonlyNode.getNextSibling();
+        } else {
+            typeNode = node;
+        }
+        nameNode = typeNode.getNextSibling();
+        
+        // getter is generated for readonly and readwrite attributes
+        generateGetter(typeNode, nameNode);
+        
+        // setter is generated only for readwrite attributes
+        if (readonlyNode == null) {
+            generateSetter(typeNode, nameNode);
+        }
+    }
+
+    private void generateGetter(AST typeNode, AST nameNode) {
+        // generate wrapped doc element in parameter
+        XmlSchemaElement inParameters = 
+            generateWrappedDocElement(null,
+                                      GETTER_PREFIX + nameNode.toString(),
+                                      PARAM_NAME);
+        // generate wrapped doc element out parameter
+        XmlSchemaElement outParameters = 
+            generateWrappedDocElement(typeNode, 
+                                      GETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX,
+                                      RETURN_PARAM_NAME);
+
+        // generate input message
+        Message inMsg = generateMessage(inParameters,
+                                        GETTER_PREFIX + nameNode.toString());
+        // generate output message
+        Message outMsg = generateMessage(outParameters,
+                                         GETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
+        
+        // generate operation
+        String name = GETTER_PREFIX + nameNode.toString();
+        Operation op = generateOperation(name, inMsg, outMsg);
+        
+        
+        // generate corba return param
+        ArgType corbaReturn = generateCorbaReturnParam(typeNode);
+        
+        // generate corba operation
+        OperationType corbaOp = generateCorbaOperation(op, null, corbaReturn);
+        
+        // generate binding
+        BindingOperation corbaBindingOp = generateCorbaBindingOperation(binding, op, corbaOp);
+    }
+
+    private void generateSetter(AST typeNode, AST nameNode) {
+        // generate wrapped doc element in parameter
+        XmlSchemaElement inParameters = 
+            generateWrappedDocElement(typeNode,
+                                      SETTER_PREFIX + nameNode.toString(),
+                                      PARAM_NAME);
+        // generate wrapped doc element out parameter
+        XmlSchemaElement outParameters =
+            generateWrappedDocElement(null,
+                                      SETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX,
+                                      RETURN_PARAM_NAME);
+        
+        // generate input message
+        Message inMsg = generateMessage(inParameters,
+                                        SETTER_PREFIX + nameNode.toString());
+        // generate output message
+        Message outMsg = generateMessage(outParameters,
+                                         SETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
+        
+        // generate operation
+        String name = SETTER_PREFIX + nameNode.toString();
+        Operation op = generateOperation(name, inMsg, outMsg);
+        
+        
+        // generate corba return param
+        ParamType corbaParam = generateCorbaParam(typeNode);
+        
+        // generate corba operation
+        OperationType corbaOp = generateCorbaOperation(op, corbaParam, null);
+        
+        // generate binding
+        BindingOperation corbaBindingOp = generateCorbaBindingOperation(binding, op, corbaOp);
+    }
+    
+    /** Generate a wrapped doc style XmlSchemaElement containing one element.
+     * 
+     * I.e.: generateWrappedDocElement(null, "foo", "bar");
+     * <xs:element name="foo">
+     *   <xs:complexType>
+     *     <xs:sequence>
+     *     </xs:sequence>
+     *   </xs:complexType>
+     * </xs:element>
+     * 
+     * i.e.: generateWrappedDocElement(type, "foo", "bar");
+     * <xs:element name="foo">
+     *   <xs:complexType>
+     *     <xs:sequence>
+     *       <xs:element name="bar" type="xs:short">
+     *       </xs:element>
+     *     </xs:sequence>
+     *   </xs:complexType>
+     * </xs:element>
+
+     * 
+     * @param typeNode is the type of the element wrapped in the sequence, no element is created if null.
+     * @param name is the name of the wrapping element.
+     * @param paramName is the name of the  wrapping element.
+     * @return the wrapping element.
+     */
+    private XmlSchemaElement generateWrappedDocElement(AST typeNode, String name, String paramName) {
+        XmlSchemaElement element = new XmlSchemaElement();
+        if (typeNode != null) {
+            //element.setSchemaType(TypesUtils.findType(schemas, schema, typeNode));
+            element.setSchemaTypeName(TypesUtils.findType(schemas, schema, typeNode).getQName());
+            element.setName(paramName);
+        }
+        
+        XmlSchemaSequence sequence = new XmlSchemaSequence();
+        if (typeNode != null) {
+            sequence.getItems().add(element);
+        }
+        
+        XmlSchemaComplexType complex = new XmlSchemaComplexType(schema);
+        complex.setParticle(sequence);
+        
+        XmlSchemaElement result = new XmlSchemaElement();
+        result.setName(name);
+        result.setQName(new QName(definition.getTargetNamespace(), name));
+        result.setSchemaType(complex);
+
+        
+        schema.getItems().add(result);
+        
+        return result;
+    }
+    
+    private Message generateMessage(XmlSchemaElement element, String name) {
+        Part part = definition.createPart();
+        part.setName(PART_NAME);
+        part.setElementName(element.getQName());
+        
+        Message result = definition.createMessage();
+        result.setQName(new QName(definition.getTargetNamespace(), name));
+        result.addPart(part);
+        result.setUndefined(false);
+        
+        definition.addMessage(result);
+        
+        return result;
+    }
+    
+    private Operation generateOperation(String name, Message inputMsg, Message outputMsg) {
+        Input input = definition.createInput();
+        input.setName(inputMsg.getQName().getLocalPart());
+        input.setMessage(inputMsg);
+        
+        Output output = definition.createOutput();
+        output.setName(outputMsg.getQName().getLocalPart());
+        output.setMessage(outputMsg);
+        
+        Operation result = definition.createOperation();
+        result.setName(name);
+        result.setInput(input);
+        result.setOutput(output);
+        result.setUndefined(false);
+        
+        portType.addOperation(result);
+        
+        return result;
+    }
+
+    private ArgType generateCorbaReturnParam(AST type) {
+        ArgType param = new ArgType();
+        param.setName(RETURN_PARAM_NAME);
+
+        XmlSchemaType stype     = TypesUtils.findType(schemas, schema, type);
+        CorbaTypeImpl corbaType = TypesUtils.findCorbaType(typeMap, stype.getQName());
+        
+        param.setIdltype(corbaType.getQName());
+        
+        return param;
+    }
+    
+    private ParamType generateCorbaParam(AST type) {
+        ParamType param = new ParamType();
+        param.setName(PARAM_NAME);
+        param.setMode(ModeType.IN);
+        
+        XmlSchemaType stype     = TypesUtils.findType(schemas, schema, type);
+        CorbaTypeImpl corbaType = TypesUtils.findCorbaType(typeMap, stype.getQName());
+        
+        param.setIdltype(corbaType.getQName());
+
+        return param;
+    }
+    
+    /** Generates a corba:operation in the corba:binding container within a wsdl:binding.
+     * 
+     * Only one (or none) corba parameter and only one (or none) corba return parameter are supported.
+     * 
+     * @param op is the wsdl operation to bind.
+     * @param param is the corba parameter, none if null.
+     * @param arg is the corba return parameter, none if null.
+     * @return the generated corba:operation.
+     */
+    private OperationType generateCorbaOperation(Operation op, ParamType param, ArgType arg) {
+        OperationType operation = new OperationType();
+        try {
+            operation = (OperationType)extReg.createExtension(BindingOperation.class,
+                                                              CorbaConstants.NE_CORBA_OPERATION);
+        } catch (WSDLException ex) {
+            throw new RuntimeException(ex);
+        }
+        operation.setName(op.getName());
+   
+        if (param != null) {
+            operation.getParam().add(param);
+        }
+        
+        if (arg != null) {
+            operation.setReturn(arg);
+        }
+        
+        return operation;
+    }
+    
+    private BindingOperation generateCorbaBindingOperation(Binding wsdlBinding,
+                                                           Operation op,
+                                                           OperationType corbaOp) {
+        BindingInput bindingInput = definition.createBindingInput();
+        bindingInput.setName(op.getInput().getName());
+        
+        BindingOutput bindingOutput = definition.createBindingOutput();
+        bindingOutput.setName(op.getOutput().getName());
+        
+        BindingOperation bindingOperation = definition.createBindingOperation();
+        bindingOperation.addExtensibilityElement(corbaOp);
+        bindingOperation.setOperation(op);
+        bindingOperation.setName(op.getName());
+
+        bindingOperation.setBindingInput(bindingInput);
+        bindingOperation.setBindingOutput(bindingOutput);
+        
+        binding.addBindingOperation(bindingOperation);
+
+        return bindingOperation;
+    }
+
+}

Propchange: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/AttributeVisitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java?view=diff&rev=463711&r1=463710&r2=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java Fri Oct 13 08:29:42 2006
@@ -72,7 +72,6 @@
             msgVisitor.createOutputMessage();
         }
         msgVisitor.visit(node);
-        node = node.getNextSibling();
     }
 
     private BindingOperation createBindingOperation(Binding wsdlBinding, Operation op) {

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java?view=diff&rev=463711&r1=463710&r2=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/PortTypeVisitor.java Fri Oct 13 08:29:42 2006
@@ -83,6 +83,12 @@
             case IDLTokenTypes.LITERAL_typedef:
                 typesVisitor.visit(node2);
                 break;
+            case IDLTokenTypes.LITERAL_attribute:
+                AttributeVisitor attributeVisitor = new AttributeVisitor(wsdlASTVisitor,
+                                                                         portType,
+                                                                         binding);
+                attributeVisitor.visit(node2);
+                break;
             default:
                 OperationVisitor operationVisitor = new OperationVisitor(wsdlASTVisitor,
                                                                          portType,

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java?view=diff&rev=463711&r1=463710&r2=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/TypesVisitor.java Fri Oct 13 08:29:42 2006
@@ -77,6 +77,18 @@
         createCorbaTypeMap();
     }
 
+    // REVISIT: remove this method
+    // schema should not be a member of TypesVisitor
+    public XmlSchema getSchema() {
+        return schema;
+    }
+    
+    // REVISIT: remove this method
+    // schemas should not be a member of TypesVisitor
+    public XmlSchemaCollection getSchemas() {
+        return schemas;
+    }
+    
     public TypeMappingType getCorbaTypeMapping() {
         return typeMap;
     }

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java?view=diff&rev=463711&r1=463710&r2=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java Fri Oct 13 08:29:42 2006
@@ -170,4 +170,8 @@
         testWSDLGeneration("/idl/String.idl", "/idl/expected_String.wsdl");
     }
 
+    public void testAttributesGeneration() throws Exception {
+        testWSDLGeneration("/idl/Attributes.idl", "/idl/expected_Attributes.wsdl");
+    }
+
 }

Added: incubator/yoko/trunk/tools/src/test/resources/idl/Attributes.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/Attributes.idl?view=auto&rev=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/Attributes.idl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/Attributes.idl Fri Oct 13 08:29:42 2006
@@ -0,0 +1,39 @@
+/* 
+ * 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.
+*/
+
+
+struct myStruct {
+    long   id;
+    string name;
+};
+
+interface If {
+
+    readonly attribute short ReadOnlyShort;
+             attribute long  ReadWriteLong;
+
+    readonly attribute myStruct readonlyMyStruct;
+             attribute myStruct readwriteMyStruct;
+
+
+    typedef string<20> myString;
+
+    readonly attribute myString readonlyMyString;
+             attribute myString readwriteMyString;
+};

Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl?view=auto&rev=463711
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl Fri Oct 13 08:29:42 2006
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/Attributes" xmlns:tns="http://schemas.apache.org/yoko/idl/Attributes" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/Attributes/typemap">
+    <corba:struct xmlns:ns4="http://schemas.apache.org/yoko/idl/Attributes" xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" repositoryID="IDL:myStruct:1.0" name="myStruct" type="ns4:myStruct">
+      <corba:member name="id" idltype="corba:long" />
+      <corba:member name="name" idltype="corba:string" />
+    </corba:struct>
+      <corba:anonstring xmlns:ns4="http://schemas.apache.org/yoko/idl/Attributes" xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" bound="20" name="_1_myString" type="ns4:myString" />
+      <corba:alias xmlns:ns4="http://schemas.apache.org/yoko/idl/Attributes" xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" basetype="_1_myString" repositoryID="IDL:myString:1.0" name="myString" type="ns4:myString" />
+    </corba:typeMapping>
+  <wsdl:types>
+    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/Attributes" xmlns="http://schemas.apache.org/yoko/idl/Attributes" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:complexType name="myStruct">
+        <xs:sequence>
+          <xs:element name="id" type="xs:int">
+          </xs:element>
+          <xs:element name="name" type="xs:string">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:element name="_get_ReadOnlyShort">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_ReadOnlyShortResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:short">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_ReadWriteLong">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_ReadWriteLongResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:int">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_ReadWriteLong">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="_arg" type="xs:int">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_ReadWriteLongResult">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readonlyMyStruct">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readonlyMyStructResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="myStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readwriteMyStruct">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readwriteMyStructResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="myStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_readwriteMyStruct">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="_arg" type="myStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_readwriteMyStructResult">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:simpleType name="myString">
+        <xs:restriction base="xs:string">
+          <xs:maxLength value="20">
+          </xs:maxLength>
+        </xs:restriction>
+      </xs:simpleType>
+      <xs:element name="_get_readonlyMyString">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readonlyMyStringResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="myString">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readwriteMyString">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_get_readwriteMyStringResult">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="myString">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_readwriteMyString">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="_arg" type="myString">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="_set_readwriteMyStringResult">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:schema>
+  </wsdl:types>
+  <wsdl:message name="_set_readwriteMyString">
+    <wsdl:part name="parameters" element="tns:_set_readwriteMyString"/>
+  </wsdl:message>
+  <wsdl:message name="_get_ReadOnlyShortResponse">
+    <wsdl:part name="parameters" element="tns:_get_ReadOnlyShortResult"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readwriteMyStructResponse">
+    <wsdl:part name="parameters" element="tns:_get_readwriteMyStructResult"/>
+  </wsdl:message>
+  <wsdl:message name="_set_readwriteMyStringResponse">
+    <wsdl:part name="parameters" element="tns:_set_readwriteMyStringResult"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readonlyMyStruct">
+    <wsdl:part name="parameters" element="tns:_get_readonlyMyStruct"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readwriteMyStruct">
+    <wsdl:part name="parameters" element="tns:_get_readwriteMyStruct"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readonlyMyStringResponse">
+    <wsdl:part name="parameters" element="tns:_get_readonlyMyStringResult"/>
+  </wsdl:message>
+  <wsdl:message name="_set_ReadWriteLongResponse">
+    <wsdl:part name="parameters" element="tns:_set_ReadWriteLongResult"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readwriteMyStringResponse">
+    <wsdl:part name="parameters" element="tns:_get_readwriteMyStringResult"/>
+  </wsdl:message>
+  <wsdl:message name="_set_readwriteMyStruct">
+    <wsdl:part name="parameters" element="tns:_set_readwriteMyStruct"/>
+  </wsdl:message>
+  <wsdl:message name="_set_readwriteMyStructResponse">
+    <wsdl:part name="parameters" element="tns:_set_readwriteMyStructResult"/>
+  </wsdl:message>
+  <wsdl:message name="_get_ReadWriteLong">
+    <wsdl:part name="parameters" element="tns:_get_ReadWriteLong"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readonlyMyStructResponse">
+    <wsdl:part name="parameters" element="tns:_get_readonlyMyStructResult"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readwriteMyString">
+    <wsdl:part name="parameters" element="tns:_get_readwriteMyString"/>
+  </wsdl:message>
+  <wsdl:message name="_get_ReadOnlyShort">
+    <wsdl:part name="parameters" element="tns:_get_ReadOnlyShort"/>
+  </wsdl:message>
+  <wsdl:message name="_get_readonlyMyString">
+    <wsdl:part name="parameters" element="tns:_get_readonlyMyString"/>
+  </wsdl:message>
+  <wsdl:message name="_set_ReadWriteLong">
+    <wsdl:part name="parameters" element="tns:_set_ReadWriteLong"/>
+  </wsdl:message>
+  <wsdl:message name="_get_ReadWriteLongResponse">
+    <wsdl:part name="parameters" element="tns:_get_ReadWriteLongResult"/>
+  </wsdl:message>
+  <wsdl:portType name="If">
+    <wsdl:operation name="_get_ReadOnlyShort">
+      <wsdl:input name="_get_ReadOnlyShort" message="tns:_get_ReadOnlyShort"/>
+      <wsdl:output name="_get_ReadOnlyShortResponse" message="tns:_get_ReadOnlyShortResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_get_ReadWriteLong">
+      <wsdl:input name="_get_ReadWriteLong" message="tns:_get_ReadWriteLong"/>
+      <wsdl:output name="_get_ReadWriteLongResponse" message="tns:_get_ReadWriteLongResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_set_ReadWriteLong">
+      <wsdl:input name="_set_ReadWriteLong" message="tns:_set_ReadWriteLong"/>
+      <wsdl:output name="_set_ReadWriteLongResponse" message="tns:_set_ReadWriteLongResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readonlyMyStruct">
+      <wsdl:input name="_get_readonlyMyStruct" message="tns:_get_readonlyMyStruct"/>
+      <wsdl:output name="_get_readonlyMyStructResponse" message="tns:_get_readonlyMyStructResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readwriteMyStruct">
+      <wsdl:input name="_get_readwriteMyStruct" message="tns:_get_readwriteMyStruct"/>
+      <wsdl:output name="_get_readwriteMyStructResponse" message="tns:_get_readwriteMyStructResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_set_readwriteMyStruct">
+      <wsdl:input name="_set_readwriteMyStruct" message="tns:_set_readwriteMyStruct"/>
+      <wsdl:output name="_set_readwriteMyStructResponse" message="tns:_set_readwriteMyStructResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readonlyMyString">
+      <wsdl:input name="_get_readonlyMyString" message="tns:_get_readonlyMyString"/>
+      <wsdl:output name="_get_readonlyMyStringResponse" message="tns:_get_readonlyMyStringResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readwriteMyString">
+      <wsdl:input name="_get_readwriteMyString" message="tns:_get_readwriteMyString"/>
+      <wsdl:output name="_get_readwriteMyStringResponse" message="tns:_get_readwriteMyStringResponse"/>
+    </wsdl:operation>
+    <wsdl:operation name="_set_readwriteMyString">
+      <wsdl:input name="_set_readwriteMyString" message="tns:_set_readwriteMyString"/>
+      <wsdl:output name="_set_readwriteMyStringResponse" message="tns:_set_readwriteMyStringResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="IfCORBABinding" type="tns:If">
+    <corba:binding repositoryID="IDL:If:1.0" />
+    <wsdl:operation name="_get_ReadOnlyShort">
+      <corba:operation name="_get_ReadOnlyShort">
+        <corba:return name="return" idltype="corba:short" />
+      </corba:operation>
+      <wsdl:input name="_get_ReadOnlyShort">
+      </wsdl:input>
+      <wsdl:output name="_get_ReadOnlyShortResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_get_ReadWriteLong">
+      <corba:operation name="_get_ReadWriteLong">
+        <corba:return name="return" idltype="corba:long" />
+      </corba:operation>
+      <wsdl:input name="_get_ReadWriteLong">
+      </wsdl:input>
+      <wsdl:output name="_get_ReadWriteLongResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_set_ReadWriteLong">
+      <corba:operation name="_set_ReadWriteLong">
+        <corba:param mode="in" name="_arg" idltype="corba:long" />
+      </corba:operation>
+      <wsdl:input name="_set_ReadWriteLong">
+      </wsdl:input>
+      <wsdl:output name="_set_ReadWriteLongResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readonlyMyStruct">
+      <corba:operation name="_get_readonlyMyStruct">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" name="return" idltype="myStruct" />
+      </corba:operation>
+      <wsdl:input name="_get_readonlyMyStruct">
+      </wsdl:input>
+      <wsdl:output name="_get_readonlyMyStructResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readwriteMyStruct">
+      <corba:operation name="_get_readwriteMyStruct">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" name="return" idltype="myStruct" />
+      </corba:operation>
+      <wsdl:input name="_get_readwriteMyStruct">
+      </wsdl:input>
+      <wsdl:output name="_get_readwriteMyStructResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_set_readwriteMyStruct">
+      <corba:operation name="_set_readwriteMyStruct">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" mode="in" name="_arg" idltype="myStruct" />
+      </corba:operation>
+      <wsdl:input name="_set_readwriteMyStruct">
+      </wsdl:input>
+      <wsdl:output name="_set_readwriteMyStructResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readonlyMyString">
+      <corba:operation name="_get_readonlyMyString">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" name="return" idltype="myString" />
+      </corba:operation>
+      <wsdl:input name="_get_readonlyMyString">
+      </wsdl:input>
+      <wsdl:output name="_get_readonlyMyStringResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_get_readwriteMyString">
+      <corba:operation name="_get_readwriteMyString">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" name="return" idltype="myString" />
+      </corba:operation>
+      <wsdl:input name="_get_readwriteMyString">
+      </wsdl:input>
+      <wsdl:output name="_get_readwriteMyStringResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="_set_readwriteMyString">
+      <corba:operation name="_set_readwriteMyString">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/Attributes/typemap" mode="in" name="_arg" idltype="myString" />
+      </corba:operation>
+      <wsdl:input name="_set_readwriteMyString">
+      </wsdl:input>
+      <wsdl:output name="_set_readwriteMyStringResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="IfCORBAService">
+    <wsdl:port name="IfCORBAPort" binding="tns:IfCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Attributes.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml