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 en...@apache.org on 2006/09/08 11:08:49 UTC

svn commit: r441474 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/wsdl/ test/java/org/apache/yoko/tools/processors/ test/resources/idlgen/ test/resources/wsdl/

Author: enolan
Date: Fri Sep  8 04:08:48 2006
New Revision: 441474

URL: http://svn.apache.org/viewvc?view=rev&rev=441474
Log:
Yoko-160 -Adding support for any type in wsdltoidl tool.

Added:
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_any.idl
    incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl   (with props)
Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java?view=diff&rev=441474&r1=441473&r2=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLParameter.java Fri Sep  8 04:08:48 2006
@@ -109,9 +109,15 @@
                                 inputs.add(paramtype);
                             }
                         }                        
-                    } else {                        
-                        paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(), part
-                            .getElementName());
+                    } else {
+                        QName typeName = null;
+                        if (schemaType == null) {
+                            typeName = getElementsTypeName(part, xmlSchemaList);
+                        } else {
+                            typeName = part.getElementName();
+                        }
+                        paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(),
+                                                      typeName);                        
                         if (paramtype != null) {
                             inputs.add(paramtype);
                         }
@@ -192,8 +198,14 @@
                             }                            
                         }                        
                     } else {
-                        updateList(wsdlToCorbaBinding, schemaType, part.getName(), part.getName(), 
-                               part.getElementName(), inputs, outputs);                                
+                        QName typeName = null;
+                        if (schemaType == null) {
+                            typeName = getElementsTypeName(part, xmlSchemaList);
+                        } else {
+                            typeName = part.getElementName();
+                        }
+                        updateList(wsdlToCorbaBinding, schemaType, part.getName(), 
+                                   part.getName(), typeName, inputs, outputs);                        
                     }
                 } else {
                     if (part.getTypeName() != null) {
@@ -384,7 +396,9 @@
             if (part.getElementName() != null) {
                 XmlSchemaElement schemaElement = xmlSchemaType.getElementByName(part.getElementName());
                 if (schemaElement != null) {
-                    schemaType = schemaElement.getSchemaType();
+                    if (schemaElement.getSchemaType() != null) {
+                        schemaType = schemaElement.getSchemaType();
+                    } 
                 }
             } else {
                 if (part.getTypeName() != null) {
@@ -394,11 +408,29 @@
             if (schemaType != null) {
                 return schemaType;
             }
-        }
-            
+        }            
         return schemaType;
     }
     
+    private static QName getElementsTypeName(Part part, List<XmlSchema> xmlSchemaList) throws Exception {
+        QName schemaTypeName = null;
+        
+        Iterator i = xmlSchemaList.iterator();
+        while (i.hasNext()) {
+            XmlSchema xmlSchemaType = (XmlSchema)i.next();
+            
+            if (part.getElementName() != null) {
+                XmlSchemaElement schemaElement = xmlSchemaType.getElementByName(part.getElementName());
+                if (schemaElement != null) {
+                    if (schemaElement.getSchemaTypeName() != null) {
+                        return schemaElement.getSchemaTypeName();
+                    } 
+                }
+            }
+        }
+        return schemaTypeName;
+    }
+        
     private static ParamType createParam(WSDLToCorbaBinding wsdlToCorbaBinding, 
                                          String mode, XmlSchemaType schemaType, 
                                          String name, QName typeName) throws Exception {

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java?view=diff&rev=441474&r1=441473&r2=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaBinding.java Fri Sep  8 04:08:48 2006
@@ -457,15 +457,18 @@
                     } else {
                         anonymous = isAnonymous(el.getSchemaType().getName());
                     }
-                    corbaTypeImpl = 
-                        convertSchemaToCorbaType(el.getSchemaType(),
-                                                 el.getQName(), el.getSchemaType(), anonymous);               
-                    if (corbaTypeImpl != null) { 
-                        if (corbaTypeImpl.getQName() != null) {
-                            corbaTypeImpl.setQName(null);        
-                        }
-                        if (!isDuplicate(corbaTypeImpl)) {
-                            typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
+                    
+                    if (el.getSchemaType() != null) {
+                        corbaTypeImpl = 
+                            convertSchemaToCorbaType(el.getSchemaType(),
+                                                 el.getQName(), el.getSchemaType(), anonymous);
+                        if (corbaTypeImpl != null) { 
+                            if (corbaTypeImpl.getQName() != null) {
+                                corbaTypeImpl.setQName(null);        
+                            }
+                            if (!isDuplicate(corbaTypeImpl)) {
+                                typeMappingType.getStructOrExceptionOrUnion().add(corbaTypeImpl);
+                            }
                         }
                     }                   
                 }
@@ -747,10 +750,16 @@
             // Need TO DO
             // Need to check if its referencing a type first refname=""
             //if (element.getRefName()
-            XmlSchemaType st = element.getSchemaType();
-            boolean anonymous = isAnonymous(st.getName());
-            //membertype = convertSchemaToCorbaType(st, element.getQName(), st, false);
-            membertype = convertSchemaToCorbaType(st, element.getQName(), st, anonymous);
+            if (element.getSchemaType() != null) {
+                XmlSchemaType st = element.getSchemaType();
+                boolean anonymous = isAnonymous(st.getName());            
+                membertype = convertSchemaToCorbaType(st, element.getQName(), st, anonymous);
+            } else {
+                if (element.getSchemaTypeName() != null) {
+                    QName elName = checkPrefix(element.getSchemaTypeName());
+                    membertype = getLocalType(elName);
+                }
+            }
         }
 
         if (!(element.getMaxOccurs() == 1) || !(element.getMinOccurs() == 1)) {

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java?view=diff&rev=441474&r1=441473&r2=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java Fri Sep  8 04:08:48 2006
@@ -91,8 +91,8 @@
             }
         }
         return null;
