incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r501533 - in /incubator/yoko/trunk/bindings/src: main/java/org/apache/yoko/bindings/corba/ main/java/org/apache/yoko/bindings/corba/types/ test/java/org/apache/yoko/bindings/corba/ test/java/org/apache/yoko/bindings/corba/types/
Date Tue, 30 Jan 2007 20:02:41 GMT
Author: bravi
Date: Tue Jan 30 12:02:39 2007
New Revision: 501533

URL: http://svn.apache.org/viewvc?view=rev&rev=501533
Log:
[YOKO-170] - Fixing the nillable & attributes types. Also enabled the test cases in the type test.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectReader.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectWriter.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaStaxObject.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaObjectHandler.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandler.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionHandler.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectReader.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectReader.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectReader.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectReader.java Tue Jan 30 12:02:39 2007
@@ -312,7 +312,7 @@
     }
 
     public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
-        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;        
+        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
         CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
         
         this.read(discriminator);
@@ -321,7 +321,7 @@
         if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
             discLabel = ((CorbaEnumHandler)discriminator).getValue();
         } else {
-            discLabel = ((CorbaPrimitiveHandler)discriminator).getValueData();
+            discLabel = ((CorbaPrimitiveHandler)discriminator).getDataFromValue(); 
         }
         
         // Now find the label in the union to get the right case
@@ -337,7 +337,7 @@
             List<CaseType> cases = branch.getCase();
             for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
                 CaseType c = caseIter.next();
