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/08/29 10:05:22 UTC

svn commit: r438038 - 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: Tue Aug 29 03:05:18 2006
New Revision: 438038

URL: http://svn.apache.org/viewvc?rev=438038&view=rev
Log:
Yoko-146 - Support for fixed types in wsdltoidl.

Added:
    incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_fixed.idl
    incubator/yoko/trunk/tools/src/test/resources/idlgen/fixed.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/wsdl/fixed.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/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.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?rev=438038&r1=438037&r2=438038&view=diff
==============================================================================
--- 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 Tue Aug 29 03:05:18 2006
@@ -37,14 +37,14 @@
 import org.apache.schemas.yoko.bindings.corba.ParamType;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaChoice;
-//import org.apache.ws.commons.schema.XmlSchemaComplexContent;
-//import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension;
+import org.apache.ws.commons.schema.XmlSchemaComplexContent;
+import org.apache.ws.commons.schema.XmlSchemaComplexContentExtension;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaContentModel;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
-//import org.apache.yoko.tools.common.CorbaPrimitiveMap;
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 public final class WSDLParameter {    
@@ -86,34 +86,36 @@
             Iterator i = msg.getOrderedParts(null).iterator();
             while (i.hasNext()) {
                 Part part = (Part)i.next();
-                XmlSchemaType schemaType = null;
+                XmlSchemaType schemaType = null;                
                 schemaType = lookUpType(part, xmlSchemaList);
                 ParamType paramtype = null;                
                 if (part.getElementName() != null) {
                     XmlSchemaComplexType cpt = null;
+                                    
                     if (schemaType instanceof XmlSchemaComplexType) {
                         cpt = (XmlSchemaComplexType)schemaType;
                     }
-                    if (cpt != null && cpt.getAttributes().getCount() == 0
-                        && cpt.getParticle() != null) {
+                    if (cpt != null && schemaType.getName() == null)  {
                         Iterator it = getSchemaIterator(schemaType);
                         Iterator iter = getSchemaIterator(schemaType);
-                        while (it.hasNext()) {
+                        while (it.hasNext()) {                        
                             if (it.next() instanceof XmlSchemaElement) {
                                 XmlSchemaElement el = (XmlSchemaElement)iter.next();
                                 paramtype = createParam(wsdlToCorbaBinding, "in", el.getSchemaType(), 
-                                                        el.getQName().getLocalPart(), 
-                                                        el.getSchemaTypeName());
-                                inputs.add(paramtype); 
+                                                   el.getQName().getLocalPart(), 
+                                                   el.getSchemaTypeName());
                             }
-                        }
-                    } else {
+                            if (paramtype != null) {
+                                inputs.add(paramtype);
+                            }
+                        }                        
+                    } else {                        
                         paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(), part
                             .getElementName());
                         if (paramtype != null) {
                             inputs.add(paramtype);
                         }
-                    }
+                    }                    
                 } else {
                     if (part.getTypeName() != null) {
                         paramtype = createParam(wsdlToCorbaBinding, "in", schemaType, part.getName(), part
@@ -156,21 +158,7 @@
             }
         }
     }
-    
-    private boolean checkContent(XmlSchemaType schemaType) {
-        if (schemaType instanceof XmlSchemaComplexType) {
-            XmlSchemaComplexType complex = (XmlSchemaComplexType)schemaType;
-            XmlSchemaParticle particle = complex.getParticle();
-            if (particle instanceof XmlSchemaSequence) {
-                XmlSchemaSequence seq = (XmlSchemaSequence)particle;
-                if (seq.getItems().getCount() == 0) {
-                    return false;
-                }
-            }                        
-        }
-        return true;
-    }
-
+   
     private void processWrappedOutputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation,
                                             List<XmlSchema> xmlSchemaList, List<ParamType> inputs, 
                                             List<ParamType> outputs) throws Exception {
@@ -186,14 +174,12 @@
                 schemaType = lookUpType(part, xmlSchemaList);
                 
                 // check if in input list
-                String mode = "out";
                 if (part.getElementName() != null) {
                     XmlSchemaComplexType cpt = null;
                     if (schemaType instanceof XmlSchemaComplexType) {
                         cpt = (XmlSchemaComplexType)schemaType;
                     }
-                    if (cpt != null && cpt.getAttributes().getCount() == 0 
-                        && cpt.getParticle() != null) {
+                    if (cpt != null && schemaType.getName() == null)  {                        
                         Iterator it = getSchemaIterator(schemaType);
                         Iterator iter = getSchemaIterator(schemaType);
                         while (it.hasNext()) {
@@ -204,10 +190,10 @@
                                            el.getQName().getLocalPart(),
                                            el.getSchemaTypeName(), inputs, outputs);
                             }                            
-                        }
+                        }                        
                     } else {
                         updateList(wsdlToCorbaBinding, schemaType, part.getName(), part.getName(), 
-                                   part.getElementName(), inputs, outputs);                                
+                               part.getElementName(), inputs, outputs);                                
                     }
                 } else {
                     if (part.getTypeName() != null) {
@@ -228,15 +214,34 @@
             XmlSchemaParticle particle = null;
             if (cpt.getParticle() != null) {
                 particle = (XmlSchemaParticle)cpt.getParticle();
-            }           
-            if (particle instanceof XmlSchemaSequence) {
-                XmlSchemaSequence seq = (XmlSchemaSequence)particle;
-                return seq.getItems().getIterator();                
-            } else if (particle instanceof XmlSchemaChoice) {
-                XmlSchemaChoice choice = (XmlSchemaChoice)particle;
-                return choice.getItems().getIterator();
+                       
+                if (particle instanceof XmlSchemaSequence) {
+                    XmlSchemaSequence seq = (XmlSchemaSequence)particle;
+                    return seq.getItems().getIterator();                
+                } else if (particle instanceof XmlSchemaChoice) {
+                    XmlSchemaChoice choice = (XmlSchemaChoice)particle;
+                    return choice.getItems().getIterator();
+                } 
+            }
+            if (cpt.getContentModel() != null) {
+                XmlSchemaContentModel xscm = (XmlSchemaContentModel)cpt.getContentModel();
+                if (xscm instanceof XmlSchemaComplexContent) {
+                    XmlSchemaComplexContent xscc = (XmlSchemaComplexContent)xscm;
+                     
+                    XmlSchemaComplexContentExtension ext = null;
+                    if (xscc.getContent() instanceof XmlSchemaComplexContentExtension) {
+                        ext = (XmlSchemaComplexContentExtension)xscc.getContent();
+                    }
+                    if (ext.getParticle() instanceof XmlSchemaSequence) {
+                        XmlSchemaSequence seq = (XmlSchemaSequence)ext.getParticle();
+                        return seq.getItems().getIterator();                      
+                    } else if (ext.getParticle() instanceof XmlSchemaChoice) {
+                        XmlSchemaChoice choice = (XmlSchemaChoice)ext.getParticle();
+                        return choice.getItems().getIterator();
+                    }
+                }
             }
-        }
+        }        
         return null;
     }
     