-    }
-
+    }    
+    
     // tests anonymous strings and fixed types.
     public void testAnonFixedType() throws Exception {
         
@@ -104,14 +104,7 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                    break;
-                }
-            }
+            Element typemap = getElementNode(document, "corba:typeMapping");            
             assertNotNull(typemap);
             assertEquals(1, typemap.getElementsByTagName("corba:anonfixed").getLength());            
             assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());            
@@ -168,15 +161,8 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                    break;
-                }
-            }
-            assertNotNull(typemap);
+            Element typemap = getElementNode(document, "corba:typeMapping");            
+            //assertNotNull(typemap);
             assertEquals(3, typemap.getElementsByTagName("corba:anonsequence").getLength());            
             assertEquals(2, typemap.getElementsByTagName("corba:anonarray").getLength());
             assertEquals(1, typemap.getElementsByTagName("corba:array").getLength());
@@ -377,15 +363,8 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                    break;
-                }
-            }
-            assertNotNull(typemap);
+            Element typemap = getElementNode(document, "corba:typeMapping");            
+            //assertNotNull(typemap);
             assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());
 
             WSDLToIDLAction idlgen = new WSDLToIDLAction();
@@ -410,15 +389,8 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                    break;
-                }
-            }
-            assertNotNull(typemap);
+            Element typemap = getElementNode(document, "corba:typeMapping");            
+            //assertNotNull(typemap);
             assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());
             assertEquals(6, typemap.getElementsByTagName("corba:struct").getLength());
 
@@ -444,14 +416,8 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                }
-            }
-            assertNotNull(typemap);
+            Element typemap = getElementNode(document, "corba:typeMapping");
+            //assertNotNull(typemap);
             assertEquals(2, typemap.getElementsByTagName("corba:sequence").getLength());
             assertEquals(5, typemap.getElementsByTagName("corba:exception").getLength());
             assertEquals(70, typemap.getElementsByTagName("corba:struct").getLength());
@@ -477,13 +443,7 @@
             Definition model = generator.generateCORBABinding();
             Document document = writer.getDocument(model);
 
-            Element typemap = null;
-            Element root = document.getDocumentElement();
-            for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-                if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                    typemap = (Element)nd;
-                }
-            }
+            Element typemap = getElementNode(document, "corba:typeMapping");
             assertNotNull(typemap);
             assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());
             assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());
@@ -615,13 +575,7 @@
         Definition model = generator.generateCORBABinding();
         Document document = writer.getDocument(model);        
 
-        Element typemap = null;
-        Element root = document.getDocumentElement();
-        for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-            if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                typemap = (Element)nd;
-            }
-        } 
+        Element typemap = getElementNode(document, "corba:typeMapping"); 
         assertNotNull(typemap);
         assertEquals(2, typemap.getElementsByTagName("corba:sequence").getLength());
         assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());        
@@ -656,14 +610,7 @@
         Definition model = generator.generateCORBABinding();
         Document document = writer.getDocument(model);        
 