-                if (c.getLabel().equals(discLabel)) {
+                if (c.getLabel().equalsIgnoreCase(discLabel)) {
                     CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
                     this.read(branchObj);
                     unionHandler.setValue(branch.getName(), branchObj);

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectWriter.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectWriter.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectWriter.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaObjectWriter.java Tue Jan 30 12:02:39 2007
@@ -232,7 +232,9 @@
         CorbaObjectHandler discriminator = ((CorbaUnionHandler)obj).getDiscriminator();
         this.write(discriminator);
         CorbaObjectHandler unionValue = ((CorbaUnionHandler)obj).getValue();
-        this.write(unionValue);
+        if (unionValue != null) {
+            this.write(unionValue);
+        }
     }
 
     public void writeArray(CorbaObjectHandler obj) throws CorbaBindingException {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaStaxObject.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaStaxObject.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaStaxObject.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaStaxObject.java Tue Jan 30 12:02:39 2007
@@ -53,6 +53,7 @@
 import org.apache.schemas.yoko.bindings.corba.Union;
 import org.apache.schemas.yoko.bindings.corba.Unionbranch;
 
+import org.apache.ws.commons.schema.XmlSchemaAttribute;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaGroupBase;
@@ -159,6 +160,10 @@
             obj = readPrimitiveFromStax(reader, idlType, tc, schemaType);
         } else {
             switch (tc.kind().value()) {
+            case TCKind._tk_any:
+                LOG.log(Level.INFO, "Reading any type from XML reader");
+                obj = readAnyFromStax(reader, idlType, tc, schemaType);
+                break;
             case TCKind._tk_array:
                 LOG.log(Level.INFO, "Reading array type from XML reader");
                 obj = readArrayFromStax(reader, idlType, tc, schemaType, !isNested);
@@ -211,8 +216,17 @@
         }
         writeObjectToStax(obj, schemaType, writer, factory, false);
     }
+    
+    protected void writeObjectToStax(CorbaObjectHandler obj,
+                                     XmlSchemaObject schemaType,
+                                     XMLEventWriter writer,
+                                     XMLEventFactory factory,
+                                     boolean isNested) {
+        writeObjectToStax(obj, null, schemaType, writer, factory, isNested);
+    }
 
     protected void writeObjectToStax(CorbaObjectHandler obj,
+                                     QName objName,
                                      XmlSchemaObject schemaType,
                                      XMLEventWriter writer,
                                      XMLEventFactory factory,
@@ -221,41 +235,45 @@
             if (obj != null) {
                 TypeCode tc = obj.getTypeCode();
                 if (CorbaUtils.isPrimitiveIdlType(obj.getIdlType())) {
-                    writePrimitiveToStax(obj, schemaType, writer, factory);
+                    writePrimitiveToStax(obj, objName, schemaType, writer, factory);
                 } else {
                     switch (tc.kind().value()) {
+                    case TCKind._tk_any:
+                        LOG.log(Level.INFO, "Writing any type to XML writer");
+                        writeAnyToStax(obj, objName, schemaType, writer, factory);
+                        break;
                     case TCKind._tk_array:
                         LOG.log(Level.INFO, "Writing array type to XML writer");
-                        writeArrayToStax(obj, schemaType, writer, factory, !isNested);
+                        writeArrayToStax(obj, objName, schemaType, writer, factory, !isNested);
                         break;
                     case TCKind._tk_enum:
                         LOG.log(Level.INFO, "Writing enum type to XML writer");
-                        writeEnumToStax(obj, schemaType, writer, factory);
+                        writeEnumToStax(obj, objName, schemaType, writer, factory);
                         break;
                     case TCKind._tk_except:
                         LOG.log(Level.INFO, "Writing exception type to XML writer");
-                        writeExceptionToStax(obj, schemaType, writer, factory);
+                        writeExceptionToStax(obj, objName, schemaType, writer, factory);
                         break;
                     case TCKind._tk_fixed:
                         LOG.log(Level.INFO, "Writing fixed type to XML writer");
-                        writeFixedToStax(obj, schemaType, writer, factory);
+                        writeFixedToStax(obj, objName, schemaType, writer, factory);
                         break;
                     case TCKind._tk_sequence:
                         LOG.log(Level.INFO, "Writing sequence type to XML writer");
-                        writeSequenceToStax(obj, schemaType, writer, factory, !isNested);
+                        writeSequenceToStax(obj, objName, schemaType, writer, factory, !isNested);
                         break;
                     case TCKind._tk_struct:
                         LOG.log(Level.INFO, "Writing struct type to XML writer");
-                        writeStructToStax(obj, schemaType, writer, factory);
+                        writeStructToStax(obj, objName, schemaType, writer, factory);
                         break;
                     case TCKind._tk_union:
                         LOG.log(Level.INFO, "Writing union type to XML writer");
-                        writeUnionToStax(obj, schemaType, writer, factory);
+                        writeUnionToStax(obj, objName, schemaType, writer, factory);
                         break;
                     case TCKind._tk_string:
                     case TCKind._tk_wstring:
                         LOG.log(Level.INFO, "Wrting anonymous string to XML writer");
-                        writePrimitiveToStax(obj, schemaType, writer, factory);
+                        writePrimitiveToStax(obj, objName, schemaType, writer, factory);
                         break;
                     default:
                         throw new CorbaBindingException("Unsupported complex type");
@@ -281,6 +299,65 @@
         throws CorbaBindingException {
         try {
             StartElement startEl = reader.nextEvent().asStartElement();
+            QName name = startEl.getName();
+            XMLEvent evt = reader.nextEvent();
+            Characters charEl;
+            if (evt.isStartElement()) {
+                charEl = reader.nextEvent().asCharacters();
+            } else {
+                charEl = evt.asCharacters();
+            }
+            String value = charEl.getData();
+            reader.nextEvent().asEndElement();
+            CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(name, idlType, tc, null);
+            obj.setValueFromData(value);
+            return obj;
+        } catch (java.lang.Exception ex) {
+            LOG.log(Level.SEVERE, "Error: Object not correctly defined in the XML reader");
+            throw new CorbaBindingException("Invalid XML event read", ex);
+        }
+    }
+    
+    protected void writePrimitiveToStax(CorbaObjectHandler obj,
+                                        QName objName,
+                                        XmlSchemaObject schemaType,
+                                        XMLEventWriter writer,
+                                        XMLEventFactory factory) 
+        throws XMLStreamException {
+        if (objName == null) {
+            objName = obj.getName();
+        }
+        String value = ((CorbaPrimitiveHandler)obj).getDataFromValue();
+        LOG.log(Level.INFO, "Writing primitive type to XML writer");
+        StartElement startEl = factory.createStartElement(objName, null, null);
+        writer.add(startEl);
+
+        Characters charEvt = factory.createCharacters(value);
+        writer.add(charEvt);
+
+        EndElement endEl = factory.createEndElement(objName, null);
+        writer.add(endEl);
+    }
+
+    //REVISIT, change this to read more than just primitive objects.
+    protected CorbaObjectHandler readAnyFromStax(XMLEventReader reader,
+                                                 QName idlType,
+                                                 TypeCode tc,
+                                                 XmlSchemaObject schemaType) 
+        throws CorbaBindingException {
+        try {
+            StartElement startEl = reader.nextEvent().asStartElement();
+            Iterator attrIter = startEl.getAttributes();
+            String anySchemaType = null;
+            while (attrIter.hasNext()) {
+                Attribute attr = (Attribute)attrIter.next();
+                QName attrName = attr.getName();
+                if (attrName.getNamespaceURI().equals(XSI_NAMESPACE_URI)
+                    && attrName.getLocalPart().equals("type")) {
+                    anySchemaType = attr.getValue();
+                    break;
+                }
+            }
             Characters charEl = null;
             XMLEvent event = reader.nextEvent();
             if (event.isStartElement()) {
@@ -290,77 +367,52 @@
                 charEl = event.asCharacters();
             }                                    
                                     
-            reader.nextEvent().asEndElement();             
-            if (tc.kind().value() == TCKind._tk_any) {
-                Iterator attrIter = startEl.getAttributes();
-                String anySchemaType = null;
-                while (attrIter.hasNext()) {
-                    Attribute attr = (Attribute)attrIter.next();
-                    QName attrName = attr.getName();
-                    if (attrName.getNamespaceURI().equals(XSI_NAMESPACE_URI)
-                        && attrName.getLocalPart().equals("type")) {
-                        anySchemaType = attr.getValue();
-                        break;
-                    }
-                }
-                           
-                CorbaAnyHandler obj = new CorbaAnyHandler(startEl.getName(), idlType, tc, null);
-                obj.setValueFromData(orb, charEl.getData(), anySchemaType);
-                return obj;
-                
-            } else {
-                CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(startEl.getName(), idlType, tc, null);
-                obj.setValueFromData(charEl.getData());
-                return obj;
-            }
+            reader.nextEvent().asEndElement();
+            CorbaAnyHandler obj = new CorbaAnyHandler(startEl.getName(), idlType, tc, null);
+            obj.setValueFromData(orb, charEl.getData(), anySchemaType);
+            return obj;
         } catch (java.lang.Exception ex) {
             ex.printStackTrace();
             LOG.log(Level.SEVERE, "Error: Object not correctly defined in the XML reader");
             throw new CorbaBindingException("Invalid XML event read", ex);
         }
     }
-    
-    protected void writePrimitiveToStax(CorbaObjectHandler obj,
-                                        XmlSchemaObject schemaObj,
-                                        XMLEventWriter writer,
-                                        XMLEventFactory factory) 
+
+    //REVISIT, change this to write more than just primitive objects.
+    protected void writeAnyToStax(CorbaObjectHandler obj,
+                                  QName objName,
+                                  XmlSchemaObject schemaObj,
+                                  XMLEventWriter writer,
+                                  XMLEventFactory factory) 
         throws XMLStreamException {
         StartElement startEl;
-        QName objName = obj.getName();
-        LOG.log(Level.INFO, "Writing primitive type to XML writer");
-        if (obj.getTypeCodeKind().value() == TCKind._tk_any) {
-            // Any is a special case. Create an attribute called
-            // xsi:type which identifies the type
-            // of object stored in the Any. Also create a 'dummy'
-            // attribute to get the XML schema
-            // namespace included in the Stax event.
-            // createNamespace() doesn't work for some reason.
-            // TODO: Revisit this.
-            String schemaType = ((CorbaAnyHandler)obj).getSchemaType();
-            QName attrName = new QName(XSI_NAMESPACE_URI, 
-                                       "type", XSI_PREFIX);
-            Attribute attr = factory.createAttribute(attrName, 
-                                                     schemaType);
-            QName nsName = new QName(XMLSCHEMA_NAMESPACE_URI, 
-                                     "namespace", XMLSCHEMA_PREFIX);
-            Attribute ns = factory.createAttribute(nsName, "");
-            List<Attribute> attributes = new ArrayList<Attribute>();
-            attributes.add(attr);
-            attributes.add(ns);
-
-            startEl = factory.createStartElement(objName, attributes.iterator(), null);
-        } else {
-            startEl = factory.createStartElement(objName, null, null);
+        if (objName == null) {
+            objName = obj.getName();
         }
+        // Any is a special case. Create an attribute called
+        // xsi:type which identifies the type
+        // of object stored in the Any. Also create a 'dummy'
+        // attribute to get the XML schema
+        // namespace included in the Stax event.
+        // createNamespace() doesn't work for some reason.
+        // TODO: Revisit this.
+        String schemaType = ((CorbaAnyHandler)obj).getSchemaType();
+        QName attrName = new QName(XSI_NAMESPACE_URI, 
+                                   "type", XSI_PREFIX);
+        Attribute attr = factory.createAttribute(attrName, 
+                                                 schemaType);
+        QName nsName = new QName(XMLSCHEMA_NAMESPACE_URI, 
+                                 "namespace", XMLSCHEMA_PREFIX);
+        Attribute ns = factory.createAttribute(nsName, "");
+        List<Attribute> attributes = new ArrayList<Attribute>();
+        attributes.add(attr);
+        attributes.add(ns);
+
+        startEl = factory.createStartElement(objName, attributes.iterator(), null);
 
         writer.add(startEl);
 
-        Characters charEvt = null;
-        if (obj.getTypeCodeKind() == TCKind.tk_any) {
-            charEvt = factory.createCharacters(((CorbaAnyHandler)obj).getValueData());
-        } else {
-            charEvt = factory.createCharacters(((CorbaPrimitiveHandler)obj).getValueData());
-        }
+        Characters charEvt = factory.createCharacters(((CorbaAnyHandler)obj).getValueData());
         writer.add(charEvt);
 
         EndElement endEl = factory.createEndElement(objName, null);
@@ -419,7 +471,7 @@
                 arrayElemType = arrayType.getElemtype();
                 arrayBound = arrayType.getBound();
             }
-            XmlSchemaElement el = getXmlSchemaSequenceElement(schemaType, idlType);
+            XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
 
             QName name;
             if (isTopLevel) {
@@ -452,6 +504,7 @@
     }
 
     protected void writeArrayToStax(CorbaObjectHandler obj,
+                                    QName objName,
                                     XmlSchemaObject schemaType,
                                     XMLEventWriter writer,
                                     XMLEventFactory factory,
@@ -460,13 +513,15 @@
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + obj.getIdlType());
         }
-        QName objName = obj.getName();
+        if (objName == null) {
+            objName = obj.getName();
+        }
         if (isTopLevel) {
             StartElement startEl = factory.createStartElement(objName, null, null);
             writer.add(startEl);
         }
         CorbaArrayHandler arrayHandler = (CorbaArrayHandler)obj;
-        XmlSchemaElement el = getXmlSchemaSequenceElement(schemaType, obj.getIdlType());
+        XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
         List<CorbaObjectHandler> elements = arrayHandler.getElements();
         for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
             CorbaObjectHandler handler = elementsIter.next();
@@ -510,11 +565,14 @@
     }
     
     protected void writeEnumToStax(CorbaObjectHandler obj,
+                                   QName objName,
                                    XmlSchemaObject schemaType,
                                    XMLEventWriter writer,
                                    XMLEventFactory factory) 
         throws XMLStreamException {
-        QName objName = obj.getName();
+        if (objName == null) {
+            objName = obj.getName();
+        }
         StartElement startEl = factory.createStartElement(objName, null, null);
         writer.add(startEl);    
         CorbaEnumHandler enumHandler = (CorbaEnumHandler)obj;
@@ -557,6 +615,7 @@
     }
 
     protected void writeExceptionToStax(CorbaObjectHandler obj,
+                                        QName objName,
                                         XmlSchemaObject schemaType,
                                         XMLEventWriter writer,
                                         XMLEventFactory factory) 
@@ -564,7 +623,9 @@
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + obj.getIdlType());
         }
-        QName objName = obj.getName();
+        if (objName == null) {
+            objName = obj.getName();
+        }
         StartElement startEl = factory.createStartElement(objName, null, null);
         writer.add(startEl);
         CorbaExceptionHandler exObj = (CorbaExceptionHandler)obj;
@@ -606,7 +667,7 @@
             if (schemaType instanceof XmlSchemaElement) {
                 name = ((XmlSchemaElement) schemaType).getQName();
             }
-            XmlSchemaElement el = getXmlSchemaSequenceElement(schemaType, idlType);
+            XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
             if (isTopLevel) {
                 name = reader.nextEvent().asStartElement().getName();
             }
@@ -624,6 +685,7 @@
                 XMLEvent event = reader.peek();
                 while (event.getEventType() == XMLStreamConstants.START_ELEMENT) {
                     StartElement startEl = (StartElement) event;
+                    //REVISIT, check if qualified or unqualified
                     if (startEl.getName().equals(el.getQName())) {
                         if (nestedSequence) {
                             reader.nextEvent().asStartElement();
@@ -663,6 +725,7 @@
     }
 
     protected void writeSequenceToStax(CorbaObjectHandler obj,
+                                       QName name,
                                        XmlSchemaObject schemaType,
                                        XMLEventWriter writer,
                                        XMLEventFactory factory,
@@ -671,12 +734,14 @@
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + obj.getIdlType());
         }
-        QName name = obj.getName();
+        if (name == null) {
+            name = obj.getName();
+        }
         if (isTopLevel) {
             StartElement startEl = factory.createStartElement(name, null, null);
             writer.add(startEl);
         }
-        XmlSchemaElement el = getXmlSchemaSequenceElement(schemaType, obj.getIdlType());
+        XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
         CorbaSequenceHandler seqHandler = (CorbaSequenceHandler)obj;
         List<CorbaObjectHandler> elements = seqHandler.getElements();
         for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
@@ -706,11 +771,10 @@
         throws CorbaBindingException {
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + idlType);
-        }
+        }         
         CorbaStructHandler obj = null;
         try {            
             Struct structType = (Struct) CorbaUtils.getCorbaType(idlType, typeMaps);
- 
             XmlSchemaObjectCollection attrs = null;
             XmlSchemaObjectCollection members = null;
             
@@ -737,9 +801,10 @@
                 members = ((XmlSchemaGroupBase) stype).getItems();
             }
             QName elName;
-            if (readElement) {
-                StartElement structStartEl = reader.nextEvent().asStartElement();
-                elName = structStartEl.getName();
+            if ((attrs != null) && (attrs.getCount() > 0)) {
+                elName = reader.peek().asStartElement().getName();
+            } else if (readElement) {
+                elName = reader.nextEvent().asStartElement().getName();
             } else {
                 elName = CorbaUtils.EMPTY_QNAME;
             }
@@ -750,7 +815,7 @@
             int memberCount = 0;
             for (int i = 0; i < structMembers.size(); ++i) {
                 XmlSchemaObject schemaObj;
-                if ((attrs != null) && (attrCount != attrs.getCount())) {
+                if ((attrs != null) && (attrCount < attrs.getCount())) {
                     schemaObj = attrs.getItem(attrCount++);
                 } else {
                     schemaObj = members.getItem(memberCount++);
@@ -760,6 +825,11 @@
                                                                schemaObj,
                                                                true);
                 obj.addMember(member);
+                if ((attrs != null) && (attrs.getCount() != 0) && (attrCount == attrs.getCount())) {
+                    //Finished reading all the attributes, now read the start element
+                    reader.nextEvent();
+                    attrCount++;
+                }
             }
             if (readElement) {
                 reader.nextEvent().asEndElement();
@@ -773,6 +843,7 @@
     }
 
     protected void writeStructToStax(CorbaObjectHandler obj,
+                                     QName objName,
                                      XmlSchemaObject schemaType,
                                      XMLEventWriter writer,
                                      XMLEventFactory factory) 
@@ -780,7 +851,9 @@
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + obj.getIdlType());
         }
-        QName objName = obj.getName();
+        if (objName == null) {
+            objName = obj.getName();
+        }
         XmlSchemaObjectCollection attrs = null;
         XmlSchemaObjectCollection members = null;
             
@@ -840,90 +913,201 @@
         if (schemaType == null) {
             throw new CorbaBindingException("Couldn't find xml schema object for : " + idlType);
         }
+        XmlSchemaObject stype = schemaType;
+        boolean readElement = true;
+        QName elName = null;
+        if (schemaType instanceof XmlSchemaAttribute) {
+            readElement = false;
+            elName = ((XmlSchemaAttribute) schemaType).getQName();
+        } else if (schemaType instanceof XmlSchemaElement) {
+            XmlSchemaElement el = (XmlSchemaElement) schemaType;
+            elName = ((XmlSchemaElement) el).getQName();
+            if (el.isNillable()) {
+                readElement = false;
+            }
+            stype = el.getSchemaType();
+            if (stype == null) {
+                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+            }       
+        }
         CorbaUnionHandler obj = null;
-        try {
-            Union unionType = (Union) CorbaUtils.getCorbaType(idlType, typeMaps);
-            StartElement unionStartEl = reader.nextEvent().asStartElement();            
-
-            obj = new CorbaUnionHandler(unionStartEl.getName(), idlType, tc, unionType);
-
-            // Read the discriminator value from the reader.  We can't rely on the value from 
-            // Stax since it may be a default value if the caller has forgotten to explicitly
-            // set the discriminator in their union class.  This could cause all sorts of 
-            // problems when we try create the CORBA union.  For now, we'll just read and ignore.
-            // TODO: Revisit this if we want to make this assumption.
-            reader.nextEvent().asStartElement().getName();
-            reader.nextEvent().asCharacters();
-            reader.nextEvent().asEndElement();
-            
-            // Build the entire union with all branches, etc.  Then read info from the XML Event Reader
-            StartElement branchElement = reader.peek().asStartElement();
-            String branchName = branchElement.getName().getLocalPart();
-            List<Unionbranch> branches = unionType.getUnionbranch();
-            for (Iterator<Unionbranch> branchesIter = branches.iterator(); branchesIter.hasNext();) {
-                Unionbranch branch = branchesIter.next();
-                CorbaObjectHandler branchObj = null;
-                if (branch.getName().equals(branchName)) {
-                    branchObj = readObjectFromStax(reader, branch.getIdltype(), null, true);
-                    // We also need to set the discriminator since this is the branch with the actual
-                    // union value
-                    CorbaObjectHandler discObj = 
-                        CorbaHandlerUtils.createTypeHandler(orb,
-                                                            new QName("discriminator"),
-                                                            unionType.getDiscriminator(),
-                                                            typeMaps,
-                                                            serviceInfo);
-                    obj.setDiscriminator(discObj);
-
-                    // Determine the value of the discriminator.  
-                    List<CaseType> branchCases = branch.getCase();
-                    String discValue = null;
-                    if (branchCases.size() != 0) {
-                        // This represents a union case.  Set the discriminator based on the first
-                        // label value associated with the branch (since we don't have this information)
-                        // from the Stax representation of the Celtix object).
-                        CaseType caseLabel = branchCases.get(0);
-                        discValue = caseLabel.getLabel();
+        if (!readElement) {
+            obj = readAttributeOrNillableElementFromStax(reader, elName, idlType, tc, schemaType);
+        } else {
+            try {
+                Union unionType = (Union) CorbaUtils.getCorbaType(idlType, typeMaps);
+                elName = reader.nextEvent().asStartElement().getName();
+                obj = new CorbaUnionHandler(elName, idlType, tc, unionType);
+                // Build the entire union with all branches, etc.  Then read info from the XML Event Reader
+                StartElement branchElement = reader.peek().asStartElement();
+                String branchName = branchElement.getName().getLocalPart();
+                List<Unionbranch> branches = unionType.getUnionbranch();
+                for (Iterator<Unionbranch> branchesIter = branches.iterator(); branchesIter.hasNext();) {
+                    Unionbranch branch = branchesIter.next();
+                    CorbaObjectHandler branchObj = null;
+                    if (branch.getName().equals(branchName)) {
+                        branchObj = readObjectFromStax(reader, branch.getIdltype(), stype, true);
+                        // We also need to set the discriminator since this is the branch with the actual
+                        // union value
+                        CorbaObjectHandler discObj = 
+                            CorbaHandlerUtils.createTypeHandler(orb,
+                                                                new QName("discriminator"),
+                                                                unionType.getDiscriminator(),
+                                                                typeMaps,
+                                                                serviceInfo);
+                        obj.setDiscriminator(discObj);
+
+                        // Determine the value of the discriminator.  
+                        List<CaseType> branchCases = branch.getCase();
+                        String discValue = null;
+                        if (branchCases.size() != 0) {
+                            // This represents a union case.  Set the discriminator based on the first
+                            // label value associated with the branch (since we don't have this information)
+                            // from the Stax representation of the Celtix object).
+                            CaseType caseLabel = branchCases.get(0);
+                            discValue = caseLabel.getLabel();
+                        } else {
+                            // This represents the default case.
+                            discValue = obj.createDefaultDiscriminatorLabel();
+                        }
+                        obj.setDiscriminatorValueFromData(discValue);
+                        obj.setValue(branchName, branchObj);
                     } else {
-                        // This represents the default case.  Since Celtix does not provide a 
-                        // discriminator value, we'll create one.
-                        discValue = obj.createDefaultDiscriminatorLabel();
+                        // Create an object holder with no value
+                        branchObj = CorbaHandlerUtils.createTypeHandler(orb,
+                                                                        new QName(branch.getName()),
+                                                                        branch.getIdltype(),
+                                                                        typeMaps,
+                                                                        serviceInfo);
                     }
-                    obj.setDiscriminatorValueFromData(discValue);
-                    obj.setValue(branchName, branchObj);
+                    obj.addCase(branchObj);
+                }
+                reader.nextEvent().asEndElement();
+            } catch (java.lang.Exception ex) {
+                LOG.log(Level.SEVERE, "Received exception while reading object of type " + idlType);
+                throw new CorbaBindingException("Error while reading union corba type", ex);
+            }
+        }
+        return obj;
+    }
+ 
+    private CorbaUnionHandler readAttributeOrNillableElementFromStax(XMLEventReader reader,
+                                                                     QName name,
+                                                                     QName idlType,
+                                                                     TypeCode tc,
+                                                                     XmlSchemaObject schemaType)
+        throws CorbaBindingException {
+        Union unionType = (Union) CorbaUtils.getCorbaType(idlType, typeMaps);
+        CorbaUnionHandler obj = new CorbaUnionHandler(name, idlType, tc, unionType);
+        CorbaPrimitiveHandler discObj =
+            new CorbaPrimitiveHandler(new QName("discriminator"),
+                                      unionType.getDiscriminator(),
+                                      orb.get_primitive_tc(TCKind.from_int(TCKind._tk_boolean)),
+                                      null);
+
+        //only one union branch for a attribute / element nillable types.
+        List<Unionbranch> branches = unionType.getUnionbranch();
+        try {
+            XMLEvent evt = reader.peek();
+            if (schemaType instanceof XmlSchemaAttribute) {
+                CorbaPrimitiveHandler value = getAttributeValue(evt, name, branches.get(0).getIdltype());
+                if (value != null) {
+                    discObj.setValue(Boolean.TRUE);
+                    obj.setValue("value", value);
+                    obj.addCase(value);
                 } else {
-                    // Create an object holder with no value
-                    branchObj = CorbaHandlerUtils.createTypeHandler(orb,
-                                                                    new QName(branch.getName()),
-                                                                    branch.getIdltype(),
-                                                                    typeMaps, serviceInfo);
+                    discObj.setValue(Boolean.FALSE);
                 }
-                obj.addCase(branchObj);
+            } else if (!isElementNil(evt, name)) {
+                discObj.setValue(Boolean.TRUE);
+                CorbaObjectHandler branchObj = readObjectFromStax(reader,
+                                                                  branches.get(0).getIdltype(),
+                                                                  schemaType,
+                                                                  true);
+                obj.setValue("value", branchObj);
+            } else {
+                discObj.setValue(Boolean.FALSE);
+                reader.nextEvent().asStartElement();
+                reader.nextEvent().asEndElement();
             }
-            reader.nextEvent().asEndElement();
+            obj.setDiscriminator(discObj);
         } catch (java.lang.Exception ex) {
             LOG.log(Level.SEVERE, "Received exception while reading object of type " + idlType);
             throw new CorbaBindingException("Error while reading union corba type", ex);
         }
-        
         return obj;
     }
-    
+   
     protected void writeUnionToStax(CorbaObjectHandler obj,
+                                    QName objName,
                                     XmlSchemaObject schemaType,
                                     XMLEventWriter writer,
                                     XMLEventFactory factory)
         throws XMLStreamException {
-        QName objName = obj.getName();
-        StartElement startEl = factory.createStartElement(objName, null, null);
-        writer.add(startEl);
+        if (schemaType == null) {
+            throw new CorbaBindingException("Couldn't find xml schema object for : " + obj.getIdlType());
+        }
+        if (objName == null) {
+            objName = obj.getName();
+        }
+        XmlSchemaObject stype = schemaType;
+        boolean writeElement = true;
+        QName elName = null;
+        if (schemaType instanceof XmlSchemaAttribute) {
+            writeElement = false;
+        } else if (schemaType instanceof XmlSchemaElement) {
+            XmlSchemaElement el = (XmlSchemaElement) schemaType;
+            if (el.isNillable()) {
+                //should not write the start Element.
+                writeElement = false;
+            }
+            stype = el.getSchemaType();
+            if (stype == null) {
+                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+            }
+        }
         CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
-        CorbaObjectHandler discValue = unionHandler.getDiscriminator();
-        writeObjectToStax(discValue, null, writer, factory, true);
-        CorbaObjectHandler unionValue = unionHandler.getValue();
-        writeObjectToStax(unionValue, null, writer, factory, true);
-        EndElement endEl = factory.createEndElement(objName, null);
-        writer.add(endEl); 
+        if (!writeElement) {
+            writeAttributeOrNillableElementToStax(unionHandler, stype, objName, writer, factory);
+        } else {
+            StartElement startEl = factory.createStartElement(objName, null, null);
+            writer.add(startEl);
+            CorbaObjectHandler unionValue = unionHandler.getValue();
+            writeObjectToStax(unionValue, stype, writer, factory, true);
+            EndElement endEl = factory.createEndElement(objName, null);
+            writer.add(endEl);
+        }
+    }
+
+    protected void writeAttributeOrNillableElementToStax(CorbaUnionHandler obj,
+                                                         XmlSchemaObject schemaType,
+                                                         QName name,
+                                                         XMLEventWriter writer,
+                                                         XMLEventFactory factory)
+        throws XMLStreamException { 
+        CorbaPrimitiveHandler discValue = (CorbaPrimitiveHandler) obj.getDiscriminator();      
+        if (((Boolean) discValue.getValue()).booleanValue()) {
+            CorbaObjectHandler value = obj.getValue();
+            if (schemaType instanceof XmlSchemaAttribute) {
+                QName attrName = name;
+                if (!CorbaUtils.isAttributeFormQualified(serviceInfo, attrName.getNamespaceURI())) {
+                    attrName = new QName("", attrName.getLocalPart());
+                }
+                Attribute attr = factory.createAttribute(attrName,
+                                                         ((CorbaPrimitiveHandler) value).getDataFromValue());
+                writer.add(attr);
+            } else {
+                writeObjectToStax(value, name, schemaType, writer, factory, true);
+            }
+        } else {
+            StartElement startEl = factory.createStartElement(name, null, null);
+            writer.add(startEl);
+            QName nilAttr = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil");
+            Attribute attr = factory.createAttribute(nilAttr, "true");
+            writer.add(attr);
+            EndElement endEl = factory.createEndElement(name, null);
+            writer.add(endEl);
+        }
     }
     
     protected CorbaObjectHandler readFixedFromStax(XMLEventReader reader,
@@ -947,11 +1131,14 @@
     }
     
     protected void writeFixedToStax(CorbaObjectHandler obj,
+                                    QName objName,
                                     XmlSchemaObject schemaType,
                                     XMLEventWriter writer,
                                     XMLEventFactory factory) 
         throws XMLStreamException {
-        QName objName = obj.getName();
+        if (objName == null) {
+            objName = obj.getName();
+        }
         StartElement startEl = factory.createStartElement(objName, null, null);
         writer.add(startEl);
         CorbaFixedHandler fixedHandler = (CorbaFixedHandler)obj;
@@ -985,26 +1172,46 @@
     private boolean isNestedArray(QName arrayElType) {
         TypeCode tc = CorbaUtils.getTypeCode(orb, arrayElType, typeMaps);
         return isNestedArray(tc);
-    }
-    
-    private XmlSchemaElement getXmlSchemaSequenceElement(XmlSchemaObject schemaType, QName idlType) {
-        XmlSchemaObject stype = schemaType;
-        XmlSchemaElement el = null;
-        if (schemaType instanceof XmlSchemaElement) {
-            stype = ((XmlSchemaElement) schemaType).getSchemaType();
-            if (stype == null) {
-                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+    }    
+
+    private boolean isElementNil(XMLEvent evt, QName elName) {
+        boolean result = true;
+        if (evt.isStartElement()) {
+            StartElement el = (StartElement) evt;
+            QName name = elName;
+            if (!CorbaUtils.isElementFormQualified(serviceInfo, elName.getNamespaceURI())) {
+                name = new QName("", elName.getLocalPart());
+            }
+            if (el.getName().equals(name)) {
+                QName nilAttr = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil");
+                Attribute attr = el.getAttributeByName(nilAttr);
+                if (attr == null) {                 
+                    result = false;
+                } else if (!attr.getValue().equalsIgnoreCase("true")) {
+                    result = false; 
+                }
             }
-        }
-        
-        if (stype instanceof XmlSchemaComplexType) {
-            //only one element inside the XmlSchemaComplexType
-            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
-            XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
-            el = (XmlSchemaElement) group.getItems().getItem(0);
         } else {
-            el = (XmlSchemaElement) schemaType;
+            throw new CorbaBindingException("Expected a element with nillable attribute: " + elName);
         }
-        return el;
+        return result;
+    }
+
+    private CorbaPrimitiveHandler getAttributeValue(XMLEvent evt, QName attrName, QName idlType) {
+        CorbaPrimitiveHandler result = null;
+        if (evt.isStartElement()) {
+            StartElement el = (StartElement) evt;
+            QName name = attrName;
+            if (!CorbaUtils.isAttributeFormQualified(serviceInfo, attrName.getNamespaceURI())) {
+                name = new QName("", attrName.getLocalPart());
+            }
+            Attribute attr = el.getAttributeByName(name);
+            if (attr != null) {
+                TypeCode tc = CorbaUtils.getTypeCode(orb, idlType, typeMaps);
+                result = new CorbaPrimitiveHandler(new QName("value"), idlType, tc, null);
+                result.setValueFromData(attr.getValue());
+            }
+        }
+        return result;
     }
 }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java Tue Jan 30 12:02:39 2007
@@ -57,6 +57,7 @@
 
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaExternal;
+import org.apache.ws.commons.schema.XmlSchemaForm;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
 import org.apache.yoko.wsdl.CorbaConstants;
@@ -417,6 +418,60 @@
         return result;
     }
 
+    //Change this method to access the XmlSchemaCollection.
+    public static boolean isElementFormQualified(ServiceInfo serviceInfo, String uri) {
+        SchemaInfo schemaInfo = serviceInfo.getSchema(uri);
+        if (schemaInfo != null) {
+            return schemaInfo.isElementFormQualified();
+        }
+        Iterator<SchemaInfo> it = serviceInfo.getSchemas().iterator();
+        while (it.hasNext()) {
+            XmlSchema schema = it.next().getSchema();
+            return isElementFormQualified(schema, uri);
+        }
+        return false;
+    }
+
+    //Change this method to access the XmlSchemaCollection.
+    private static boolean isElementFormQualified(XmlSchema schema, String uri) {
+        if (uri.equals(schema.getTargetNamespace())) {
+            return schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);
+        }
+        Iterator it = schema.getIncludes().getIterator();
+        while (it.hasNext()) {
+            XmlSchemaExternal extSchema = (XmlSchemaExternal) it.next();
+            return isElementFormQualified(extSchema.getSchema(), uri);
+        }
+        return false;
+    }
+
+    //Change this method to access the XmlSchemaCollection.
+    public static boolean isAttributeFormQualified(ServiceInfo serviceInfo, String uri) {
+        SchemaInfo schemaInfo = serviceInfo.getSchema(uri);
+        if (schemaInfo != null) {
+            return schemaInfo.isAttributeFormQualified();
+        }
+        Iterator<SchemaInfo> it = serviceInfo.getSchemas().iterator();
+        while (it.hasNext()) {
+            XmlSchema schema = it.next().getSchema();
+            return isAttributeFormQualified(schema, uri);
+        }
+        return false;
+    }
+
+    //Change this method to access the XmlSchemaCollection.
+    private static boolean isAttributeFormQualified(XmlSchema schema, String uri) {
+        if (uri.equals(schema.getTargetNamespace())) {
+            return schema.getAttributeFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);
+        }
+        Iterator it = schema.getIncludes().getIterator();
+        while (it.hasNext()) {
+            XmlSchemaExternal extSchema = (XmlSchemaExternal) it.next();
+            return isAttributeFormQualified(extSchema.getSchema(), uri);
+        }
+        return false;
+    }
+
     static {
         PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_BOOLEAN, TCKind.from_int(TCKind._tk_boolean));
         PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_CHAR, TCKind.from_int(TCKind._tk_char));
@@ -432,6 +487,5 @@
         PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_DOUBLE, TCKind.from_int(TCKind._tk_double));
         PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_STRING, TCKind.from_int(TCKind._tk_string));
         PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_WSTRING, TCKind.from_int(TCKind._tk_wstring));