@@ -368,7 +373,7 @@
             inputs.add(d3);
         }        
     }
-
+    
     private static XmlSchemaType lookUpType(Part part, List<XmlSchema> xmlSchemaList) throws Exception {
         XmlSchemaType schemaType = null;
         
@@ -394,42 +399,6 @@
         return schemaType;
     }
     
-    
-    private static ParamType createParamType(WSDLToCorbaBinding wsdlToCorbaBinding, Part part, String mode,
-                                             XmlSchemaType schemaType, QName name) throws Exception {
-
-        CorbaTypeImpl corbaTypeImpl = null;
-        ParamType paramtype = new ParamType();
-
-        if ((part.getTypeName() != null) || part.getElementName() != null) {
-            ModeType modeType = ModeType.fromValue(mode);
-            //paramtype.setName(part.getName());
-            paramtype.setName(name.getLocalPart());
-            paramtype.setMode(modeType);            
-            
-            if (schemaType == null) {               
-                corbaTypeImpl = (CorbaTypeImpl)wsdlToCorbaBinding.CORBAPRIMITIVEMAP.get(part.getTypeName());
-                paramtype.setIdltype(corbaTypeImpl.getQName());
-            } else {
-                if (part.getTypeName() != null) {
-                    corbaTypeImpl = wsdlToCorbaBinding.convertSchemaToCorbaType(schemaType, 
-                                                          part.getTypeName(), null, false);
-                } else {
-                    corbaTypeImpl = wsdlToCorbaBinding.convertSchemaToCorbaType(schemaType, 
-                                                          part.getElementName(), null, false);
-                }
-                if (corbaTypeImpl == null) {
-                    return null;
-                } else {
-                    paramtype.setIdltype(corbaTypeImpl.getQName());
-                   
-                }
-            }
-            return paramtype;
-        }
-        return paramtype;
-    }
-
     private static ParamType createParam(WSDLToCorbaBinding wsdlToCorbaBinding, 
                                          String mode, XmlSchemaType schemaType, 
                                          String name, QName typeName) throws Exception {
@@ -461,7 +430,7 @@
     private static boolean inputPartsHaveNoDocWrapper(String opName, Operation operation, 
                                                       List<XmlSchema> xmlSchemaList)
         throws Exception {
-
+                
         XmlSchemaType schemaType = null;        
         Iterator i = null;
         Input input = operation.getInput();
@@ -480,11 +449,10 @@
                 return true;
             }
 
-            schemaType = lookUpType(part, xmlSchemaList);
-            //if (!part.getName().equals(opName)) {
-            /*if (!schemaType.getName().equals(opName)) {
+            schemaType = lookUpType(part, xmlSchemaList);            
+            if (!(part.getName().equals(opName))) {
                 return true;
-            }*/
+            }
 
             if (!(schemaType instanceof XmlSchemaComplexType)) {
                 return true;
@@ -521,7 +489,6 @@
             }
 
             schemaType = lookUpType(part, xmlSchemaList);
-
             if (!part.getName().equals(opName)) {
                 return true;
             }

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?rev=438038&r1=438037&r2=438038&view=diff
==============================================================================
--- 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 Tue Aug 29 03:05:18 2006
@@ -49,13 +49,14 @@
 
 import org.apache.schemas.yoko.bindings.corba.Anonarray;
 import org.apache.schemas.yoko.bindings.corba.Anonsequence;
-import org.apache.schemas.yoko.bindings.corba.Anonstring;
+//import org.apache.schemas.yoko.bindings.corba.Anonstring;
 import org.apache.schemas.yoko.bindings.corba.ArgType;
 import org.apache.schemas.yoko.bindings.corba.Array;
 import org.apache.schemas.yoko.bindings.corba.BindingType;
 import org.apache.schemas.yoko.bindings.corba.CaseType;
 import org.apache.schemas.yoko.bindings.corba.Enum;
 import org.apache.schemas.yoko.bindings.corba.Enumerator;
+//import org.apache.schemas.yoko.bindings.corba.Fixed;
 import org.apache.schemas.yoko.bindings.corba.MemberType;
 import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
@@ -119,6 +120,7 @@
     Map<Object, Object> bindingNameMap = new HashMap<Object, Object>();
     String bindingName;
     WSDLParameter wsdlParameter;
+    WSDLTypes wsdltypes;
     List<Object> bindingNames;
     List<XmlSchema> xmlSchemaList; 
 
@@ -158,6 +160,7 @@
         }
         typeProcessor.setWSDLDefinition(def);
         wsdlParameter = new WSDLParameter();
+        wsdltypes = new WSDLTypes();
         if (idlNamespace == null) {
             setIdlNamespace(def);
         }
@@ -465,7 +468,7 @@
             ex.printStackTrace();
         }
     }