-        Element typemap = null;
-        Element root = document.getDocumentElement();
-        for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
-            if (Node.ELEMENT_NODE == nd.getNodeType() && ("corba:typeMapping".equals(nd.getNodeName()))) {
-                typemap = (Element)nd;
-                break;
-            }
-        } 
+        Element typemap = getElementNode(document, "corba:typeMapping"); 
         assertNotNull(typemap);        
         assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());        
     }

Added: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java?view=auto&rev=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java (added)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java Fri Sep  8 04:08:48 2006
@@ -0,0 +1,103 @@
+/**
+ * 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;
+
+import java.io.File;
+import javax.wsdl.Definition;
+import javax.wsdl.xml.WSDLWriter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import junit.framework.TestCase;
+
+import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
+import org.apache.yoko.tools.common.WSDLCorbaFactory;
+import org.apache.yoko.tools.processors.wsdl.WSDLToCorbaBinding;
+import org.apache.yoko.tools.processors.wsdl.WSDLToIDLAction;
+
+public class WSDLToCorbaBindingTypeTest extends TestCase {
+    WSDLToCorbaBinding generator;
+    WSDLWriter writer;
+
+    public WSDLToCorbaBindingTypeTest(String name) {
+        super(name);
+    }
+
+    protected void setUp() {
+        System.setProperty("UseWSDLModelCaching", "false");
+        generator = new WSDLToCorbaBinding();
+        try {
+            WSDLCorbaFactory wsdlfactory = WSDLCorbaFactory
+                .newInstance("org.apache.yoko.tools.common.WSDLCorbaFactoryImpl");
+    
+            writer = wsdlfactory.newWSDLWriter();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    protected void tearDown() {
+        System.setProperty("UseWSDLModelCaching", "true");
+    }
+
+    public static void main(String args[]) {
+        junit.textui.TestRunner.run(WSDLToCorbaBindingTest.class);
+    }
+    
+    private Element getElementNode(Document document, String elName) {
+        Element root = document.getDocumentElement();
+        for (Node nd = root.getFirstChild(); nd != null; nd = nd.getNextSibling()) {
+            if (Node.ELEMENT_NODE == nd.getNodeType() && (elName.equals(nd.getNodeName()))) {
+                return (Element)nd;                
+            }
+        }
+        return null;
+    }
+
+    public void testAnyType() throws Exception {
+        
+        try {
+            String fileName = getClass().getResource("/wsdl/any.wsdl").toString();
+            generator.setWsdlFile(fileName);
+            generator.addInterfaceName("anyInterface");
+
+            Definition model = generator.generateCORBABinding();
+            Document document = writer.getDocument(model);
+
+            Element typemap = getElementNode(document, "corba:typeMapping");
+            assertNotNull(typemap);
+            assertEquals(2, typemap.getElementsByTagName("corba:union").getLength());
+            assertEquals(3, typemap.getElementsByTagName("corba:struct").getLength());            
+            
+            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);            
+
+            WSDLToIDLAction idlgen = new WSDLToIDLAction();
+            idlgen.setBindingName("anyInterfaceCORBABinding");
+            idlgen.setOutputFile("any.idl");
+            idlgen.generateIDL(model);
+
+            File f = new File("any.idl");
+            assertTrue("any.idl should be generated", f.exists());
+        } finally {
+            new File("any.idl").deleteOnExit();
+        }
+    }
+    
+}

Propchange: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java?view=diff&rev=441474&r1=441473&r2=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToIDLGenerationTest.java Fri Sep  8 04:08:48 2006
@@ -368,5 +368,25 @@
         }
     }
 
+    public void testAnyTypeIdlgen() throws Exception {
+        
+        try {
+            String fileName = getClass().getResource("/idlgen/any.wsdl").toString();
+            idlgen.setWsdlFile(fileName);
+            
+            idlgen.setBindingName("anyInterfaceCORBABinding");
+            idlgen.setOutputFile("any.idl");            
+            idlgen.setOutput(new PrintWriter(idloutput));
+            idlgen.generateIDL(null);
+
+            InputStream origstream = getClass().getResourceAsStream("/idlgen/expected_any.idl");
+            byte orig[] = inputStreamToBytes(origstream);
+
+            checkIDLStrings(orig, idloutput.toByteArray());
+        } finally {
+            new File("any.idl").deleteOnExit();
+        }
+    }
+
     
 }

Added: incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl?view=auto&rev=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl Fri Sep  8 04:08:48 2006
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="any.idl" targetNamespace="http://schemas.apache.org/idl/any.idl" xmlns:tns="http://schemas.apache.org/idl/any.idl" xmlns:corbatm="http://schemas.apache.org/typemap/corba/any.idl" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:ns1="http://schemas.apache.org/idl/any.idl/corba/typemap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl" xmlns:references="http://schemas.apache.org/references" xmlns="http://schemas.xmlsoap.org/wsdl/">
+  <corba:typeMapping targetNamespace="http://schemas.apache.org/idl/any.idl/corba/typemap/">
+    <corba:union xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl" discriminator="corba:long" repositoryID="IDL:anyInterface/_omg_SimpleUnion:1.0" type="xsd1:anyInterface._omg_SimpleUnion" name="anyInterface._omg_SimpleUnion">
+      <corba:unionbranch name="varString" idltype="corba:string" default="false">
+        <corba:case label="0" />
+      </corba:unionbranch>
+        <corba:unionbranch name="varAny" idltype="corba:any" default="false">
+          <corba:case label="1" />
+        </corba:unionbranch>
+          <corba:unionbranch name="varFloat" idltype="corba:float" default="false">
+            <corba:case label="2" />
+          </corba:unionbranch>
+          </corba:union>
+            <corba:struct xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl" repositoryID="IDL:anyInterface/ErrorInfoEnh:1.0" type="xsd1:anyInterface.ErrorInfoEnh" name="anyInterface.ErrorInfoEnh">
+              <corba:member name="errorCode" idltype="corba:long" />
+              <corba:member name="errorMessage" idltype="corba:string" />
+              <corba:member name="errorData" idltype="corba:any" />
+            </corba:struct>
+              <corba:struct xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl" repositoryID="IDL:anyInterface/PrimitiveStruct:1.0" type="xsd1:anyInterface.PrimitiveStruct" name="anyInterface.PrimitiveStruct">
+                <corba:member name="varLong" idltype="corba:long" />
+                <corba:member name="varShort" idltype="corba:short" />
+                <corba:member name="varFloat" idltype="corba:float" />
+                <corba:member name="varDouble" idltype="corba:double" />
+                <corba:member name="varChar" idltype="corba:char" />
+                <corba:member name="varBoolean" idltype="corba:boolean" />
+                <corba:member name="varOctet" idltype="corba:octet" />
+                <corba:member name="varString" idltype="corba:string" />
+                <corba:member name="varUlong" idltype="corba:ulong" />
+                <corba:member name="varUshort" idltype="corba:ushort" />
+                <corba:member name="varAny" idltype="corba:any" />
+              </corba:struct>
+                <corba:union xmlns:ns3="http://schemas.apache.org/idltypes/any.idl" discriminator="corba:long" repositoryID="IDL:anyInterface/SimpleUnion:1.0" type="ns3:anyInterface.SimpleUnion" name="anyInterface.SimpleUnion">
+                  <corba:unionbranch name="varString" idltype="corba:string" default="false">
+                    <corba:case label="0" />
+                  </corba:unionbranch>
+                    <corba:unionbranch name="varAny" idltype="corba:any" default="false">
+                      <corba:case label="1" />
+                    </corba:unionbranch>
+                      <corba:unionbranch name="varFloat" idltype="corba:float" default="false">
+                        <corba:case label="2" />
+                      </corba:unionbranch>
+                      </corba:union>
+                        <corba:struct xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl" repositoryID="IDL:anyInterface/SimpleStruct:1.0" type="xsd1:anyInterface.SimpleStruct" name="anyInterface.SimpleStruct">
+                          <corba:member name="varFloat" idltype="corba:float" />
+                          <corba:member name="varAny" idltype="corba:any" />
+                          <corba:member name="varString" idltype="corba:string" />
+                        </corba:struct>
+                          <corba:const xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="" xmlns:ns4="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="corbaTypeImpl" type="xs:string" name="string" />
+                        </corba:typeMapping>
+  <types>
+    <schema targetNamespace="http://schemas.apache.org/idltypes/any.idl" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+      <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.SimpleStruct">
+        <xsd:sequence>
+          <xsd:element name="varFloat" type="xsd:float"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+          <xsd:element name="varString" type="xsd:string"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.PrimitiveStruct">
+        <xsd:sequence>
+          <xsd:element name="varLong" type="xsd:int"/>
+          <xsd:element name="varShort" type="xsd:short"/>
+          <xsd:element name="varFloat" type="xsd:float"/>
+          <xsd:element name="varDouble" type="xsd:double"/>
+          <xsd:element name="varChar" type="xsd:byte"/>
+          <xsd:element name="varBoolean" type="xsd:boolean"/>
+          <xsd:element name="varOctet" type="xsd:unsignedByte"/>
+          <xsd:element name="varString" type="xsd:string"/>
+          <xsd:element name="varUlong" type="xsd:unsignedInt"/>
+          <xsd:element name="varUshort" type="xsd:unsignedShort"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.SimpleUnion">
+        <xsd:choice>
+          <xsd:element name="varString" type="xsd:string"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+          <xsd:element name="varFloat" type="xsd:float"/>
+        </xsd:choice>
+      </xsd:complexType>
+      <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface._omg_SimpleUnion">
+        <xsd:sequence>
+          <xsd:element maxOccurs="1" minOccurs="1" name="discriminator" type="xsd:int"/>
+          <xsd:choice maxOccurs="1" minOccurs="0">
+            <xsd:element name="varString" type="xsd:string"/>
+            <xsd:element name="varAny" type="xsd:anyType"/>
+            <xsd:element name="varFloat" type="xsd:float"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.ErrorInfoEnh">
+        <xsd:sequence>
+          <xsd:element name="errorCode" type="xsd:int"/>
+          <xsd:element name="errorMessage" type="xsd:string"/>
+          <xsd:element name="errorData" type="xsd:anyType"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.test_any.p" type="xsd:string"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.test_any.x" type="xsd:anyType"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.test_any.y" type="xsd:anyType"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.test_any.z" type="xsd:anyType"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="anyInterface.test_any.return" type="xsd:anyType"/>
+    </schema>
+  </types>
+  <message name="anyInterface.test_anyResponse">
+    <part name="return" element="xsd1:anyInterface.test_any.return"/>
+    <part name="y" element="xsd1:anyInterface.test_any.y"/>
+    <part name="z" element="xsd1:anyInterface.test_any.z"/>
+  </message>
+  <message name="anyInterface.test_any">
+    <part name="p" element="xsd1:anyInterface.test_any.p"/>
+    <part name="x" element="xsd1:anyInterface.test_any.x"/>
+    <part name="y" element="xsd1:anyInterface.test_any.y"/>
+  </message>
+  <portType name="anyInterface">
+    <operation name="test_any">
+      <input name="test_any" message="tns:anyInterface.test_any"/>
+      <output name="test_anyResponse" message="tns:anyInterface.test_anyResponse"/>
+    </operation>
+  </portType>
+  <binding name="anyInterfaceCORBABinding" type="tns:anyInterface">
+    <corba:binding repositoryID="IDL:anyInterface:1.0" />
+    <operation name="test_any">
+      <corba:operation name="test_any">
+        <corba:param mode="in" name="p" idltype="corba:string" />
+        <corba:param mode="in" name="x" idltype="corba:any" />
+        <corba:param mode="out" name="z" idltype="corba:any" />
+        <corba:param mode="inout" name="y" idltype="corba:any" />
+        <corba:return name="return" idltype="corba:any" />
+      </corba:operation>
+      <input name="test_any">
+      </input>
+      <output name="test_anyResponse">
+      </output>
+    </operation>
+  </binding>
+</definitions>

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

Propchange: incubator/yoko/trunk/tools/src/test/resources/idlgen/any.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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

Added: incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_any.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_any.idl?view=auto&rev=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_any.idl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_any.idl Fri Sep  8 04:08:48 2006
@@ -0,0 +1,48 @@
+interface anyInterface {
+    union _omg_SimpleUnion switch(long) {
+        case 0:
+            string varString;
+        case 1:
+            any varAny;
+        case 2:
+            float varFloat;
+    };
+    struct ErrorInfoEnh {
+        long errorCode;
+        string errorMessage;
+        any errorData;
+    };
+    struct PrimitiveStruct {
+        long varLong;
+        short varShort;
+        float varFloat;
+        double varDouble;
+        char varChar;
+        boolean varBoolean;
+        octet varOctet;
+        string varString;
+        unsigned long varUlong;
+        unsigned short varUshort;
+        any varAny;
+    };
+    union SimpleUnion switch(long) {
+        case 0:
+            string varString;
+        case 1:
+            any varAny;
+        case 2:
+            float varFloat;
+    };
+    struct SimpleStruct {
+        float varFloat;
+        any varAny;
+        string varString;
+    };
+    any
+    test_any(
+        in string p,
+        in any x,
+        out any z,
+        inout any y
+    );
+};

Added: incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl?view=auto&rev=441474
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl Fri Sep  8 04:08:48 2006
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="any.idl"
+ targetNamespace="http://schemas.apache.org/idl/any.idl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://schemas.apache.org/idl/any.idl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://schemas.apache.org/idltypes/any.idl"
+ xmlns:corba="http://schemas.apache.org/bindings/corba"
+ xmlns:corbatm="http://schemas.apache.org/typemap/corba/any.idl"
+ xmlns:references="http://schemas.apache.org/references">
+  <types>
+    <schema targetNamespace="http://schemas.apache.org/idltypes/any.idl"
+     xmlns="http://www.w3.org/2001/XMLSchema"
+     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+      <xsd:complexType name="anyInterface.SimpleStruct">
+        <xsd:sequence>
+          <xsd:element name="varFloat" type="xsd:float"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+          <xsd:element name="varString" type="xsd:string"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType name="anyInterface.PrimitiveStruct">
+        <xsd:sequence>
+          <xsd:element name="varLong" type="xsd:int"/>
+          <xsd:element name="varShort" type="xsd:short"/>
+          <xsd:element name="varFloat" type="xsd:float"/>
+          <xsd:element name="varDouble" type="xsd:double"/>
+          <xsd:element name="varChar" type="xsd:byte"/>
+          <xsd:element name="varBoolean" type="xsd:boolean"/>
+          <xsd:element name="varOctet" type="xsd:unsignedByte"/>
+          <xsd:element name="varString" type="xsd:string"/>
+          <xsd:element name="varUlong" type="xsd:unsignedInt"/>
+          <xsd:element name="varUshort" type="xsd:unsignedShort"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType name="anyInterface.SimpleUnion">
+        <xsd:choice>
+          <xsd:element name="varString" type="xsd:string"/>
+          <xsd:element name="varAny" type="xsd:anyType"/>
+          <xsd:element name="varFloat" type="xsd:float"/>
+        </xsd:choice>
+      </xsd:complexType>
+      <xsd:complexType name="anyInterface._omg_SimpleUnion">
+        <xsd:sequence>
+          <xsd:element minOccurs="1" maxOccurs="1" name="discriminator" type="xsd:int"/>
+          <xsd:choice minOccurs="0" maxOccurs="1">
+            <xsd:element name="varString" type="xsd:string"/>
+            <xsd:element name="varAny" type="xsd:anyType"/>
+            <xsd:element name="varFloat" type="xsd:float"/>
+          </xsd:choice>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:complexType name="anyInterface.ErrorInfoEnh">
+        <xsd:sequence>
+          <xsd:element name="errorCode" type="xsd:int"/>
+          <xsd:element name="errorMessage" type="xsd:string"/>
+          <xsd:element name="errorData" type="xsd:anyType"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:element name="anyInterface.test_any.p" type="xsd:string"/>
+      <xsd:element name="anyInterface.test_any.x" type="xsd:anyType"/>
+      <xsd:element name="anyInterface.test_any.y" type="xsd:anyType"/>
+      <xsd:element name="anyInterface.test_any.z" type="xsd:anyType"/>
+      <xsd:element name="anyInterface.test_any.return" type="xsd:anyType"/>
+    </schema>
+  </types>
+  <message name="anyInterface.test_any">
+    <part name="p" element="xsd1:anyInterface.test_any.p"/>
+    <part name="x" element="xsd1:anyInterface.test_any.x"/>
+    <part name="y" element="xsd1:anyInterface.test_any.y"/>
+  </message>
+  <message name="anyInterface.test_anyResponse">
+    <part name="return" element="xsd1:anyInterface.test_any.return"/>
+    <part name="y" element="xsd1:anyInterface.test_any.y"/>
+    <part name="z" element="xsd1:anyInterface.test_any.z"/>
+  </message>
+  <portType name="anyInterface">
+    <operation name="test_any">
+      <input message="tns:anyInterface.test_any" name="test_any"/>
+      <output message="tns:anyInterface.test_anyResponse" name="test_anyResponse"/>
+    </operation>
+  </portType>
+</definitions>

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

Propchange: incubator/yoko/trunk/tools/src/test/resources/wsdl/any.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

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