-        PRIMITIVE_TYPECODES.put(CorbaConstants.NT_CORBA_ANY, TCKind.from_int(TCKind._tk_any));
     }
 }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java Tue Jan 30 12:02:39 2007
@@ -23,7 +23,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 
 import org.apache.schemas.yoko.bindings.corba.Anonarray;
@@ -36,13 +35,13 @@
 import org.apache.schemas.yoko.bindings.corba.Union;
 import org.apache.schemas.yoko.bindings.corba.Unionbranch;
 
-import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaAttribute;
 import org.apache.ws.commons.schema.XmlSchemaComplexType;
 import org.apache.ws.commons.schema.XmlSchemaElement;
-import org.apache.ws.commons.schema.XmlSchemaExternal;
-import org.apache.ws.commons.schema.XmlSchemaForm;
+import org.apache.ws.commons.schema.XmlSchemaGroupBase;
+import org.apache.ws.commons.schema.XmlSchemaGroupRef;
+import org.apache.ws.commons.schema.XmlSchemaObject;
 import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
-import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
 import org.apache.yoko.bindings.corba.CorbaTypeMap;
@@ -61,7 +60,6 @@
                                                        List<CorbaTypeMap> typeMaps,
                                                        ServiceInfo serviceInfo) {
         CorbaObjectHandler handler = null;        
-
         TypeCode tc = CorbaUtils.getTypeCode(orb, idlType, typeMaps);
         if (CorbaUtils.isPrimitiveIdlType(idlType)) {
             // Any is a special primitive
@@ -72,12 +70,6 @@
             }
         } else {
             CorbaTypeImpl type = CorbaUtils.getCorbaType(idlType, typeMaps);
-            //fixed is also a special primitive
-            if (tc.kind().value() != TCKind._tk_fixed) {
-                QName typeName = type.getType();
-                String nsUri = getNamespaceURI(serviceInfo, typeName);
-                name = new QName(nsUri, name.getLocalPart());
-            }
             switch (tc.kind().value()) {
             case TCKind._tk_array:
                 handler = new CorbaArrayHandler(name, idlType, tc, type);
@@ -112,30 +104,46 @@
 
         return handler;
     }
+
+    public static CorbaObjectHandler initializeObjectHandler(ORB orb,
+                                                             QName name, 
+                                                             QName idlType,
+                                                             List<CorbaTypeMap> typeMaps,
+                                                             ServiceInfo serviceInfo) {
+        CorbaTypeImpl type = CorbaUtils.getCorbaType(idlType, typeMaps);
+        XmlSchemaType schemaType = null;
+        if (type != null) {
+            schemaType = CorbaUtils.getXmlSchemaType(serviceInfo, type.getType());
+            String nsUri = getNamespaceURI(serviceInfo, type.getType());
+            name = new QName(nsUri, name.getLocalPart());
+        }
+        return initializeObjectHandler(orb, name, idlType, schemaType, typeMaps, serviceInfo);
+    }
     
     public static CorbaObjectHandler initializeObjectHandler(ORB orb,
                                                              QName name, 
                                                              QName idlType,
+                                                             XmlSchemaObject schemaType,
                                                              List<CorbaTypeMap> typeMaps,
-                                                             ServiceInfo serviceInfo) {                
+                                                             ServiceInfo serviceInfo) {
         CorbaObjectHandler obj = createTypeHandler(orb, name, idlType, typeMaps, serviceInfo);
         name = obj.getName();
         if (!CorbaUtils.isPrimitiveIdlType(idlType)) {
             switch (obj.getTypeCode().kind().value()) {
             case TCKind._tk_array:
-                initializeArrayHandler(orb, obj, name, typeMaps, serviceInfo);
+                initializeArrayHandler(orb, obj, name, schemaType, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_except:
-                initializeExceptionHandler(orb, obj, name, typeMaps, serviceInfo);
+                initializeExceptionHandler(orb, obj, name, schemaType, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_sequence:
-                initializeSequenceHandler(orb, obj, name, typeMaps, serviceInfo);
+                initializeSequenceHandler(orb, obj, name, schemaType, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_struct:
-                initializeStructHandler(orb, obj, name, typeMaps, serviceInfo);
+                initializeStructHandler(orb, obj, name, schemaType, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_union:
-                initializeUnionHandler(orb, obj, name, typeMaps, serviceInfo);
+                initializeUnionHandler(orb, obj, name, schemaType, typeMaps, serviceInfo);
                 break;
 
             default:
@@ -148,19 +156,16 @@
     public static void initializeArrayHandler(ORB orb,
                                               CorbaObjectHandler obj, 
                                               QName name,
+                                              XmlSchemaObject schemaType,
                                               List<CorbaTypeMap> typeMaps,
                                               ServiceInfo serviceInfo) {
         QName arrayElementType = null;
         long arrayBound = 0;
         CorbaTypeImpl baseType = obj.getType();
-        XmlSchemaType schemaType = CorbaUtils.getXmlSchemaType(serviceInfo, baseType.getType());
-        String elName = "item";
-        if ((schemaType != null) && (schemaType instanceof XmlSchemaComplexType)) {
-            XmlSchemaSequence seq = (XmlSchemaSequence) ((XmlSchemaComplexType) schemaType).getParticle();
-            XmlSchemaObjectCollection col = seq.getItems();
-            if (col.getCount() > 0) {
-                elName = ((XmlSchemaElement) col.getItem(0)).getName();
-            }       
+        XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
+        QName elementName = el.getQName();
+        if (!CorbaUtils.isElementFormQualified(serviceInfo, name.getNamespaceURI())) {
+            elementName = new QName("", elementName.getLocalPart());
         }
         if (baseType instanceof Array) {
             Array arrayType = (Array)baseType;
@@ -172,9 +177,8 @@
             arrayBound = anonArrayType.getBound();
         }
         for (int i = 0; i < arrayBound; ++i) {
-            QName elementName = new QName(name.getNamespaceURI(), elName);
             CorbaObjectHandler elementObj = 
-                initializeObjectHandler(orb, elementName, arrayElementType, typeMaps, serviceInfo);
+                initializeObjectHandler(orb, elementName, arrayElementType, el, typeMaps, serviceInfo);
             ((CorbaArrayHandler)obj).addElement(elementObj);
         }
     }
@@ -182,17 +186,28 @@
     public static void initializeExceptionHandler(ORB orb,
                                                   CorbaObjectHandler obj, 
                                                   QName name,
+                                                  XmlSchemaObject schemaType,
                                                   List<CorbaTypeMap> typeMaps,
                                                   ServiceInfo serviceInfo) {
         Exception exceptType = (Exception)obj.getType();
         List<MemberType> exceptMembers = exceptType.getMember();
-
+        XmlSchemaComplexType ctype = (XmlSchemaComplexType) schemaType;
+        QName qname = name;
+        if (ctype.getQName() != null) {
+            qname = ctype.getQName();
+        }
+        String nsURI = getNamespaceURI(serviceInfo, qname);
+        XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
         for (int i = 0; i < exceptMembers.size(); ++i) {
             MemberType member = exceptMembers.get(i);
-            QName memberName = new QName(name.getNamespaceURI(), member.getName());
+            QName memberName = new QName(nsURI, member.getName());
             QName memberType = member.getIdltype();
-            CorbaObjectHandler memberObj = 
-                initializeObjectHandler(orb, memberName, memberType, typeMaps, serviceInfo);
+            CorbaObjectHandler memberObj = initializeObjectHandler(orb,
+                                                                   memberName,
+                                                                   memberType,
+                                                                   group.getItems().getItem(i),
+                                                                   typeMaps,
+                                                                   serviceInfo);
             ((CorbaExceptionHandler)obj).addMember(memberObj);
         }
     }
@@ -200,19 +215,16 @@
     public static void initializeSequenceHandler(ORB orb,
                                                  CorbaObjectHandler obj, 
                                                  QName name,
+                                                 XmlSchemaObject schemaType,
                                                  List<CorbaTypeMap> typeMaps,
                                                  ServiceInfo serviceInfo) {
         QName seqElementType = null;
         long seqBound = 0;
         CorbaTypeImpl baseType = obj.getType();
-        XmlSchemaType schemaType = CorbaUtils.getXmlSchemaType(serviceInfo, baseType.getType());
-        String elName = name.getLocalPart();
-        if ((schemaType != null) && (schemaType instanceof XmlSchemaComplexType)) {
-            XmlSchemaSequence seq = (XmlSchemaSequence) ((XmlSchemaComplexType) schemaType).getParticle();
-            XmlSchemaObjectCollection col = seq.getItems();
-            if (col.getCount() > 0) {
-                elName = ((XmlSchemaElement) col.getItem(0)).getName();
-            }       
+        XmlSchemaElement el = CorbaHandlerUtils.getXmlSchemaSequenceElement(schemaType, serviceInfo);
+        QName elementName = el.getQName();
+        if (!CorbaUtils.isElementFormQualified(serviceInfo, name.getNamespaceURI())) {
+            elementName = new QName("", elementName.getLocalPart());
         }
         if (baseType instanceof Sequence) {
             Sequence seqType = (Sequence)baseType;
@@ -226,13 +238,11 @@
         if (seqBound == 0) {
             // This is an unbounded sequence.  Store a 'template' object that we can use to create
             // new objects as needed
-            QName elementName = new QName(name.getNamespaceURI(), elName);
             CorbaObjectHandler elementObj = 
                 initializeObjectHandler(orb, elementName, seqElementType, typeMaps, serviceInfo);
             ((CorbaSequenceHandler)obj).setTemplateElement(elementObj);
         }
         for (int i = 0; i < seqBound; ++i) {
-            QName elementName = new QName(name.getNamespaceURI(), elName);
             CorbaObjectHandler elementObj = 
                 initializeObjectHandler(orb, elementName, seqElementType, typeMaps, serviceInfo);
             ((CorbaSequenceHandler)obj).addElement(elementObj);
@@ -242,17 +252,59 @@
     public static void initializeStructHandler(ORB orb,
                                                CorbaObjectHandler obj, 
                                                QName name,
+                                               XmlSchemaObject schemaType,
                                                List<CorbaTypeMap> typeMaps,
                                                ServiceInfo serviceInfo) {
         Struct structType = (Struct)obj.getType();
         List<MemberType> structMembers = structType.getMember();
 
+        XmlSchemaObjectCollection attrs = null;
+        XmlSchemaObjectCollection members = null;
+            
+        XmlSchemaObject stype = schemaType;
+        QName qname = name;
+        if (schemaType instanceof XmlSchemaElement) {
+            XmlSchemaElement el = (XmlSchemaElement) schemaType;
+            if (el.getQName() != null) {
+                qname = el.getQName();
+            }
+            stype = el.getSchemaType();
+            if (stype == null) {
+                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+            }
+        }
+        if (stype instanceof XmlSchemaComplexType) {
+            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
+            if (ctype.getQName() != null) {
+                qname = ctype.getQName();
+            }
+            attrs = ctype.getAttributes();
+            stype = ctype.getParticle();
+        }
+        if (stype instanceof XmlSchemaGroupRef) {
+            members = ((XmlSchemaGroupRef) stype).getParticle().getItems();
+        } else if (stype instanceof XmlSchemaGroupBase) {
+            members = ((XmlSchemaGroupBase) stype).getItems();
+        }
+        String nsURI = getNamespaceURI(serviceInfo, qname);
+        int attrCount = 0;
+        int memberCount = 0;
         for (int i = 0; i < structMembers.size(); ++i) {
+            XmlSchemaObject schemaObj;
+            if ((attrs != null) && (attrCount != attrs.getCount())) {
+                schemaObj = attrs.getItem(attrCount++);
+            } else {
+                schemaObj = members.getItem(memberCount++);
+            }
             MemberType member = structMembers.get(i);
-            QName memberName = new QName(name.getNamespaceURI(), member.getName());
+            QName memberName = new QName(nsURI, member.getName());
             QName memberType = member.getIdltype();
-            CorbaObjectHandler memberObj = 
-                initializeObjectHandler(orb, memberName, memberType, typeMaps, serviceInfo);           
+            CorbaObjectHandler memberObj = initializeObjectHandler(orb,
+                                                                   memberName,
+                                                                   memberType,
+                                                                   schemaObj,
+                                                                   typeMaps,
+                                                                   serviceInfo);           
             ((CorbaStructHandler)obj).addMember(memberObj);
         }
     }
@@ -260,6 +312,7 @@
     public static void initializeUnionHandler(ORB orb,
                                               CorbaObjectHandler obj, 
                                               QName name,
+                                              XmlSchemaObject schemaType,
                                               List<CorbaTypeMap> typeMaps,
                                               ServiceInfo serviceInfo) {
         Union unionType = (Union)obj.getType();
@@ -270,15 +323,39 @@
                                                              typeMaps,
                                                              serviceInfo);
         ((CorbaUnionHandler)obj).setDiscriminator(discObj);
-        
+        boolean isAttr = false;
+        boolean isElementNil = false;
+        XmlSchemaObject stype = schemaType;
+        QName qname = name;
+        if (schemaType instanceof XmlSchemaAttribute) {
+            XmlSchemaAttribute attr = (XmlSchemaAttribute) schemaType;
+            if (attr.getQName() != null) {
+                qname = attr.getQName();
+            }
+            isAttr = true;
+        } else if (schemaType instanceof XmlSchemaElement) {
+            XmlSchemaElement el = (XmlSchemaElement) schemaType;
+            if (el.isNillable()) {
+                //should not write the start Element.
+                isElementNil = true;
+            }
+            if (el.getQName() != null) {
+                qname = el.getQName();
+            }
+            stype = el.getSchemaType();
+            if (stype == null) {
+                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+            }
+        }
+        String nsURI = getNamespaceURI(serviceInfo, qname);
         // Now handle all of the branches
         List<Unionbranch> unionBranches = unionType.getUnionbranch();
         for (Iterator<Unionbranch> iter = unionBranches.iterator(); iter.hasNext();) {
             Unionbranch branch = iter.next();
-            QName branchName = new QName(name.getNamespaceURI(), branch.getName());
+            QName branchName = new QName(nsURI, branch.getName());
             QName branchIdlType = branch.getIdltype();
             CorbaObjectHandler branchObj = 
-                initializeObjectHandler(orb, branchName, branchIdlType, typeMaps, serviceInfo);
+                initializeObjectHandler(orb, branchName, branchIdlType, stype, typeMaps, serviceInfo);
             ((CorbaUnionHandler)obj).addCase(branchObj);
         }
     }
@@ -286,41 +363,32 @@
     //Change this method to access the XmlSchemaCollection.
     public static String getNamespaceURI(ServiceInfo serviceInfo, QName typeName) {
         String nsUri = "";
-        if (typeName != null) {
-            SchemaInfo schemaInfo = serviceInfo.getSchema(typeName.getNamespaceURI());
-            if (schemaInfo == null) {
-                if (isElementFormQualified(serviceInfo, typeName.getNamespaceURI())) {
-                    nsUri = typeName.getNamespaceURI();
-                }
-            } else if (schemaInfo.isElementFormQualified()) {
-                nsUri = typeName.getNamespaceURI();
-            }
+        if ((typeName != null)
+            && (CorbaUtils.isElementFormQualified(serviceInfo, typeName.getNamespaceURI()))) {
+            nsUri = typeName.getNamespaceURI();
         }
         return nsUri;
     }
 
-    //Change this method to access the XmlSchemaCollection.
-    private static boolean isElementFormQualified(ServiceInfo serviceInfo, String uri) {
-        Iterator<SchemaInfo> it = serviceInfo.getSchemas().iterator();
-        while (it.hasNext()) {
-            XmlSchema schema = it.next().getSchema();
-            return isElementFormQualified(schema, uri);
+    public static XmlSchemaElement getXmlSchemaSequenceElement(XmlSchemaObject schemaType,
+                                                               ServiceInfo serviceInfo) {
+        XmlSchemaObject stype = schemaType;
+        XmlSchemaElement el = null;
+        if (schemaType instanceof XmlSchemaElement) {
+            stype = ((XmlSchemaElement) schemaType).getSchemaType();
+            if (stype == null) {
+                stype = CorbaUtils.getXmlSchemaType(serviceInfo, el.getRefName());
+            }
         }
-        return false;
-    }
-
-    //Change this method to access the XmlSchemaCollection.
-    private static boolean isElementFormQualified(XmlSchema schema, String uri) {
-        if (uri.equals(schema.getTargetNamespace())) {
-            return schema.getElementFormDefault().getValue().equals(XmlSchemaForm.QUALIFIED);
-        }
-        Iterator it = schema.getIncludes().getIterator();
-        while (it.hasNext()) {
-            XmlSchemaExternal extSchema = (XmlSchemaExternal) it.next();
-            return isElementFormQualified(extSchema.getSchema(), uri);
+        
+        if (stype instanceof XmlSchemaComplexType) {
+            //only one element inside the XmlSchemaComplexType
+            XmlSchemaComplexType ctype = (XmlSchemaComplexType) stype;
+            XmlSchemaGroupBase group = (XmlSchemaGroupBase) ctype.getParticle();
+            el = (XmlSchemaElement) group.getItems().getItem(0);
+        } else {
+            el = (XmlSchemaElement) schemaType;
         }
-        return false;
+        return el;
     }
-
-
 }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaObjectHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaObjectHandler.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaObjectHandler.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaObjectHandler.java Tue Jan 30 12:02:39 2007
@@ -20,7 +20,6 @@
 
 import javax.xml.namespace.QName;
 
-//import org.apache.schemas.yoko.bindings.corba.NamedType;
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 import org.omg.CORBA.TCKind;
@@ -33,8 +32,8 @@
     protected QName name;
     protected QName idlType;
     protected TypeCode typeCode;
-    //protected NamedType type;
     protected CorbaTypeImpl type;
+
     public CorbaObjectHandler() {
     }
     
@@ -42,7 +41,6 @@
         name = objName;
         idlType = objIdlType;
         typeCode = objTC;
-//        type = (NamedType)objType;
         type = (CorbaTypeImpl)objType;
     }
     
@@ -66,7 +64,6 @@
         return typeCode.kind();
     }
     
-//    public NamedType getType() {
     public CorbaTypeImpl getType() {
         return type;
     }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandler.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandler.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandler.java Tue Jan 30 12:02:39 2007
@@ -35,7 +35,12 @@
         return value;
     }
     
-    public String getValueData() {
+    
+    public void setValue(Object obj) {
+        value = obj;
+    }
+
+    public String getDataFromValue() {
         String data = "";
 
         switch (this.typeCode.kind().value()) {
@@ -86,10 +91,6 @@
         }
         
         return data;
-    }
-    
-    public void setValue(Object obj) {
-        value = obj;
     }
     
     public void setValueFromData(String data) {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionHandler.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionHandler.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaUnionHandler.java Tue Jan 30 12:02:39 2007
@@ -81,7 +81,7 @@
             result = enumHandler.getValue();
         } else {
             CorbaPrimitiveHandler primitiveHandler = (CorbaPrimitiveHandler)discriminator;
-            result = primitiveHandler.getValueData();
+            result = primitiveHandler.getDataFromValue();
         }
         return result;        
     }
@@ -143,7 +143,7 @@
         //   - character
         //   - enumeration
         // So when we need to create a default discriminator to accomodate for the lack of a 
-        // discriminator in the Celtix object, these are the four cases we must check for.
+        // discriminator from, these are the four cases we must check for.
         if (discriminator.getTypeCodeKind().value() == TCKind._tk_boolean) {
             // We can only have a default case with a boolean discriminator if we have
             // only one case, either TRUE or FALSE.  Therefore, we only need to check

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaObjectReaderTest.java Tue Jan 30 12:02:39 2007
@@ -285,7 +285,7 @@
         reader.readArray(obj);
         int length = obj.getElements().size();
         for (int i = 0; i < length; ++i) {
-            assertTrue(new Long(((CorbaPrimitiveHandler)obj.getElement(i)).getValueData()).intValue() 
+            assertTrue(new Long(((CorbaPrimitiveHandler)obj.getElement(i)).getDataFromValue()).intValue() 
                        == data[i]); 
         }
     }
@@ -325,7 +325,7 @@
         reader.readSequence(obj);
         int length = obj.getElements().size();
         for (int i = 0; i < length; ++i) {
-            assertTrue(((CorbaPrimitiveHandler)obj.getElement(i)).getValueData().equals(data[i]));
+            assertTrue(((CorbaPrimitiveHandler)obj.getElement(i)).getDataFromValue().equals(data[i]));
         }
     }
     
@@ -389,10 +389,10 @@
         reader.readStruct(obj);
         
         List<CorbaObjectHandler> nestedObjs = obj.getMembers();
-        assertTrue(new Integer(((CorbaPrimitiveHandler)nestedObjs.get(0)).getValueData()).intValue() 
+        assertTrue(new Integer(((CorbaPrimitiveHandler)nestedObjs.get(0)).getDataFromValue()).intValue() 
                    == member1);
-        assertTrue(((CorbaPrimitiveHandler)nestedObjs.get(1)).getValueData().equals(member2));
-        assertTrue(new Boolean(((CorbaPrimitiveHandler)nestedObjs.get(2)).getValueData()).booleanValue()
+        assertTrue(((CorbaPrimitiveHandler)nestedObjs.get(1)).getDataFromValue().equals(member2));
+        assertTrue(new Boolean(((CorbaPrimitiveHandler)nestedObjs.get(2)).getDataFromValue()).booleanValue()
                    == member3);
     }
   
@@ -446,8 +446,8 @@
         reader.readException(obj);
         
         List<CorbaObjectHandler> nestedObjs = obj.getMembers();
-        assertTrue(new Short(((CorbaPrimitiveHandler)nestedObjs.get(0)).getValueData()).shortValue() == code);
-        assertTrue(((CorbaPrimitiveHandler)nestedObjs.get(1)).getValueData().equals(message));
+        assertTrue(new Short(((CorbaPrimitiveHandler)nestedObjs.get(0)).getDataFromValue()).shortValue() == code);
+        assertTrue(((CorbaPrimitiveHandler)nestedObjs.get(1)).getDataFromValue().equals(message));
     } 
     
     public void testReadEnum() {

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaStaxObjectTest.java Tue Jan 30 12:02:39 2007
@@ -178,7 +178,7 @@
         assertTrue(resultObj.getName().equals(obj.getName()));
         assertTrue(resultObj.getIdlType().equals(obj.getIdlType()));
         assertTrue(resultObj.getTypeCode().equal(obj.getTypeCode()));
-        assertTrue(resultObj.getValueData().equals(obj.getValueData()));
+        assertTrue(resultObj.getDataFromValue().equals(obj.getDataFromValue()));
     }
     
     public void testReadWriteStaxArray() {
@@ -255,7 +255,7 @@
             assertTrue(resultElements.get(i) instanceof CorbaPrimitiveHandler);
             CorbaPrimitiveHandler resultEl = (CorbaPrimitiveHandler)resultElements.get(i);
             CorbaPrimitiveHandler objEl = (CorbaPrimitiveHandler)objElements.get(i);
-            assertTrue(resultEl.getValueData().equals(objEl.getValueData()));
+            assertTrue(resultEl.getDataFromValue().equals(objEl.getDataFromValue()));
         }
     }
     
@@ -448,7 +448,7 @@
             assertTrue(resultElements.get(i) instanceof CorbaPrimitiveHandler);
             CorbaPrimitiveHandler resultEl = (CorbaPrimitiveHandler)resultElements.get(i);
             CorbaPrimitiveHandler objEl = (CorbaPrimitiveHandler)objElements.get(i);
-            assertTrue(resultEl.getValueData().equals(objEl.getValueData()));
+            assertTrue(resultEl.getDataFromValue().equals(objEl.getDataFromValue()));
         }
     }
 

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaTypeTest.java Tue Jan 30 12:02:39 2007
@@ -76,14 +76,7 @@
     public void testHexBinary() throws Exception  {
     }
 
-    public void testStructWithNillables() throws Exception  {
-    }
-
     public void testEmptyChoice() throws Exception {
-    }
-
-    public void testSimpleAll() throws Exception {
-        //super.testSimpleAll();
     }
 
     public void testSimpleChoice() throws Exception {

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java?view=diff&rev=501533&r1=501532&r2=501533
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaPrimitiveHandlerTest.java Tue Jan 30 12:02:39 2007
@@ -68,7 +68,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
         
         obj.setValue(val);
@@ -91,7 +91,7 @@
         // Yoko maps the XML char type to a Byte so we need to provide the string data as a Byte value
         Byte byteValue = new Byte((byte)val.charValue());
         obj.setValueFromData(byteValue.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         Byte byteResult = new Byte(result);
         assertTrue(byteResult.byteValue() == byteValue.byteValue());
 
@@ -116,7 +116,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData("w");
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.charValue() == result.charAt(0));
 
         obj.setValue(val);
@@ -137,7 +137,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -158,7 +158,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -179,7 +179,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -200,7 +200,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -221,7 +221,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -242,7 +242,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -263,7 +263,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -284,7 +284,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -305,7 +305,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.toString().equals(result));
 
         obj.setValue(val);
@@ -326,7 +326,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.equals(result));
 
         obj.setValue(val);
@@ -347,7 +347,7 @@
         assertNotNull(obj);
         
         obj.setValueFromData(val.toString());
-        String result = obj.getValueData();
+        String result = obj.getDataFromValue();
         assertTrue(val.equals(result));
 
         obj.setValue(val);



Mime
View raw message