-    
+       
     private boolean queryBinding(Definition definition, QName bqname) {
         Map bindings = definition.getBindings();
         Iterator i = bindings.values().iterator();
@@ -836,8 +839,22 @@
     }
     
     private CorbaTypeImpl processPrimitiveType(QName typeName) {
-        QName qName = createQNameXmlSchemaNamespace(typeName.getLocalPart());
-        return (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(qName);
+        QName qName = createQNameXmlSchemaNamespace(typeName.getLocalPart());        
+        CorbaTypeImpl corbatype = (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(qName);
+        if (corbatype == null) {
+            if (typeName.equals(W3CConstants.NT_SCHEMA_DECIMAL)) {
+                QName name = new QName(idlNamespace, "fixed_1");
+                corbatype = wsdltypes.getFixedCorbaType(name, typeName, 31, 6);
+            } else if (typeName.equals(W3CConstants.NT_SCHEMA_BASE64)
+                       || typeName.equals(W3CConstants.NT_SCHEMA_HBIN)) {
+                       //|| typeName.equals(SOAPConstants.NT_SOAP_BASE64)
+                       //|| typeName.equals(SOAPConstants.NT_SOAP_HBIN)) {
+                QName name = new QName(idlNamespace, typeName.getLocalPart() + "Seq");
+                corbatype = wsdltypes.getOctetCorbaType(name, typeName, 0);
+            }
+
+        }
+        return corbatype;
     }
 
     private CorbaTypeImpl processElementType(XmlSchemaElement stype, QName defaultName) 
@@ -871,62 +888,7 @@
         }        
         
         if (stype.getContent() instanceof XmlSchemaSimpleTypeRestriction) {
-            // checks if enumeration
-            XmlSchemaSimpleTypeRestriction restrictionType = (XmlSchemaSimpleTypeRestriction)stype
-                .getContent();
-            if (isEnumeration(restrictionType)) {
-                corbaTypeImpl = createCorbaEnum(restrictionType, name, schematypeName);
-            } else {
-                if (restrictionType.getBaseType() != null) {
-                    corbaTypeImpl = convertSchemaToCorbaType(restrictionType.getBaseType(), schematypeName,
-                                                             stype, false);
-                } else {
-                    corbaTypeImpl = (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(restrictionType.getBaseTypeName());
-                }
-
-                String maxLength = null;
-                String length = null;
-
-                Iterator i = restrictionType.getFacets().getIterator();
-                while (i.hasNext()) {
-                    XmlSchemaFacet val = (XmlSchemaFacet)i.next();
-                    if (val.getValue().toString().equals("maxlength")) {
-                        maxLength = val.getValue().toString();
-                    }
-                    if (val.getValue().toString().equals("length")) {
-                        length = val.getValue().toString();
-                    }
-                }
-
-                QName baseName = restrictionType.getBaseTypeName();
-                if ((corbaTypeImpl != null && corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_STRING))
-                    || (baseName.equals(W3CConstants.NT_SCHEMA_STRING))) {
-                    boolean boundedString = true;
-                    int bound = 0;
-
-                    try {
-                        if (maxLength != null) {
-                            bound = Integer.parseInt(maxLength);
-                        } else if (length != null) {
-                            bound = Integer.parseInt(length);
-                        } else {
-                            boundedString = false;
-                        }
-                    } catch (NumberFormatException ex) {
-                        // throw new Exception("illegal number" , ex);
-                    } catch (Exception e) {
-                        // throw new Exception("illegal number" , e);
-                    }
-
-                    if (boundedString) {
-                        Anonstring anonString = new Anonstring();
-                        anonString.setBound(bound);
-                        anonString.setName(name.getLocalPart());
-                        anonString.setType(CORBAConstants.NT_CORBA_STRING);
-                        corbaTypeImpl = anonString;
-                    }
-                }
-            }
+            corbaTypeImpl = processSimpleRestrictionType(stype, name, schematypeName);
         } else if (stype.getContent() instanceof XmlSchemaSimpleTypeList) {
             XmlSchemaSimpleTypeList ltype = (XmlSchemaSimpleTypeList)stype.getContent();
             CorbaTypeImpl itemType = null;
@@ -938,7 +900,7 @@
                 return itemType;
             }
             QName ltypeName = createQNameXmlSchemaNamespace(ltype.getItemTypeName().getLocalPart());
-            itemType = (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(ltypeName);
+            itemType = processPrimitiveType(ltypeName);
             return mapToSequence(name, schematypeName, itemType.getQName(), 0, false);
         } else if (stype.getContent() == null) {
             // elements primitive type
@@ -948,8 +910,69 @@
             System.out.println("SimpleType Union Not Supported in CORBA Binding");
         }
         return corbaTypeImpl;
+ 
+    }
+    
+    private CorbaTypeImpl processSimpleRestrictionType(XmlSchemaSimpleType stype,
+                                                       QName name, QName schematypeName) 
+        throws Exception {
+        CorbaTypeImpl corbaTypeImpl = null;
+    
+        // checks if enumeration
+        XmlSchemaSimpleTypeRestriction restrictionType = (XmlSchemaSimpleTypeRestriction)stype
+            .getContent();
+        
+        QName baseName = checkPrefix(restrictionType.getBaseTypeName());
+        
+        if (isEnumeration(restrictionType)) {
+            corbaTypeImpl = createCorbaEnum(restrictionType, name, schematypeName);
+        } else {
+            if (restrictionType.getBaseType() != null) {
+                corbaTypeImpl = convertSchemaToCorbaType(restrictionType.getBaseType(), schematypeName,
+                                                         stype, false);
+            } else {                
+                corbaTypeImpl = processPrimitiveType(baseName);                
+                if (corbaTypeImpl == null) {
+                    XmlSchemaType schematype = findSchemaType(baseName);
+                    corbaTypeImpl = convertSchemaToCorbaType(schematype, schematypeName,
+                                                             schematype, false);                    
+                }
+            }
+
+            String maxLength = null;
+            String length = null;
 
+            Iterator i = restrictionType.getFacets().getIterator();
+            while (i.hasNext()) {
+                XmlSchemaFacet val = (XmlSchemaFacet)i.next();
+                if (val.getValue().toString().equals("maxlength")) {
+                    maxLength = val.getValue().toString();
+                }
+                if (val.getValue().toString().equals("length")) {
+                    length = val.getValue().toString();
+                }
+            }
+            
+            if (corbaTypeImpl != null) {
+                if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_STRING)
+                    || (baseName.equals(W3CConstants.NT_SCHEMA_STRING))) {                
+                    corbaTypeImpl = 
+                        wsdltypes.processStringType(corbaTypeImpl, name, maxLength, length);                
+                } else if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_DECIMAL)
+                    || (baseName.equals(W3CConstants.NT_SCHEMA_DECIMAL))) {                
+                    corbaTypeImpl = wsdltypes.processDecimalType(restrictionType, name, corbaTypeImpl);
+                } else if ((corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_BASE64))
+                    || (baseName.equals(W3CConstants.NT_SCHEMA_BASE64))
+                    || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))
+                    || (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))) {                
+                    corbaTypeImpl = wsdltypes.processBase64Type(corbaTypeImpl, name, maxLength, length);
+                }
+            }
+        }
+        
+        return corbaTypeImpl;
     }
+        
  
     private CorbaTypeImpl getLocalType(QName qname) {
         return processPrimitiveType(qname);
@@ -1017,6 +1040,25 @@
         return schemaType;
     }
     
+    private XmlSchemaType findSchemaType(QName typeName) {
+        XmlSchemaType schemaType = null;
+        
+        Iterator i = xmlSchemaList.iterator();
+        while (i.hasNext()) {
+            XmlSchema xmlSchema = (XmlSchema)i.next();        
+            if (xmlSchema.getElementByName(typeName) != null) {
+                XmlSchemaElement schemaElement = xmlSchema.getElementByName(typeName);                
+                schemaType = schemaElement.getSchemaType();                
+            } else if (xmlSchema.getTypeByName(typeName) != null) {                
+                schemaType = xmlSchema.getTypeByName(typeName);                
+            }
+            if (schemaType != null) {
+                return schemaType;
+            }
+        }            
+        return schemaType;
+    }
+    
     private boolean isSchemaTypeException(XmlSchemaType stype) {
         boolean exception = false;
         XmlSchemaComplexType complex = null;
@@ -1474,7 +1516,8 @@
             minOccurs = arrayEl.getMinOccurs();
         }
 
-        return createArray(name, schematypeName, arrayType.getQName(), maxOccurs, minOccurs, anonymous);     
+        return createArray(name, schematypeName, 
+                           checkPrefix(arrayType.getQName()), maxOccurs, minOccurs, anonymous);     
     }
     
     private CorbaTypeImpl processOMGUnion(XmlSchemaComplexType complex, QName defaultName) throws Exception {
@@ -1766,8 +1809,7 @@
         }
 
         return false;
-    }
-
+    }              
 
     public QName createQName(String name, String namespaceName, String prefix) {
         return new QName(name, namespaceName, prefix);

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java?rev=438038&r1=438037&r2=438038&view=diff
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToIDLAction.java Tue Aug 29 03:05:18 2006
@@ -44,6 +44,7 @@
 import org.apache.schemas.yoko.bindings.corba.CaseType;
 import org.apache.schemas.yoko.bindings.corba.Enum;
 import org.apache.schemas.yoko.bindings.corba.Enumerator;
+import org.apache.schemas.yoko.bindings.corba.Fixed;
 import org.apache.schemas.yoko.bindings.corba.MemberType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
 import org.apache.schemas.yoko.bindings.corba.RaisesType;
@@ -61,6 +62,7 @@
 import org.apache.yoko.tools.common.idltypes.IdlEnumerator;
 import org.apache.yoko.tools.common.idltypes.IdlException;
 import org.apache.yoko.tools.common.idltypes.IdlField;
+import org.apache.yoko.tools.common.idltypes.IdlFixed;
 import org.apache.yoko.tools.common.idltypes.IdlInterface;
 import org.apache.yoko.tools.common.idltypes.IdlModule;
 import org.apache.yoko.tools.common.idltypes.IdlOperation;
@@ -479,8 +481,10 @@
             result = createUnion(corbaTypeImpl, scope, local);
         } else if (corbaTypeImpl instanceof Array) {
             result = createArray(corbaTypeImpl, scope, local);
+        } else if (corbaTypeImpl instanceof Fixed) {
+            result = createFixed(corbaTypeImpl, scope, local);
         } else {
-            result = checkAnon(corbaTypeImpl, scope, local);                            
+            result = checkAnon(corbaTypeImpl, scope, local);                                    
         }
         return result;
     }
@@ -624,6 +628,17 @@
         IdlType base = findType(s.getElemtype());        
         int bound = (int)s.getBound();
         idlType = IdlArray.create(scope, local, base, bound);
+        scope.addToScope(idlType);
+        return idlType;
+    }
+    
+    private IdlType createFixed(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
+        IdlType idlType = null;
+        Fixed f = (Fixed)ctype;     
+        Long digits = f.getDigits();
+        Long scale = f.getScale();        
+        idlType = IdlFixed.create(scope, local, digits.intValue(),   
+                                  scale.intValue());
         scope.addToScope(idlType);
         return idlType;
     }

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?rev=438038&r1=438037&r2=438038&view=diff
==============================================================================
--- 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 Tue Aug 29 03:05:18 2006
@@ -38,8 +38,11 @@
 import junit.framework.TestCase;
 
 import org.apache.schemas.yoko.bindings.corba.BindingType;
+import org.apache.schemas.yoko.bindings.corba.Fixed;
 import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
+import org.apache.schemas.yoko.bindings.corba.Sequence;
+import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
 import org.apache.yoko.tools.common.CORBAConstants;
 import org.apache.yoko.tools.common.WSDLCorbaFactory;
 import org.apache.yoko.tools.processors.wsdl.WSDLToCorbaBinding;
@@ -73,89 +76,287 @@
     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 testAllType() throws Exception {
-        String fileName = getClass().getResource("/wsdl/alltype.wsdl").toString();
+    public void testFixedBindingGeneration() throws Exception {
+        String fileName = getClass().getResource("/wsdl/fixed.wsdl").toString();
         generator.setWsdlFile(fileName);
-        generator.addInterfaceName("BasePortType");
+        generator.addInterfaceName("Y");
 
         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");
+        assertEquals(1, typemap.getElementsByTagName("corba:sequence").getLength());
+        assertEquals(5, typemap.getElementsByTagName("corba:fixed").getLength());
+        
+        Element bindingElement = getElementNode(document, "binding");        
+        assertEquals(5, bindingElement.getElementsByTagName("corba:operation").getLength());
+
+        QName bName = new QName("http://schemas.apache.org/idl/fixed.idl", 
+                                "YCORBABinding", "tns");
+        Binding binding = model.getBinding(bName);
+        
+        Iterator j = binding.getBindingOperations().iterator();
+        while (j.hasNext()) {            
+            BindingOperation bindingOperation = (BindingOperation)j.next();
+            assertEquals("YCORBABinding", binding.getQName().getLocalPart());
+            assertEquals(1, bindingOperation.getExtensibilityElements().size());
+            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
+            checkFixedTypeOne(bindingOperation, mapType);
+            bindingOperation = (BindingOperation)j.next();
+            checkSequenceType(bindingOperation, mapType);
+            bindingOperation = (BindingOperation)j.next();
+            checkFixedTypeTwo(bindingOperation, mapType);
+            bindingOperation = (BindingOperation)j.next();
+            checkFixedTypeThree(bindingOperation, mapType);
+            bindingOperation = (BindingOperation)j.next();
+            checkFixedTypeFour(bindingOperation, mapType);
+        }
+    }
+     
+    private void checkSequenceType(BindingOperation bindingOperation, TypeMappingType mapType) {
+        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
+        while (bOp.hasNext()) {
+            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+            if (extElement.getElementType().getLocalPart().equals("operation")) {
+                OperationType corbaOpType = (OperationType)extElement;
+                assertEquals(corbaOpType.getName(), "op_h");
+                assertEquals(3, corbaOpType.getParam().size());
+                assertEquals("Y.H", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
+                assertEquals("Y.H", corbaOpType.getReturn().getIdltype().getLocalPart());
+                Sequence seq = (Sequence)mapType.getStructOrExceptionOrUnion().get(4);
+                assertEquals("ElementType is incorrect for Sequence Type", "fixed_1", seq.getElemtype()
+                    .getLocalPart());
             }
+
         }
-        assertNotNull(typemap);            
-        assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());
     }
     
-    public void testComplexContentStructType() throws Exception {
-        String fileName = getClass().getResource("/wsdl/content.wsdl").toString();
-        generator.setWsdlFile(fileName);
-        generator.addInterfaceName("ContentPortType");
+    private void checkFixedTypeOne(BindingOperation bindingOperation, TypeMappingType mapType) {
 
-        Definition model = generator.generateCORBABinding();
-        Document document = writer.getDocument(model);
+        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
+        while (bOp.hasNext()) {
+            assertEquals(bindingOperation.getBindingInput().getName(), "op_k");
+            assertEquals(bindingOperation.getBindingOutput().getName(), "op_kResponse");
+            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+            if (extElement.getElementType().getLocalPart().equals("operation")) {
+                OperationType corbaOpType = (OperationType)extElement;
+                assertEquals(corbaOpType.getName(), "op_k");
+                assertEquals(3, corbaOpType.getParam().size());
+                assertEquals("fixed_1", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
+                assertEquals("fixed_1", corbaOpType.getReturn().getIdltype().getLocalPart());
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(2);
+
+                assertNotNull("Could not find the decimal type", fixed.getType());
+                assertEquals("Fixed digits is incorrect for the return corba parameter", 31, fixed
+                    .getDigits());
+                assertEquals("Fixed scale is incorrect for the return corba parameter", 6, fixed.getScale());
 
-        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);
-        assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());        
-        assertEquals(6, typemap.getElementsByTagName("corba:struct").getLength());
     }
+    
+    private void checkFixedTypeTwo(BindingOperation bindingOperation, TypeMappingType mapType) {
+        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
+        while (bOp.hasNext()) {
+            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+            if (extElement.getElementType().getLocalPart().equals("operation")) {
+                OperationType corbaOpType = (OperationType)extElement;
+                assertEquals(corbaOpType.getName(), "op_m");
+                assertEquals(3, corbaOpType.getParam().size());
+                assertEquals("X.PARAM.H", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
+                assertEquals("X.H", corbaOpType.getReturn().getIdltype().getLocalPart());
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(1);
+                assertNotNull("Could not find the decimal type", fixed.getType());
+                assertEquals("Fixed digits is incorrect for the return corba parameter", 10, fixed
+                    .getDigits());
+                assertEquals("Fixed scale is incorrect for the return corba parameter", 2, fixed.getScale());
 
+            }
+        }
+    }
+    
+    private void checkFixedTypeThree(BindingOperation bindingOperation, TypeMappingType mapType) {
+        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
+        while (bOp.hasNext()) {
+            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();            
+            if (extElement.getElementType().getLocalPart().equals("operation")) {
+                OperationType corbaOpType = (OperationType)extElement;
+                assertEquals(corbaOpType.getName(), "op_n");
+                assertEquals(3, corbaOpType.getParam().size());
+                assertEquals("fixed_1", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
+                assertEquals("Z.H", corbaOpType.getReturn().getIdltype().getLocalPart());
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(0);
+                assertNotNull("Could not find the decimal type", fixed.getType());
+                assertEquals("Fixed digits is incorrect for the return corba parameter", 8, fixed
+                    .getDigits());
+                assertEquals("Fixed scale is incorrect for the return corba parameter", 6, fixed.getScale());
 
+            }
+        }
+    }
     
-    public void testSequenceType() throws Exception {
-        String fileName = getClass().getResource("/wsdl/sequencetype.wsdl").toString();
-        generator.setWsdlFile(fileName);
-        generator.addInterfaceName("IACC.Server");
+    private void checkFixedTypeFour(BindingOperation bindingOperation, TypeMappingType mapType) {
+        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
+        while (bOp.hasNext()) {
+            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+      
+            if (extElement.getElementType().getLocalPart().equals("operation")) {
+                OperationType corbaOpType = (OperationType)extElement;
+                assertEquals(corbaOpType.getName(), "extended_op_m");
+                assertEquals(3, corbaOpType.getParam().size());
+                assertEquals("EXTENDED.X.PARAM.H", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
+                assertEquals("EXTENDED.X.PARAM.H", corbaOpType.getReturn().getIdltype().getLocalPart());
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(3);
+                assertNotNull("Could not find the decimal type", fixed.getType());
+                assertEquals("Fixed digits is incorrect for the return corba parameter", 8, fixed
+                    .getDigits());
+                assertEquals("Fixed scale is incorrect for the return corba parameter", 2, fixed.getScale());
 
-        Definition model = generator.generateCORBABinding();
-        Document document = writer.getDocument(model);
+            }
+        }
+    }       
+                     
+    public void testAllType() throws Exception {
+        try {
+            String fileName = getClass().getResource("/wsdl/alltype.wsdl").toString();
+            generator.setWsdlFile(fileName);
+            generator.addInterfaceName("BasePortType");
+
+            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);
+            assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());
 
-        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;
+            WSDLToIDLAction idlgen = new WSDLToIDLAction();
+            idlgen.setBindingName("BaseCORBABinding");
+            idlgen.setOutputFile("alltype.idl");
+            idlgen.generateIDL(model);
+
+            File f = new File("alltype.idl");
+            assertTrue("alltype.idl should be generated", f.exists());
+        } finally {
+            new File("alltype.idl").deleteOnExit();
+        }        
+    }
+    
+    public void testComplexContentStructType() throws Exception {
+        
+        try {
+            String fileName = getClass().getResource("/wsdl/content.wsdl").toString();
+            generator.setWsdlFile(fileName);
+            generator.addInterfaceName("ContentPortType");
+
+            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);
+            assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());
+            assertEquals(6, typemap.getElementsByTagName("corba:struct").getLength());
+
+            WSDLToIDLAction idlgen = new WSDLToIDLAction();
+            idlgen.setBindingName("ContentCORBABinding");
+            idlgen.setOutputFile("content.idl");
+            idlgen.generateIDL(model);
+
+            File f = new File("content.idl");
+            assertTrue("content.idl should be generated", f.exists());
+        } finally {
+            new File("content.idl").deleteOnExit();
+        }
+
+    }
+    
+    public void testSequenceType() throws Exception {
+        try {
+            String fileName = getClass().getResource("/wsdl/sequencetype.wsdl").toString();
+            generator.setWsdlFile(fileName);
+            generator.addInterfaceName("IACC.Server");
+
+            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);
+            assertEquals(2, typemap.getElementsByTagName("corba:sequence").getLength());
+            assertEquals(5, typemap.getElementsByTagName("corba:exception").getLength());
+            assertEquals(70, typemap.getElementsByTagName("corba:struct").getLength());
+
+            WSDLToIDLAction idlgen = new WSDLToIDLAction();
+            idlgen.setBindingName("IACC.ServerCORBABinding");
+            idlgen.setOutputFile("sequencetype.idl");
+            idlgen.generateIDL(model);
+
+            File f = new File("sequencetype.idl");
+            assertTrue("sequencetype.idl should be generated", f.exists());
+        } finally {
+            new File("sequencetype.idl").deleteOnExit();
         }
-        assertNotNull(typemap);
-        assertEquals(2, typemap.getElementsByTagName("corba:sequence").getLength());
-        assertEquals(5, typemap.getElementsByTagName("corba:exception").getLength());
-        assertEquals(70, typemap.getElementsByTagName("corba:struct").getLength());
     }
     
     public void testUnionType() throws Exception {
-        String fileName = getClass().getResource("/wsdl/uniontype.wsdl").toString();
-        generator.setWsdlFile(fileName);
-        generator.addInterfaceName("Test.MultiPart");
-
-        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;
+        try {
+            String fileName = getClass().getResource("/wsdl/uniontype.wsdl").toString();
+            generator.setWsdlFile(fileName);
+            generator.addInterfaceName("Test.MultiPart");
+
+            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);
+            assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());
+            assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());
+            WSDLToIDLAction idlgen = new WSDLToIDLAction();
+            idlgen.setBindingName("Test.MultiPartCORBABinding");
+            idlgen.setOutputFile("uniontype.idl");
+            idlgen.generateIDL(model);
+
+            File f = new File("uniontype.idl");
+            assertTrue("uniontype.idl should be generated", f.exists());
+        } finally {
+            new File("uniontype.idl").deleteOnExit();
         }
-        assertNotNull(typemap);
-        assertEquals(1, typemap.getElementsByTagName("corba:union").getLength());
-        assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());
+
     }
 
     

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?rev=438038&r1=438037&r2=438038&view=diff
==============================================================================
--- 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 Tue Aug 29 03:05:18 2006
@@ -327,7 +327,25 @@
             new File("alltype.idl").deleteOnExit();
         }
     }
+    
+    public void testFixedTypeIdlgen() throws Exception {
+        
+        try {
+            String fileName = getClass().getResource("/idlgen/fixed.wsdl").toString();
+            idlgen.setWsdlFile(fileName);
+            
+            idlgen.setBindingName("YCORBABinding");
+            idlgen.setOutputFile("fixed.idl");            
+            idlgen.setOutput(new PrintWriter(idloutput));
+            idlgen.generateIDL(null);
 
+            InputStream origstream = getClass().getResourceAsStream("/idlgen/expected_fixed.idl");
+            byte orig[] = inputStreamToBytes(origstream);
 
+            checkIDLStrings(orig, idloutput.toByteArray());
+        } finally {
+            new File("fixed.idl").deleteOnExit();
+        }
+    }
     
 }

Added: incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_fixed.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_fixed.idl?rev=438038&view=auto
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_fixed.idl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/expected_fixed.idl Tue Aug 29 03:05:18 2006
@@ -0,0 +1,50 @@
+module Z {
+    typedef fixed<8, 6> H;
+};
+module X {
+    typedef fixed<10, 2> H;
+    module PARAM {
+        typedef fixed<31, 2> H;
+    };
+};
+typedef fixed<31, 6> fixed_1;
+module EXTENDED {
+    module X {
+        module PARAM {
+            typedef fixed<8, 2> H;
+        };
+    };
+};
+interface Y {
+    typedef sequence<::fixed_1> H;
+    ::fixed_1
+    op_k(
+        in ::fixed_1 p1,
+        out ::fixed_1 p3,
+        inout ::fixed_1 p2
+    );
+    H
+    op_h(
+        in H p1,
+        out H p3,
+        inout H p2
+    );
+    ::X::H
+    op_m(
+        in ::X::PARAM::H p1,
+        out ::X::PARAM::H p3,
+        inout ::X::PARAM::H p2
+    );
+    ::Z::H
+    op_n(
+        in ::fixed_1 p1,
+        out ::fixed_1 p3,
+        inout ::fixed_1 p2
+    );
+    ::EXTENDED::X::PARAM::H
+    extended_op_m(
+        in ::EXTENDED::X::PARAM::H p1,
+        out ::EXTENDED::X::PARAM::H p3,
+        inout ::EXTENDED::X::PARAM::H p2
+    );
+};

Added: incubator/yoko/trunk/tools/src/test/resources/idlgen/fixed.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idlgen/fixed.wsdl?rev=438038&view=auto
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idlgen/fixed.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idlgen/fixed.wsdl Tue Aug 29 03:05:18 2006
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="fixed.idl" targetNamespace="http://schemas.apache.org/idl/fixed.idl" xmlns:tns="http://schemas.apache.org/idl/fixed.idl" xmlns:corbatm="http://schemas.apache.org/yoko/bindings/corba/typemap" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://schemas.apache.org/idltypes/fixed.idl" xmlns="http://schemas.xmlsoap.org/wsdl/">
+  <corba:typeMapping targetNamespace="http://schemas.apache.org/idl/fixed.idl/corba/typemap/">
+    <corba:fixed xmlns:xs="http://www.w3.org/2001/XMLSchema" scale="6" digits="8" type="xs:decimal" name="Z.H" />
+    <corba:fixed xmlns:xs="http://www.w3.org/2001/XMLSchema" scale="2" digits="10" type="xs:decimal" name="X.H" />
+    <corba:fixed xmlns:xs="http://www.w3.org/2001/XMLSchema" scale="6" digits="31" type="xs:decimal" name="fixed_1" />
+    <corba:fixed xmlns:xs="http://www.w3.org/2001/XMLSchema" scale="2" digits="8" type="xs:decimal" name="EXTENDED.X.PARAM.H" />
+    <corba:sequence xmlns:xsd1="http://schemas.apache.org/idltypes/fixed.idl" xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" elemtype="ns1:fixed_1" bound="0" repositoryID="IDL:Y/H:1.0" type="xsd1:Y.H" name="Y.H" />
+    <corba:fixed xmlns:xs="http://www.w3.org/2001/XMLSchema" scale="2" digits="31" type="xs:decimal" name="X.PARAM.H" />
+  </corba:typeMapping>
+  <types>
+    <schema targetNamespace="http://schemas.apache.org/idltypes/fixed.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="Y.H">
+        <xsd:sequence>
+          <xsd:element maxOccurs="unbounded" minOccurs="0" name="item" type="xsd:decimal"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:totalDigits value="10"/>
+          <xsd:fractionDigits value="2"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.PARAM.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:fractionDigits value="2"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:totalDigits value="8"/>
+          <xsd:fractionDigits value="7"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.PARAM.H">
+        <xsd:restriction base="xsd:decimal"/>
+      </xsd:simpleType>
+      <xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EXTENDED.X.PARAM.H">
+        <xsd:restriction base="xsd1:X.PARAM.H">
+          <xsd:totalDigits value="8"/>
+        </xsd:restriction>
+      </xsd:simpleType>      
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_k.p1" type="xsd:decimal"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_k.p2" type="xsd:decimal"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_k.p3" type="xsd:decimal"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_k.return" type="xsd:decimal"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_h.p1" type="xsd1:Y.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_h.p2" type="xsd1:Y.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_h.p3" type="xsd1:Y.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Y.op_h.return" type="xsd1:Y.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.op_m.p1" type="xsd1:X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.op_m.p2" type="xsd1:X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.op_m.p3" type="xsd1:X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="X.op_m.return" type="xsd1:X.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.op_n.p1" type="xsd1:Z.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.op_n.p2" type="xsd1:Z.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.op_n.p3" type="xsd1:Z.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Z.op_n.return" type="xsd1:Z.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EXTENDED.X.op_m.p1" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EXTENDED.X.op_m.p2" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EXTENDED.X.op_m.p3" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EXTENDED.X.op_m.return" type="xsd1:EXTENDED.X.PARAM.H"/>
+    </schema>
+  </types>
+  <message name="EXTENDED.X.op_m">
+    <part name="p1" element="xsd1:EXTENDED.X.op_m.p1"/>
+    <part name="p2" element="xsd1:EXTENDED.X.op_m.p2"/>
+  </message>
+  <message name="Y.op_k">
+    <part name="p1" element="xsd1:Y.op_k.p1"/>
+    <part name="p2" element="xsd1:Y.op_k.p2"/>
+  </message>
+  <message name="Y.op_h">
+    <part name="p1" element="xsd1:Y.op_h.p1"/>
+    <part name="p2" element="xsd1:Y.op_h.p2"/>
+  </message>
+  <message name="Z.op_n">
+    <part name="p1" element="xsd1:Z.op_n.p1"/>
+    <part name="p2" element="xsd1:Z.op_n.p2"/>
+  </message>
+  <message name="Y.op_hResponse">
+    <part name="return" element="xsd1:Y.op_h.return"/>
+    <part name="p2" element="xsd1:Y.op_h.p2"/>
+    <part name="p3" element="xsd1:Y.op_h.p3"/>
+  </message>
+  <message name="Y.op_kResponse">
+    <part name="return" element="xsd1:Y.op_k.return"/>
+    <part name="p2" element="xsd1:Y.op_k.p2"/>
+    <part name="p3" element="xsd1:Y.op_k.p3"/>
+  </message>
+  <message name="EXTENDED.X.op_mResponse">
+    <part name="return" element="xsd1:EXTENDED.X.op_m.return"/>
+    <part name="p2" element="xsd1:EXTENDED.X.op_m.p2"/>
+    <part name="p3" element="xsd1:EXTENDED.X.op_m.p3"/>
+  </message>
+  <message name="X.op_mResponse">
+    <part name="return" element="xsd1:X.op_m.return"/>
+    <part name="p2" element="xsd1:X.op_m.p2"/>
+    <part name="p3" element="xsd1:X.op_m.p3"/>
+  </message>
+  <message name="Z.op_nResponse">
+    <part name="return" element="xsd1:Z.op_n.return"/>
+    <part name="p2" element="xsd1:Z.op_n.p2"/>
+    <part name="p3" element="xsd1:Z.op_n.p3"/>
+  </message>
+  <message name="X.op_m">
+    <part name="p1" element="xsd1:X.op_m.p1"/>
+    <part name="p2" element="xsd1:X.op_m.p2"/>
+  </message>
+  <portType name="Y">
+    <operation name="op_k">
+      <input name="op_k" message="tns:Y.op_k"/>
+      <output name="op_kResponse" message="tns:Y.op_kResponse"/>
+    </operation>
+    <operation name="op_h">
+      <input name="op_h" message="tns:Y.op_h"/>
+      <output name="op_hResponse" message="tns:Y.op_hResponse"/>
+    </operation>
+    <operation name="op_m">
+      <input name="op_m" message="tns:X.op_m"/>
+      <output name="op_mResponse" message="tns:X.op_mResponse"/>
+    </operation>
+    <operation name="op_n">
+      <input name="op_n" message="tns:Z.op_n"/>
+      <output name="op_nResponse" message="tns:Z.op_nResponse"/>
+    </operation>
+    <operation name="extended_op_m">
+      <input name="extended_op_m" message="tns:EXTENDED.X.op_m"/>
+      <output name="extended_op_mResponse" message="tns:EXTENDED.X.op_mResponse"/>
+    </operation>
+  </portType>
+  <binding name="YCORBABinding" type="tns:Y">
+    <corba:binding repositoryID="IDL:Y:1.0" />
+    <operation name="op_k">
+      <corba:operation name="op_k">
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="in" name="p1" idltype="ns3:fixed_1" />
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="out" name="p3" idltype="ns3:fixed_1" />
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="inout" name="p2" idltype="ns3:fixed_1" />
+        <corba:return xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" name="return" idltype="ns3:fixed_1" />
+      </corba:operation>
+      <input name="op_k">
+      </input>
+      <output name="op_kResponse">
+      </output>
+    </operation>
+    <operation name="op_h">
+      <corba:operation name="op_h">
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="in" name="p1" idltype="ns1:Y.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="out" name="p3" idltype="ns1:Y.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="inout" name="p2" idltype="ns1:Y.H" />
+        <corba:return xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" name="return" idltype="ns1:Y.H" />
+      </corba:operation>
+      <input name="op_h">
+      </input>
+      <output name="op_hResponse">
+      </output>
+    </operation>
+    <operation name="op_m">
+      <corba:operation name="op_m">
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="in" name="p1" idltype="ns1:X.PARAM.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="out" name="p3" idltype="ns1:X.PARAM.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="inout" name="p2" idltype="ns1:X.PARAM.H" />
+        <corba:return xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" name="return" idltype="ns1:X.H" />
+      </corba:operation>
+      <input name="op_m">
+      </input>
+      <output name="op_mResponse">
+      </output>
+    </operation>
+    <operation name="op_n">
+      <corba:operation name="op_n">
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="in" name="p1" idltype="ns3:fixed_1" />
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="out" name="p3" idltype="ns3:fixed_1" />
+        <corba:param xmlns:ns3="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="inout" name="p2" idltype="ns3:fixed_1" />
+        <corba:return xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" name="return" idltype="ns1:Z.H" />
+      </corba:operation>
+      <input name="op_n">
+      </input>
+      <output name="op_nResponse">
+      </output>
+    </operation>
+    <operation name="extended_op_m">
+      <corba:operation name="extended_op_m">
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="in" name="p1" idltype="ns1:EXTENDED.X.PARAM.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="out" name="p3" idltype="ns1:EXTENDED.X.PARAM.H" />
+        <corba:param xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" mode="inout" name="p2" idltype="ns1:EXTENDED.X.PARAM.H" />
+        <corba:return xmlns:ns1="http://schemas.apache.org/idl/fixed.idl/corba/typemap/" name="return" idltype="ns1:EXTENDED.X.PARAM.H" />
+      </corba:operation>
+      <input name="extended_op_m">
+      </input>
+      <output name="extended_op_mResponse">
+      </output>
+    </operation>
+  </binding>
+</definitions>

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

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

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

Added: incubator/yoko/trunk/tools/src/test/resources/wsdl/fixed.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/wsdl/fixed.wsdl?rev=438038&view=auto
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/wsdl/fixed.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/wsdl/fixed.wsdl Tue Aug 29 03:05:18 2006
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="fixed.idl"
+ targetNamespace="http://schemas.apache.org/idl/fixed.idl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://schemas.apache.org/idl/fixed.idl"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsd1="http://schemas.apache.org/idltypes/fixed.idl"
+ xmlns:corba="http://schemas.apache.org/yoko/bindings/corba"
+ xmlns:corbatm="http://schemas.apache.org/yoko/bindings/corba/typemap">
+  <types>
+    <schema targetNamespace="http://schemas.apache.org/idltypes/fixed.idl"
+     xmlns="http://www.w3.org/2001/XMLSchema"
+     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+      <xsd:complexType name="Y.H">
+        <xsd:sequence>
+          <xsd:element name="item" type="xsd:decimal" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+      </xsd:complexType>
+      <xsd:simpleType name="X.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:totalDigits value="10"/>
+          <xsd:fractionDigits value="2"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType name="X.PARAM.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:fractionDigits value="2"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType name="Z.H">
+        <xsd:restriction base="xsd:decimal">
+          <xsd:totalDigits value="8"/>
+          <xsd:fractionDigits value="7"/>
+        </xsd:restriction>
+      </xsd:simpleType>
+      <xsd:simpleType name="Z.PARAM.H">
+        <xsd:restriction base="xsd:decimal"/>
+      </xsd:simpleType>
+      <xsd:simpleType name="EXTENDED.X.PARAM.H">
+        <xsd:restriction base="xsd1:X.PARAM.H">
+          <xsd:totalDigits value="8"/>
+        </xsd:restriction>
+      </xsd:simpleType>      
+      <xsd:element name="Y.op_k.p1" type="xsd:decimal"/>
+      <xsd:element name="Y.op_k.p2" type="xsd:decimal"/>
+      <xsd:element name="Y.op_k.p3" type="xsd:decimal"/>
+      <xsd:element name="Y.op_k.return" type="xsd:decimal"/>
+      <xsd:element name="Y.op_h.p1" type="xsd1:Y.H"/>
+      <xsd:element name="Y.op_h.p2" type="xsd1:Y.H"/>
+      <xsd:element name="Y.op_h.p3" type="xsd1:Y.H"/>
+      <xsd:element name="Y.op_h.return" type="xsd1:Y.H"/>
+      <xsd:element name="X.op_m.p1" type="xsd1:X.PARAM.H"/>
+      <xsd:element name="X.op_m.p2" type="xsd1:X.PARAM.H"/>
+      <xsd:element name="X.op_m.p3" type="xsd1:X.PARAM.H"/>
+      <xsd:element name="X.op_m.return" type="xsd1:X.H"/>
+      <xsd:element name="Z.op_n.p1" type="xsd1:Z.PARAM.H"/>
+      <xsd:element name="Z.op_n.p2" type="xsd1:Z.PARAM.H"/>
+      <xsd:element name="Z.op_n.p3" type="xsd1:Z.PARAM.H"/>
+      <xsd:element name="Z.op_n.return" type="xsd1:Z.H"/>
+      <xsd:element name="EXTENDED.X.op_m.p1" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element name="EXTENDED.X.op_m.p2" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element name="EXTENDED.X.op_m.p3" type="xsd1:EXTENDED.X.PARAM.H"/>
+      <xsd:element name="EXTENDED.X.op_m.return" type="xsd1:EXTENDED.X.PARAM.H"/>
+    </schema>
+  </types>
+  <message name="Y.op_k">
+    <part name="p1" element="xsd1:Y.op_k.p1"/>
+    <part name="p2" element="xsd1:Y.op_k.p2"/>
+  </message>
+  <message name="Y.op_kResponse">
+    <part name="return" element="xsd1:Y.op_k.return"/>
+    <part name="p2" element="xsd1:Y.op_k.p2"/>
+    <part name="p3" element="xsd1:Y.op_k.p3"/>
+  </message>
+  <message name="Y.op_h">
+    <part name="p1" element="xsd1:Y.op_h.p1"/>
+    <part name="p2" element="xsd1:Y.op_h.p2"/>
+  </message>
+  <message name="Y.op_hResponse">
+    <part name="return" element="xsd1:Y.op_h.return"/>
+    <part name="p2" element="xsd1:Y.op_h.p2"/>
+    <part name="p3" element="xsd1:Y.op_h.p3"/>
+  </message>
+  <message name="X.op_m">
+    <part name="p1" element="xsd1:X.op_m.p1"/>
+    <part name="p2" element="xsd1:X.op_m.p2"/>
+  </message>
+  <message name="X.op_mResponse">
+    <part name="return" element="xsd1:X.op_m.return"/>
+    <part name="p2" element="xsd1:X.op_m.p2"/>
+    <part name="p3" element="xsd1:X.op_m.p3"/>
+  </message>
+  <message name="Z.op_n">
+    <part name="p1" element="xsd1:Z.op_n.p1"/>
+    <part name="p2" element="xsd1:Z.op_n.p2"/>
+  </message>
+  <message name="Z.op_nResponse">
+    <part name="return" element="xsd1:Z.op_n.return"/>
+    <part name="p2" element="xsd1:Z.op_n.p2"/>
+    <part name="p3" element="xsd1:Z.op_n.p3"/>
+  </message>
+  <message name="EXTENDED.X.op_m">
+    <part name="p1" element="xsd1:EXTENDED.X.op_m.p1"/>
+    <part name="p2" element="xsd1:EXTENDED.X.op_m.p2"/>
+  </message>
+  <message name="EXTENDED.X.op_mResponse">
+    <part name="return" element="xsd1:EXTENDED.X.op_m.return"/>
+    <part name="p2" element="xsd1:EXTENDED.X.op_m.p2"/>
+    <part name="p3" element="xsd1:EXTENDED.X.op_m.p3"/>
+  </message>
+  <portType name="Y">
+    <operation name="op_k">
+      <input message="tns:Y.op_k" name="op_k"/>
+      <output message="tns:Y.op_kResponse" name="op_kResponse"/>
+    </operation>
+    <operation name="op_h">
+      <input message="tns:Y.op_h" name="op_h"/>
+      <output message="tns:Y.op_hResponse" name="op_hResponse"/>
+    </operation>
+    <operation name="op_m">
+      <input message="tns:X.op_m" name="op_m"/>
+      <output message="tns:X.op_mResponse" name="op_mResponse"/>
+    </operation>
+    <operation name="op_n">
+      <input message="tns:Z.op_n" name="op_n"/>
+      <output message="tns:Z.op_nResponse" name="op_nResponse"/>
+    </operation>
+    <operation name="extended_op_m">
+      <input message="tns:EXTENDED.X.op_m" name="extended_op_m"/>
+      <output message="tns:EXTENDED.X.op_mResponse" name="extended_op_mResponse"/>
+    </operation>
+  </portType>
+</definitions>

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

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

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