incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r467425 [1/2] - in /incubator/yoko/branches/cxf_port: api/src/main/java/org/apache/yoko/wsdl/ bindings/src/main/java/org/apache/yoko/bindings/corba2/ bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/ bindings/src/main/jav...
Date Tue, 24 Oct 2006 18:11:35 GMT
Author: bravi
Date: Tue Oct 24 11:11:34 2006
New Revision: 467425

URL: http://svn.apache.org/viewvc?view=rev&rev=467425
Log:
[YOKO-170] - Updates to bindings module in the cxf_port branch to use the cxf based interceptor approach.

Added:
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaArrayHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaEnumHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaExceptionHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaFixedHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaHandlerUtils.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaObjectHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaPrimitiveHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaSequenceHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaStructHandler.java   (with props)
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaUnionHandler.java   (with props)
Modified:
    incubator/yoko/branches/cxf_port/api/src/main/java/org/apache/yoko/wsdl/CorbaConstants.java
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
    incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java

Modified: incubator/yoko/branches/cxf_port/api/src/main/java/org/apache/yoko/wsdl/CorbaConstants.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/api/src/main/java/org/apache/yoko/wsdl/CorbaConstants.java?view=diff&rev=467425&r1=467424&r2=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/api/src/main/java/org/apache/yoko/wsdl/CorbaConstants.java (original)
+++ incubator/yoko/branches/cxf_port/api/src/main/java/org/apache/yoko/wsdl/CorbaConstants.java Tue Oct 24 11:11:34 2006
@@ -101,6 +101,7 @@
     String SERVICE_ID = "serviceid";    
     String BASES = "bases";
     String CORBA_ENDPOINT_OBJECT = "endpoint";
+    String ORB = "orb";
 
     String getValue(String value);
 

Modified: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java?view=diff&rev=467425&r1=467424&r2=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java (original)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaConduit.java Tue Oct 24 11:11:34 2006
@@ -44,14 +44,9 @@
     private MessageObserver incomingObserver;
     private ORB orb;
 
-
     public CorbaConduit(EndpointInfo ei, EndpointReferenceType ref) {
         endpointInfo = ei;
         target = getTargetReference(ref);
-    }
-
-    public void send(Message message) throws IOException {
-        System.out.println("send message...");
         // TODO: Set any additional properties needed to initialize the ORB  before
         // we initialize it. We will get this information from the Celtix configuration 
         // that is used with the current application.
@@ -66,7 +61,10 @@
             LOG.severe("Could not create instance of the ORB");
             throw new CorbaBindingException("Could not create instance of the ORB");
         }
+    }
 
+    public void send(Message message) throws IOException {
+        System.out.println("send message...");
         try {
             AddressType address = endpointInfo.getExtensor(AddressType.class);
 
@@ -75,7 +73,8 @@
                 throw new CorbaBindingException("Unable to locate a valid CORBA address");
             }            
             org.omg.CORBA.Object targetObject = CorbaUtils.importObjectReference(orb, address.getLocation());
-            message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject);
+            message.put(CorbaConstants.ORB, orb);
+            message.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, targetObject);            
         } catch (java.lang.Exception ex) {
             LOG.log(Level.SEVERE, "Could not resolve target object");
             throw new CorbaBindingException(ex);

Modified: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java?view=diff&rev=467425&r1=467424&r2=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java (original)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaMessage.java Tue Oct 24 11:11:34 2006
@@ -27,4 +27,8 @@
     public CorbaMessage(Message m) {
         super(m);
     }
+
+    public void addStreamableArgument(CorbaStreamable arg) {
+        
+    }
 }

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java Tue Oct 24 11:11:34 2006
@@ -0,0 +1,426 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yoko.bindings.corba2;
+
+import java.lang.reflect.Constructor;
+import java.math.BigInteger;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.common.logging.LogUtils;
+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.Union;
+import org.apache.schemas.yoko.bindings.corba.Unionbranch;
+import org.apache.yoko.bindings.corba2.types.CorbaAnyHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaArrayHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaEnumHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaExceptionHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaFixedHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaObjectHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaPrimitiveHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaSequenceHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaStructHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaUnionHandler;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+
+public class CorbaObjectReader {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaObjectReader.class);
+
+    private InputStream stream;
+
+    public CorbaObjectReader(InputStream inStream) {
+        stream = inStream;
+    }
+
+    public void read(CorbaObjectHandler obj) throws CorbaBindingException {
+        switch (obj.getTypeCode().kind().value()) {
+        case TCKind._tk_boolean:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readBoolean());
+            break;
+        case TCKind._tk_char:
+            Character charValue = this.readChar();
+            ((CorbaPrimitiveHandler)obj).setValue(charValue);
+            break;
+        case TCKind._tk_wchar:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readWChar());
+            break;
+        case TCKind._tk_octet:
+            Byte octetValue = this.readOctet();
+            ((CorbaPrimitiveHandler)obj).setValue(octetValue);
+            break;
+        case TCKind._tk_short:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readShort());
+            break;
+        case TCKind._tk_ushort:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readUShort());
+            break;
+        case TCKind._tk_long:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readLong());
+            break;
+        case TCKind._tk_ulong:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readULong());
+            break;
+        case TCKind._tk_longlong:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readLongLong());
+            break;
+        case TCKind._tk_ulonglong:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readULongLong());
+            break;
+        case TCKind._tk_float:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readFloat());
+            break;
+        case TCKind._tk_double:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readDouble());
+            break;
+        case TCKind._tk_string:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readString());
+            break;
+        case TCKind._tk_wstring:
+            ((CorbaPrimitiveHandler)obj).setValue(this.readWString());
+            break;
+        case TCKind._tk_any:
+            ((CorbaAnyHandler)obj).setValue(this.readAny());
+            break;
+        
+        // Now for the complex types
+        case TCKind._tk_array:
+            this.readArray(obj);
+            break;
+        case TCKind._tk_sequence:
+            this.readSequence(obj);
+            break;
+        case TCKind._tk_struct:
+            this.readStruct(obj);
+            break;
+        case TCKind._tk_enum:
+            this.readEnum(obj);
+            break;
+        case TCKind._tk_except:
+            this.readException(obj);
+            break;
+        case TCKind._tk_fixed:
+            this.readFixed(obj);
+            break;
+        case TCKind._tk_union:
+            this.readUnion(obj);
+            break;
+        default:
+        // TODO: Provide Implementation. Do we throw an exception.
+        }
+    }
+
+    // -- primitive types --
+    public Boolean readBoolean() throws CorbaBindingException {
+        try {
+            return new Boolean(stream.read_boolean());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read boolean");
+            throw new CorbaBindingException("CorbaObjectReader: readBoolean MARSHAL exception", ex);
+        }
+    }
+
+    public Character readChar() throws CorbaBindingException {
+        try {
+            return new Character(stream.read_char());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read character");
+            throw new CorbaBindingException("CorbaObjectReader: readChar MARSHAL exception", ex);
+        }
+    }
+
+    public Character readWChar() throws CorbaBindingException {
+        try {
+            return new Character(stream.read_wchar());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read wide character");
+            throw new CorbaBindingException("CorbaObjectReader: readWChar MARSHAL exception", ex);
+        }
+    }
+
+    public Byte readOctet() throws CorbaBindingException {
+        try {
+            return new Byte(stream.read_octet());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read octet");
+            throw new CorbaBindingException("CorbaObjectReader: readOctet MARSHAL exception", ex);
+        }
+    }
+
+    public Short readShort() throws CorbaBindingException {
+        try {
+            return new Short(stream.read_short());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read short");
+            throw new CorbaBindingException("CorbaObjectReader: readShort MARSHAL exception", ex);
+        }
+    }
+
+    public Short readUShort() throws CorbaBindingException {
+        try {
+            return new Short(stream.read_ushort());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read unsigned short");
+            throw new CorbaBindingException("CorbaObjectReader: readUShort MARSHAL exception", ex);
+        }
+    }
+
+    public Long readLong() throws CorbaBindingException {
+        try {
+            return new Long(stream.read_long());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read long");
+            throw new CorbaBindingException("CorbaObjectReader: readLong MARSHAL exception", ex);
+        }
+    }
+
+    public BigInteger readULong() throws CorbaBindingException {
+        try {
+            return new BigInteger(stream.read_ulong() + "");
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read unsigned long");
+            throw new CorbaBindingException("CorbaObjectReader: readULong MARSHAL exception", ex);
+        }
+    }
+
+    public BigInteger readLongLong() throws CorbaBindingException {
+        try {
+            return new BigInteger(stream.read_longlong() + "");
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read long long");
+            throw new CorbaBindingException("CorbaObjectReader: readLongLong MARSHAL exception", ex);
+        }
+    }
+
+    public BigInteger readULongLong() throws CorbaBindingException {
+        try {
+            return new BigInteger(stream.read_ulonglong() + "");
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read unsigned long long");
+            throw new CorbaBindingException("CorbaObjectReader: readULongLong MARSHAL exception", ex);
+        }
+    }
+
+    public Float readFloat() throws CorbaBindingException {
+        try {
+            return new Float(stream.read_float());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read float");
+            throw new CorbaBindingException("CorbaObjectReader: readFloat MARSHAL exception", ex);
+        }
+    }
+
+    public Double readDouble() throws CorbaBindingException {
+        try {
+            return new Double(stream.read_double());
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read double");
+            throw new CorbaBindingException("CorbaObjectReader: readDouble MARSHAL exception", ex);
+        }
+    }
+
+    public String readString() throws CorbaBindingException {
+        try {
+            return stream.read_string();
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read string");
+            throw new CorbaBindingException("CorbaObjectReader: readString MARSHAL exception", ex);
+        }
+    }
+
+    public String readWString() throws CorbaBindingException {
+        try {
+            return stream.read_wstring();
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read wide string");
+            throw new CorbaBindingException("CorbaObjectReader: readWString MARSHAL exception", ex);
+        }
+    }
+
+    public Any readAny() throws CorbaBindingException {
+        try {
+            return stream.read_any();
+        } catch (org.omg.CORBA.MARSHAL ex) {
+            LOG.log(Level.SEVERE, "CorbaObjectReader: could not read any");
+            throw new CorbaBindingException("CorbaObjectReader: readAny MARSHAL exception", ex);
+        }
+    }
+
+    // -- complex types --
+    public void readEnum(CorbaObjectHandler obj) throws CorbaBindingException {
+        int enumIndex = stream.read_long();
+        Enum enumType = (Enum) obj.getType();
+        List<Enumerator> enumerators = enumType.getEnumerator();
+
+        CorbaEnumHandler enumObj = (CorbaEnumHandler)obj;
+        enumObj.setValue(enumerators.get(enumIndex).getValue());
+    }
+
+    public void readStruct(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaStructHandler structObj = (CorbaStructHandler)obj;
+        List<CorbaObjectHandler> structMembers = structObj.getMembers();
+
+        for (int i = 0; i < structMembers.size(); ++i) {
+            this.read(structMembers.get(i));
+        }
+    }
+
+    public void readException(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaExceptionHandler exceptObj = (CorbaExceptionHandler)obj;
+        List<CorbaObjectHandler> exceptElements = exceptObj.getMembers();
+
+        String exceptId = stream.read_string();
+        exceptObj.setId(exceptId);
+
+        for (int i = 0; i < exceptElements.size(); ++i) {
+            this.read(exceptElements.get(i));
+        }
+    }
+
+    public void readFixed(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaFixedHandler fixedHandler = (CorbaFixedHandler)obj;
+        long scale = fixedHandler.getScale();
+        
+        java.math.BigDecimal fixedValue = stream.read_fixed().movePointLeft((int)scale);
+        fixedHandler.setValue(fixedValue);
+    }
+
+    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;        
+        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
+        
+        this.read(discriminator);
+        
+        String discLabel = null;
+        if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
+            discLabel = ((CorbaEnumHandler)discriminator).getValue();
+        } else {
+            discLabel = ((CorbaPrimitiveHandler)discriminator).getValueData();
+        }
+        
+        // Now find the label in the union to get the right case
+        Union unionType = (Union)unionHandler.getType();
+        List<Unionbranch> branches = unionType.getUnionbranch();
+        Unionbranch defaultBranch = null;
+        boolean caseFound = false;
+        for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
+            Unionbranch branch = branchIter.next();
+            if (branch.isSetDefault() && branch.isDefault()) {
+                defaultBranch = branch;
+            }
+            List<CaseType> cases = branch.getCase();
+            for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
+                CaseType c = caseIter.next();
+                if (c.getLabel().equals(discLabel)) {
+                    CorbaObjectHandler branchObj = unionHandler.getBranchByName(branch.getName());
+                    this.read(branchObj);
+                    unionHandler.setValue(branch.getName(), branchObj);
+                    caseFound = true;
+                    break;
+                }
+            }
+            if (caseFound) {
+                break;
+            }
+        }
+        
+        // If we never find a case that matches the value of the discriminiator, then we must have
+        // found the default case.
+        if (!caseFound && defaultBranch != null) {
+            CorbaObjectHandler branchObj = unionHandler.getBranchByName(defaultBranch.getName());
+            this.read(branchObj);
+            unionHandler.setValue(defaultBranch.getName(), branchObj);
+        }
+    }
+
+    public void readArray(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaArrayHandler arrayObj = (CorbaArrayHandler)obj;
+        List<CorbaObjectHandler> arrayElements = arrayObj.getElements();
+
+        for (int i = 0; i < arrayElements.size(); ++i) {
+            this.read(arrayElements.get(i));
+        }
+    }
+
+    public void readSequence(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaSequenceHandler sequenceObj = (CorbaSequenceHandler)obj;
+        List<CorbaObjectHandler> seqElements = sequenceObj.getElements();
+
+        int length = stream.read_ulong();
+        
+        if (seqElements.size() == 0) {
+            // No predefined elements means an unbounded sequence.  Use the template element
+            // to construct each object that is in the input stream.
+            CorbaObjectHandler template = sequenceObj.getTemplateElement();
+            Class<?> templateClass = template.getClass();
+            // we know that we are after the 4 parameter version of the constructor
+            Class[] paramClasses = new Class[4];
+            Object[] params = new Object[4];
+            paramClasses[0] = QName.class;
+            params[0] = template.getName();
+            paramClasses[1] = QName.class;
+            params[1] = template.getIdlType();
+            paramClasses[2] = TypeCode.class;
+            params[2] = template.getTypeCode();
+            paramClasses[3] = Object.class;
+            params[3] = template.getType();
+            Constructor templateConstructor = null;
+            try {
+                templateConstructor = templateClass.getConstructor(paramClasses);
+                
+            } catch (java.lang.NoSuchMethodException ex) {
+                throw new CorbaBindingException("Exception while reading unbounded sequence", ex);
+            }
+           
+            for (int i = 0; i < length; ++i) {
+                CorbaObjectHandler seqElement = null;
+                try {
+                    seqElement = (CorbaObjectHandler)templateConstructor.newInstance(params);
+                    // A special case arises if we have a unbounded sequence of unbounded sequences.  We 
+                    // need to obtain the template object so that all nested unbounded sequences can be 
+                    // correctly constructed.
+                    if (template instanceof CorbaSequenceHandler) {
+                        CorbaSequenceHandler templateSeq = (CorbaSequenceHandler)template;
+                        ((CorbaSequenceHandler)seqElement).
+                            setTemplateElement(templateSeq.getTemplateElement());
+                    }
+                } catch (java.lang.Exception ex) {
+                    throw new CorbaBindingException("Unable to instantiate sequence element", ex);
+                }                    
+                this.read(seqElement);
+                sequenceObj.addElement(seqElement);
+            }
+        } else {
+            // We have a bounded sequence and the object should already be pre-built
+            for (int i = 0; i < length; ++i) {
+                this.read(seqElements.get(i));
+            }
+        }
+    }
+}

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectReader.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java Tue Oct 24 11:11:34 2006
@@ -0,0 +1,258 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yoko.bindings.corba2;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.apache.schemas.yoko.bindings.corba.Enum;
+import org.apache.schemas.yoko.bindings.corba.Enumerator;
+import org.apache.schemas.yoko.bindings.corba.Exception;
+import org.apache.yoko.bindings.corba2.types.CorbaAnyHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaArrayHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaEnumHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaExceptionHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaFixedHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaObjectHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaPrimitiveHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaSequenceHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaStructHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaUnionHandler;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.portable.OutputStream;
+
+public class CorbaObjectWriter {
+
+    private OutputStream stream;
+
+    public CorbaObjectWriter(OutputStream outStream) {
+        stream = outStream;
+    }
+
+    public void write(CorbaObjectHandler obj) {
+        assert obj != null;
+        
+        switch (obj.getTypeCode().kind().value()) {
+        case TCKind._tk_boolean:
+            this.writeBoolean((Boolean)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_char:
+            this.writeChar((Character)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_wchar:
+            this.writeWChar((Character)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_octet:
+            this.writeOctet((Byte)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_short:
+            this.writeShort((Short)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_ushort:
+            this.writeUShort((Short)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_long:
+            this.writeLong((Long)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_ulong:
+            this.writeULong((BigInteger)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_longlong:
+            this.writeLongLong((BigInteger)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_ulonglong:
+            this.writeULongLong((BigInteger)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_float:
+            this.writeFloat((Float)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_double:
+            this.writeDouble((Double)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_string:
+            this.writeString((String)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_wstring:
+            this.writeWString((String)((CorbaPrimitiveHandler)obj).getValue());
+            break;
+        case TCKind._tk_any:
+            this.writeAny(((CorbaAnyHandler)obj).getValue());
+            break;
+
+        // Now for the complex types
+        case TCKind._tk_array:
+            this.writeArray(obj);
+            break;
+        case TCKind._tk_sequence:
+            this.writeSequence(obj);
+            break;
+        case TCKind._tk_struct:
+            this.writeStruct(obj);
+            break;
+        case TCKind._tk_enum:
+            this.writeEnum(obj);
+            break;
+        case TCKind._tk_except:
+            this.writeException(obj);
+            break;
+        case TCKind._tk_fixed:
+            this.writeFixed(obj);
+            break;
+        case TCKind._tk_union:
+            this.writeUnion(obj);
+            break;
+        default:
+        // TODO: Provide Implementation. Do we throw an exception.
+        }
+    }
+
+    // -- primitive types --
+    public void writeBoolean(Boolean b) throws CorbaBindingException {
+        stream.write_boolean(b.booleanValue());
+    }
+
+    public void writeChar(Character c) throws CorbaBindingException {
+        stream.write_char(c.charValue());
+    }
+
+    public void writeWChar(Character c) throws CorbaBindingException {
+        stream.write_wchar(c.charValue());
+    }
+
+    public void writeOctet(Byte b) throws CorbaBindingException {
+        stream.write_octet(b.byteValue());
+    }
+
+    public void writeShort(Short s) throws CorbaBindingException {
+        stream.write_short(s.shortValue());
+    }
+
+    public void writeUShort(Short s) throws CorbaBindingException {
+        stream.write_ushort(s.shortValue());
+    }
+
+    public void writeLong(Long l) throws CorbaBindingException {
+        stream.write_long((int) l.longValue());
+    }
+
+    public void writeULong(java.math.BigInteger l) throws CorbaBindingException {
+        stream.write_ulong((int) l.longValue());
+    }
+
+    public void writeLongLong(java.math.BigInteger l) throws CorbaBindingException {
+        stream.write_longlong(l.longValue());
+    }
+
+    public void writeULongLong(java.math.BigInteger l) throws CorbaBindingException {
+        stream.write_ulonglong(l.longValue());
+    }
+
+    public void writeFloat(Float f) throws CorbaBindingException {
+        stream.write_float(f.floatValue());
+    }
+
+    public void writeDouble(Double d) throws CorbaBindingException {
+        stream.write_double(d.doubleValue());
+    }
+
+    public void writeString(String s) throws CorbaBindingException {
+        stream.write_string(s);
+    }
+
+    public void writeWString(String s) throws CorbaBindingException {
+        stream.write_wstring(s);
+    }
+
+    public void writeAny(Any a) throws CorbaBindingException {
+        stream.write_any(a);
+    }
+
+    // -- complex types --
+    public void writeEnum(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaEnumHandler enumHandler = (CorbaEnumHandler)obj;
+        Enum enumType = (Enum)enumHandler.getType();
+        String enumLabel = enumHandler.getValue();
+        List<Enumerator> enumerators = enumType.getEnumerator();
+        
+        for (int i = 0; i < enumerators.size(); ++i) {
+            if (enumerators.get(i).getValue().equals(enumLabel)) {
+                stream.write_long(i);
+                return;
+            }
+        }
+        
+        throw new CorbaBindingException("CorbaObjectWriter: unable to find enumeration label");
+    }
+
+    public void writeStruct(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaStructHandler structHandler = (CorbaStructHandler)obj;
+        List<CorbaObjectHandler> structElements = structHandler.getMembers();
+
+        for (int i = 0; i < structElements.size(); ++i) {
+            this.write(structElements.get(i));
+        }
+    }
+
+    public void writeException(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaExceptionHandler exHandler = (CorbaExceptionHandler)obj;
+        Exception exType = (Exception)exHandler.getType();
+        List<CorbaObjectHandler> exMembers = exHandler.getMembers();
+    
+        stream.write_string(exType.getRepositoryID());
+        for (int i = 0; i < exMembers.size(); ++i) {
+            this.write(exMembers.get(i));
+        }
+    }
+
+    public void writeFixed(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaFixedHandler fixedHandler = (CorbaFixedHandler)obj;
+        long scale = fixedHandler.getScale();
+        stream.write_fixed(fixedHandler.getValue().movePointRight((int)scale));
+    }
+
+    public void writeUnion(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaObjectHandler discriminator = ((CorbaUnionHandler)obj).getDiscriminator();
+        this.write(discriminator);
+        CorbaObjectHandler unionValue = ((CorbaUnionHandler)obj).getValue();
+        this.write(unionValue);
+    }
+
+    public void writeArray(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaArrayHandler arrayHandler = (CorbaArrayHandler)obj;
+        List<CorbaObjectHandler> arrayElements = arrayHandler.getElements();
+
+        for (int i = 0; i < arrayElements.size(); ++i) {
+            this.write(arrayElements.get(i));
+        }
+    }
+
+    public void writeSequence(CorbaObjectHandler obj) throws CorbaBindingException {
+        CorbaSequenceHandler seqHandler = (CorbaSequenceHandler)obj;
+        List<CorbaObjectHandler> seqElements = seqHandler.getElements();
+        int length = seqElements.size();
+
+        stream.write_ulong(length);
+
+        for (int i = 0; i < length; ++i) {
+            this.write(seqElements.get(i));
+        }
+    }
+}

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaObjectWriter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java Tue Oct 24 11:11:34 2006
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yoko.bindings.corba2;
+
+import javax.xml.namespace.QName;
+
+import org.apache.yoko.bindings.corba2.types.CorbaObjectHandler;
+
+import org.omg.CORBA.TypeCode;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.Streamable;
+
+public class CorbaStreamable implements Streamable {
+
+    private CorbaObjectHandler value;
+    private QName name;
+    private int mode;
+    private TypeCode typecode;
+
+    public CorbaStreamable(CorbaObjectHandler obj, QName elName) {
+        value = obj;
+        name = elName;
+        typecode = obj.getTypeCode();
+
+        mode = org.omg.CORBA.ARG_OUT.value;
+    }
+
+    public void _read(InputStream istream) {
+        try {
+            CorbaObjectReader reader = new CorbaObjectReader(istream);
+            reader.read(value);
+        } catch (java.lang.Exception ex) {
+            throw new CorbaBindingException("Error reading streamable value", ex);
+        }
+    }
+
+    public void _write(OutputStream ostream) {
+        try {
+            CorbaObjectWriter writer = new CorbaObjectWriter(ostream);
+            writer.write(value);
+        } catch (java.lang.Exception ex) {
+            throw new CorbaBindingException("Error writing streamable value", ex);
+        }
+    }
+
+    public TypeCode _type() {
+        return typecode;
+    }
+
+    public CorbaObjectHandler getObject() {
+        return value;
+    }
+
+    public void setObject(CorbaObjectHandler obj) {
+        value = obj;
+    }
+
+    public int getMode() {
+        return mode;
+    }
+
+    public void setMode(int md) {
+        mode = md;
+    }
+
+    public String getName() {
+        return name.getLocalPart();
+    }
+}

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/CorbaStreamable.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java?view=diff&rev=467425&r1=467424&r2=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java (original)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/CorbaOutInterceptor.java Tue Oct 24 11:11:34 2006
@@ -19,29 +19,100 @@
 
 package org.apache.yoko.bindings.corba2.interceptors;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import javax.xml.stream.XMLEventFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLEventWriter;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.events.Attribute;
+import javax.xml.stream.events.Characters;
+import javax.xml.stream.events.EndElement;
+import javax.xml.stream.events.StartElement;
 
 import javax.xml.ws.Holder;
 
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.databinding.DataWriterFactory;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.service.model.ServiceModelUtil;
 
+import org.apache.schemas.yoko.bindings.corba.Anonarray;
+import org.apache.schemas.yoko.bindings.corba.Anonsequence;
+import org.apache.schemas.yoko.bindings.corba.Array;
+import org.apache.schemas.yoko.bindings.corba.CaseType;
+import org.apache.schemas.yoko.bindings.corba.Enum;
+import org.apache.schemas.yoko.bindings.corba.Exception;
+import org.apache.schemas.yoko.bindings.corba.MemberType;
 import org.apache.schemas.yoko.bindings.corba.ModeType;
 import org.apache.schemas.yoko.bindings.corba.OperationType;
 import org.apache.schemas.yoko.bindings.corba.ParamType;
+//import org.apache.schemas.yoko.bindings.corba.RaisesType;
+import org.apache.schemas.yoko.bindings.corba.Sequence;
+import org.apache.schemas.yoko.bindings.corba.Struct;
 import org.apache.schemas.yoko.bindings.corba.TypeMappingType;
+import org.apache.schemas.yoko.bindings.corba.Union;
+import org.apache.schemas.yoko.bindings.corba.Unionbranch;
 
+import org.apache.yoko.bindings.corba2.CorbaBindingException;
+import org.apache.yoko.bindings.corba2.CorbaMessage;
+//import org.apache.yoko.bindings.corba2.CorbaObjectReader;
+//import org.apache.yoko.bindings.corba2.CorbaObjectWriter;
+import org.apache.yoko.bindings.corba2.CorbaStreamable;
 import org.apache.yoko.bindings.corba2.CorbaTypeMap;
 import org.apache.yoko.bindings.corba2.CorbaUtils;
 
+import org.apache.yoko.bindings.corba2.types.CorbaAnyHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaArrayHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaEnumHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaExceptionHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaFixedHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaHandlerUtils;
+import org.apache.yoko.bindings.corba2.types.CorbaObjectHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaPrimitiveHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaSequenceHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaStructHandler;
+import org.apache.yoko.bindings.corba2.types.CorbaUnionHandler;
+
+import org.apache.yoko.wsdl.CorbaConstants;
+import org.apache.yoko.wsdl.CorbaTypeImpl;
+
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+
 public class CorbaOutInterceptor extends AbstractPhaseInterceptor<Message> {
 
-    List<CorbaTypeMap> typeMaps;
+    private static final Logger LOG = LogUtils.getL7dLogger(CorbaOutInterceptor.class);
+
+    private static final String XSI_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema-instance";
+    private static final String XSI_PREFIX = "xsi";
+    private static final String XMLSCHEMA_NAMESPACE_URI = "http://www.w3.org/2001/XMLSchema";
+    private static final String XMLSCHEMA_PREFIX = "xs";
+
+    private List<CorbaTypeMap> typeMaps;
+    private ORB orb;
+    private XMLOutputFactory xof;
+    private XMLInputFactory xif;
 
     public CorbaOutInterceptor() {
         super();
@@ -50,6 +121,9 @@
 
     public void handleMessage(Message message) {
         System.out.println("handleMessage() in CorbaOutInterceptor...");
+
+        orb = (ORB) message.get(CorbaConstants.ORB);
+
         Exchange exchange = message.getExchange();
 
         typeMaps = new ArrayList<CorbaTypeMap>();
@@ -58,30 +132,631 @@
         List<TypeMappingType> corbaTypes = service.getExtensors(TypeMappingType.class);
         CorbaUtils.createCorbaTypeMap(typeMaps, corbaTypes);
 
+        getXMLOutputFactory().setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
+
+        // TODO: where does encoding constant go?
+        String encoding = (String)message.get("Encoding");
+        DataWriter writer;
+        writer = getDataWriter(message);
+
         BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
         OperationType opType = boi.getExtensor(OperationType.class);
         System.out.println("Operation: " + opType.getName());
 
         // Handle the parameters that are given for the operation
         List<ParamType> paramTypes = opType.getParam();
-        addMarshalParams(message, paramTypes);
+        addMarshalParams(message,
+                         paramTypes,
+                         getXMLInputFactory(),
+                         getXMLOutputFactory(),
+                         writer);
+    }
+
+    private void addMarshalParams(Message message,
+                                  List<ParamType> params,
+                                  XMLInputFactory inputFactory,
+                                  XMLOutputFactory outputFactory,
+                                  DataWriter writer) {
+        try {
+            List<Object> args = message.getContent(List.class);
+
+            for (int i = 0; i < params.size(); i++) {
+                Object partValue;
+                ParamType param = params.get(i);
+                if (param.getMode() != ModeType.IN) {
+                    partValue = ((Holder)args.get(i)).value;
+                } else {
+                    partValue = args.get(i);
+                }
+                System.out.println("param name: " + param.getName()
+                                   + "-" + param.getMode().value()
+                                   + "-" + partValue);
+                QName elName = new QName("", param.getName());
+                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
+                writer.write(partValue, elName, evtWriter);
+                
+                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
+                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
+                QName idlType = param.getIdltype();
+                CorbaObjectHandler obj = null;
+                boolean skipRead = false;
+                if (!isRequestor(message)) {
+                    if (param.getMode().equals(ModeType.IN)) {
+                        skipRead = true;
+                    }
+                } else if (param.getMode().equals(ModeType.OUT)) {
+                    skipRead = true;
+                } 
+                if (skipRead) {
+                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps);
+                } else {
+                    obj = readObjectFromStax(evtReader, idlType, false);
+                }
+                CorbaStreamable streamable = new CorbaStreamable(obj, elName);
+                ModeType paramMode = param.getMode();
+                if (paramMode.value().equals("in")) {
+                    streamable.setMode(org.omg.CORBA.ARG_IN.value);
+                } else if (paramMode.value().equals("inout")) {
+                    streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
+                } else if (paramMode.value().equals("out")) {
+                    streamable.setMode(org.omg.CORBA.ARG_OUT.value);
+                }
+                ((CorbaMessage) message).addStreamableArgument(streamable);
+            }
+        } catch (java.lang.Exception ex) {
+            //throw a fault
+        }
+    }
+
+    public CorbaObjectHandler readObjectFromStax(XMLEventReader reader, QName idlType, boolean isNested)
+        throws CorbaBindingException {
+        CorbaObjectHandler obj = null;
+        // Find the first start element in the reader.  This should be the beginning of our object
+        try {
+            if (!isNested) {
+                while (reader.peek().getEventType() != XMLStreamConstants.START_ELEMENT) {
+                    reader.nextEvent();
+                }
+            }
+        } catch (XMLStreamException ex) {
+            throw new CorbaBindingException("Unable to locate start of object", ex);
+        }
+        
+        TypeCode tc = CorbaUtils.getTypeCode(orb, idlType, typeMaps);
+        if (CorbaUtils.isPrimitiveIdlType(idlType)) {
+            LOG.log(Level.INFO, "Reading primitive type from XML reader");
+            obj = readPrimitiveFromStax(reader, idlType, tc);
+        } else {
+            switch(tc.kind().value()) {
+            case TCKind._tk_array:
+                LOG.log(Level.INFO, "Reading array type from XML reader");
+                obj = readArrayFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_enum:
+                LOG.log(Level.INFO, "Reading enumeration type from XML reader");
+                obj = readEnumFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_except:
+                LOG.log(Level.INFO, "Reading exception type from XML reader");
+                obj = readExceptionFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_fixed:
+                LOG.log(Level.INFO, "Reading fixed type from XML reader");
+                obj = readFixedFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_sequence:
+                LOG.log(Level.INFO, "Reading sequence type from XML reader");
+                obj = readSequenceFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_string:
+            case TCKind._tk_wstring:
+                // These will be the case if we have anonymous strings
+                LOG.log(Level.INFO, "Reading anonymous string from XML reader");
+                obj = readAnonStringsFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_struct:
+                LOG.log(Level.INFO, "Reading struct type from XML reader");
+                obj = readStructFromStax(reader, idlType, tc);
+                break;
+            case TCKind._tk_union:
+                LOG.log(Level.INFO, "Reading union type from XML reader");
+                obj = readUnionFromStax(reader, idlType, tc);
+                break;
+            default:
+                throw new CorbaBindingException("Unsupported complex type");
+            }
+        }
+
+        return obj;
+    }
+    
+    public void writeObjectToStax(CorbaObjectHandler obj, XMLEventWriter writer, 
+                                  XMLEventFactory factory, boolean isNested) {
+        try {
+            QName objName = null;
+            if (isNested) {
+                objName = new QName(obj.getName().getLocalPart());
+            } else {
+                objName = obj.getName();
+            }
+
+            StartElement startEl = null;
+            TypeCode tc = obj.getTypeCode();            
+            if (CorbaUtils.isPrimitiveIdlType(obj.getIdlType())) {
+                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);
+                }
+
+                writer.add(startEl);
+                writePrimitiveToStax(obj, writer, factory);
+            } else {
+                startEl = factory.createStartElement(objName, null, null);
+                writer.add(startEl);
+
+                switch(tc.kind().value()) {
+                case TCKind._tk_array:
+                    LOG.log(Level.INFO, "Writing array type to XML writer");
+                    writeArrayToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_enum:
+                    LOG.log(Level.INFO, "Writing enum type to XML writer");
+                    writeEnumToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_except:
+                    LOG.log(Level.INFO, "Writing exception type to XML writer");
+                    writeExceptionToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_fixed:
+                    LOG.log(Level.INFO, "Writing fixed type to XML writer");
+                    writeFixedToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_sequence:
+                    LOG.log(Level.INFO, "Writing sequence type to XML writer");
+                    writeSequenceToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_struct:
+                    LOG.log(Level.INFO, "Writing struct type to XML writer");
+                    writeStructToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_union:
+                    LOG.log(Level.INFO, "Writing union type to XML writer");
+                    writeUnionToStax(obj, writer, factory);
+                    break;
+                case TCKind._tk_string:
+                case TCKind._tk_wstring:
+                    LOG.log(Level.INFO, "Wrting anonymous string to XML writer");
+                    writePrimitiveToStax(obj, writer, factory);
+                    break;
+                default:
+                    throw new CorbaBindingException("Unsupported complex type");
+                }
+            }            
+            
+            EndElement endEl = factory.createEndElement(objName, null);
+            writer.add(endEl);
+        } catch (XMLStreamException ex) {
+            LOG.log(Level.SEVERE, "STAX exception while writing to STAX event writer: " + ex.toString());
+            LOG.log(Level.SEVERE, "Object being written: " + obj);
+            throw new CorbaBindingException("writeObjectToStax STAX exception", ex);
+        } catch (java.lang.Exception ex) {
+            LOG.log(Level.SEVERE, "Non-STAX exception while writing to STAX event writer: " + ex.toString());
+            LOG.log(Level.SEVERE, "Object being written: " + obj);
+            throw new CorbaBindingException("writeObjectToStax exception", ex);
+        }
+    }
+
+    public CorbaObjectHandler readPrimitiveFromStax(XMLEventReader reader, QName idlType, TypeCode tc) 
+        throws CorbaBindingException {
+        try {
+            StartElement startEl = reader.nextEvent().asStartElement();
+            Characters charEl = reader.nextEvent().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;
+            }
+        } 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);
+        }
+    }
+    
+    public void writePrimitiveToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        Characters charEvt = null;
+        if (obj.getTypeCodeKind() == TCKind.tk_any) {
+            charEvt = factory.createCharacters(((CorbaAnyHandler)obj).getValueData());
+        } else {
+            charEvt = factory.createCharacters(((CorbaPrimitiveHandler)obj).getValueData());
+        }
+        writer.add(charEvt);
+    }
+
+    public CorbaObjectHandler readAnonStringsFromStax(XMLEventReader reader, QName idlType, TypeCode tc) {
+        CorbaPrimitiveHandler obj = null;
+        
+        try {
+            StartElement startEl = reader.nextEvent().asStartElement();
+            Characters charEl = reader.nextEvent().asCharacters();
+            reader.nextEvent().asEndElement();
+            
+            if (tc.kind().value() == TCKind._tk_string) {
+                obj = 
+                    new CorbaPrimitiveHandler(startEl.getName(), CorbaConstants.NT_CORBA_STRING, tc, null);
+            } else {
+                obj = 
+                    new CorbaPrimitiveHandler(startEl.getName(), CorbaConstants.NT_CORBA_WSTRING, tc, null);
+            }
+            obj.setValueFromData(charEl.getData());
+        } 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);
+        }
+        return obj;
+    }
+    
+    // Anonymous strings do not need an equivalent write - the primitive handler write is sufficuent. 
+    
+    public CorbaObjectHandler readArrayFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaArrayHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            QName arrayElemType = null;
+            long arrayBound = 0;
+            // Arrays and anonymous arrays can be handled by the same method
+            if (typeDefinition instanceof Anonarray) {
+                Anonarray anonArrayType = (Anonarray)typeDefinition;
+                arrayElemType = anonArrayType.getElemtype();
+                arrayBound = anonArrayType.getBound();
+            } else {
+                Array arrayType = (Array)typeDefinition;
+                arrayElemType = arrayType.getElemtype();
+                arrayBound = arrayType.getBound();
+            }
+            StartElement arrayStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaArrayHandler(arrayStartEl.getName(), idlType, tc, typeDefinition);
+            for (int i = 0; i < arrayBound; ++i) {
+                CorbaObjectHandler element = readObjectFromStax(reader, arrayElemType, true);
+                obj.addElement(element);
+            }
+            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 array corba type", ex);
+        }
+        
+        return obj;
+    }
 
+    public void writeArrayToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaArrayHandler arrayHandler = (CorbaArrayHandler)obj;
+        List<CorbaObjectHandler> elements = arrayHandler.getElements();
+        for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
+            writeObjectToStax(elementsIter.next(), writer, factory, true);
+        }
+    }
+    
+    public CorbaObjectHandler readEnumFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaEnumHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            Enum enumType = (Enum)typeDefinition;
+            StartElement enumStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaEnumHandler(enumStartEl.getName(), idlType, tc, enumType);
+            Characters enumCharEl = reader.nextEvent().asCharacters();
+            obj.setValue(enumCharEl.getData());
+            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 enum corba type", ex);
+        }
+        
+        return obj;
+    }
+    
+    public void writeEnumToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaEnumHandler enumHandler = (CorbaEnumHandler)obj;
+        Characters charEvt = factory.createCharacters(enumHandler.getValue());
+        writer.add(charEvt);
+    }
+
+    public CorbaObjectHandler readExceptionFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaExceptionHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            Exception exType = (Exception)typeDefinition;
+            StartElement exStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaExceptionHandler(exStartEl.getName(), idlType, tc, exType);
+            List<MemberType> exMembers = exType.getMember();
+            for (int i = 0; i < exMembers.size(); ++i) {
+                CorbaObjectHandler member = readObjectFromStax(reader, exMembers.get(i).getIdltype(), true);
+                obj.addMember(member);
+            }
+            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 exception corba type", ex);
+        }
+        
+        return obj;
     }
 
-    private void addMarshalParams(Message message, List<ParamType> params) {
-        List<Object> args = message.getContent(List.class);
+    public void writeExceptionToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaExceptionHandler exObj = (CorbaExceptionHandler)obj;
+        List<CorbaObjectHandler> elements = exObj.getMembers();
+        for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
+            writeObjectToStax(elementsIter.next(), writer, factory, true);
+        }
+    }
 
-        for (int i = 0; i < params.size(); i++) {
-            Object partValue;
-            ParamType param = params.get(i);
-            if (param.getMode() != ModeType.IN) {
-                partValue = ((Holder)args.get(i)).value;
+    public CorbaObjectHandler readSequenceFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaSequenceHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            QName seqElementType = null;
+            long bound = 0;
+            if (typeDefinition instanceof Anonsequence) {
+                Anonsequence anonSeqType = (Anonsequence)typeDefinition;
+                seqElementType = anonSeqType.getElemtype();
+                bound = anonSeqType.getBound();
+            } else {
+                Sequence seqType = (Sequence)typeDefinition;
+                seqElementType = seqType.getElemtype();
+                bound = seqType.getBound();
+            }
+            StartElement seqStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaSequenceHandler(seqStartEl.getName(), idlType, tc, typeDefinition);
+            if (bound == 0) {
+                LOG.log(Level.INFO, "Unbounded sequence found");
+                while (reader.peek().getEventType() == XMLStreamConstants.START_ELEMENT) {
+                    CorbaObjectHandler element = readObjectFromStax(reader, seqElementType, true);
+                    obj.addElement(element);
+                }
             } else {
-                partValue = args.get(i);
+                LOG.log(Level.INFO, "Bounded sequence found");
+                for (long i = 0; i < bound; ++i) {
+                    CorbaObjectHandler element = readObjectFromStax(reader, seqElementType, true);
+                    obj.addElement(element);
+                }
+            }
+            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 sequence corba type", ex);
+        }
+        
+        return obj;
+    }
+
+    public void writeSequenceToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaSequenceHandler seqHandler = (CorbaSequenceHandler)obj;
+        List<CorbaObjectHandler> elements = seqHandler.getElements();
+        for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
+            writeObjectToStax(elementsIter.next(), writer, factory, true);
+        }
+    }
+
+    public CorbaObjectHandler readStructFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaStructHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            Struct structType = (Struct)typeDefinition;
+            StartElement structStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaStructHandler(structStartEl.getName(), idlType, tc, structType);
+            List<MemberType> structMembers = structType.getMember();
+            for (int i = 0; i < structMembers.size(); ++i) {
+                CorbaObjectHandler member = readObjectFromStax(reader, 
+                                                               structMembers.get(i).getIdltype(), 
+                                                               true);
+                obj.addMember(member);
+            }
+            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 struct corba type", ex);
+        }
+        
+        return obj;
+    }
+
+    public void writeStructToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaStructHandler structHandler = (CorbaStructHandler)obj;
+        List<CorbaObjectHandler> elements = structHandler.getMembers();
+        for (Iterator<CorbaObjectHandler> elementsIter = elements.iterator(); elementsIter.hasNext();) {
+            writeObjectToStax(elementsIter.next(), writer, factory, true);
+        }
+    }
+
+
+    public CorbaObjectHandler readUnionFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
+        throws CorbaBindingException {
+        CorbaUnionHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            Union unionType = (Union)typeDefinition;
+            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(), 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);
+                    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.  Since Celtix does not provide a 
+                        // discriminator value, we'll create one.
+                        discValue = obj.createDefaultDiscriminatorLabel();
+                    }
+                    obj.setDiscriminatorValueFromData(discValue);
+                    obj.setValue(branchName, branchObj);
+                } else {
+                    // Create an object holder with no value
+                    branchObj = CorbaHandlerUtils.createTypeHandler(orb, new QName(branch.getName()),
+                                                                    branch.getIdltype(), typeMaps);
+                }
+                obj.addCase(branchObj);
             }
-            System.out.println("param name: " + param.getName()
-                               + "-" + param.getMode().value()
-                               + "-" + partValue);
+            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;
+    }
+    
+    public void writeUnionToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory)
+        throws XMLStreamException {
+        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
+        CorbaObjectHandler discValue = unionHandler.getDiscriminator();
+        writeObjectToStax(discValue, writer, factory, true);
+        CorbaObjectHandler unionValue = unionHandler.getValue();
+        writeObjectToStax(unionValue, writer, factory, true);
+    }
+    
+    public CorbaObjectHandler readFixedFromStax(XMLEventReader reader, QName idlType, TypeCode tc) 
+        throws CorbaBindingException {
+        CorbaFixedHandler obj = null;
+        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
+        
+        try {
+            StartElement fixedStartEl = reader.nextEvent().asStartElement();
+            obj = new CorbaFixedHandler(fixedStartEl.getName(), idlType, tc, typeDefinition);
+            Characters fixedCharEl = reader.nextEvent().asCharacters();
+            obj.setValueFromData(fixedCharEl.getData());
+            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 fixed corba type", ex);
         }
+        return obj;
+    }
+    
+    public void writeFixedToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory) 
+        throws XMLStreamException {
+        CorbaFixedHandler fixedHandler = (CorbaFixedHandler)obj;
+        Characters charEvt = factory.createCharacters(fixedHandler.getValueData());
+        writer.add(charEvt);
+    }
+
+    protected boolean isRequestor(Message message) {
+        return Boolean.TRUE.equals(message.containsKey(Message.REQUESTOR_ROLE));
+    }
+
+    protected XMLOutputFactory getXMLOutputFactory() {
+        if (xof == null) {
+            xof = XMLOutputFactory.newInstance();
+        }
+        return xof;
+    }
+
+    protected XMLInputFactory getXMLInputFactory() {
+        if (xif == null) {
+            xif = XMLInputFactory.newInstance();
+        }
+        return xif;
+    }
+
+    protected DataWriter<XMLEventWriter> getDataWriter(Message message) {
+        Service service = ServiceModelUtil.getService(message.getExchange());
+        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
+
+        DataWriter<XMLEventWriter> dataWriter = null;
+        for (Class<?> cls : factory.getSupportedFormats()) {
+            if (cls == XMLEventWriter.class) {
+                dataWriter = factory.createWriter(XMLEventWriter.class);
+                break;
+            }
+        }
+
+        if (dataWriter == null) {
+            //throw a fault
+            //throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAWRITER", BUNDLE, service
+            //    .getName()));
+        }
+
+        return dataWriter;
     }
 }

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties Tue Oct 24 11:11:34 2006
@@ -0,0 +1 @@
+// TODO: Add messages here for exceptions

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/interceptors/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java Tue Oct 24 11:11:34 2006
@@ -0,0 +1,200 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yoko.bindings.corba2.types;
+
+import javax.xml.namespace.QName;
+
+import org.apache.yoko.bindings.corba.CorbaBindingException;
+
+import org.omg.CORBA.Any;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.TCKind;
+import org.omg.CORBA.TypeCode;
+
+public class CorbaAnyHandler extends CorbaObjectHandler {
+
+    private Any value;
+    private String schemaType;
+    
+    public CorbaAnyHandler(QName anyName, QName anyIdlType, TypeCode anyTC, Object anyType) {
+        super(anyName, anyIdlType, anyTC, anyType);
+        
+        schemaType = null;
+        value = null;
+    }
+    
+    public String getSchemaType() {
+        return schemaType;
+    }
+    
+    public void setSchemaType(String type) {
+        schemaType = type;
+    }
+    
+    public Any getValue() {
+        return value;
+    }
+    
+    public void setValue(Any v) throws CorbaBindingException {
+        value = v;
+
+        // Need to find the appropriate xsi:type for the any
+        // TODO: See the comment in setValueFromData regarding the xs: prefix.  We'll also need
+        //       to make a similar change here.
+        switch (value.type().kind().value()) {
+        case TCKind._tk_boolean:
+            schemaType = "xs:boolean";
+            break;
+        case TCKind._tk_char:
+            schemaType = "xs:byte";
+            break;
+        case TCKind._tk_wchar:
+            schemaType = "xs:string";
+            break;
+        case TCKind._tk_octet:
+            schemaType = "xs:unsignedByte";
+            break;
+        case TCKind._tk_short:
+            schemaType = "xs:short";
+            break;
+        case TCKind._tk_ushort:
+            schemaType = "xs:unsignedShort";
+            break;
+        case TCKind._tk_long:
+            schemaType = "xs:int";
+            break;
+        case TCKind._tk_ulong:
+            schemaType = "xs:unsignedInt";
+            break;
+        case TCKind._tk_longlong:
+            schemaType = "xs:long";
+            break;
+        case TCKind._tk_ulonglong:
+            schemaType = "xs:unsignedLong";
+            break;
+        case TCKind._tk_double:
+            schemaType = "xs:double";
+            break;
+        case TCKind._tk_float:
+            schemaType = "xs:float";
+            break;
+        case TCKind._tk_string:
+            schemaType = "xs:string";
+            break;
+        case TCKind._tk_wstring:
+            schemaType = "xs:string";
+            break;
+        default:
+            throw new CorbaBindingException("Unsupported type in CORBA Any");
+        }
+    }
+    
+    public String getValueData() throws CorbaBindingException {
+        String result = null;
+        
+        switch (value.type().kind().value()) {
+        case TCKind._tk_boolean:
+            result = Boolean.toString(value.extract_boolean());
+            break;
+        case TCKind._tk_char:
+            result = Byte.toString((byte)value.extract_char());
+            break;
+        case TCKind._tk_wchar:
+            result = Character.toString(value.extract_wchar());
+            break;
+        case TCKind._tk_octet:
+            result = Byte.toString(value.extract_octet());
+            break;
+        case TCKind._tk_short:
+            result = Short.toString(value.extract_short());
+            break;
+        case TCKind._tk_ushort:
+            result = Short.toString(value.extract_ushort());
+            break;
+        case TCKind._tk_long:
+            result = Integer.toString(value.extract_long());
+            break;
+        case TCKind._tk_ulong:
+            result = Integer.toString(value.extract_ulong());
+            break;
+        case TCKind._tk_longlong:
+            result = Long.toString(value.extract_longlong());
+            break;
+        case TCKind._tk_ulonglong:
+            result = Long.toString(value.extract_ulonglong());
+            break;
+        case TCKind._tk_double:
+            result = Double.toString(value.extract_double());
+            break;
+        case TCKind._tk_float:
+            result = Float.toString(value.extract_float());
+            break;
+        case TCKind._tk_string:
+            result = value.extract_string();
+            break;
+        case TCKind._tk_wstring:
+            result = value.extract_wstring();
+            break;
+        default:
+            throw new CorbaBindingException("Unsupported type in CORBA Any");
+        }
+        
+        return result;
+    }
+    
+    public void setValueFromData(ORB orb, String data, String type) 
+        throws CorbaBindingException {
+        value = orb.create_any();
+        
+        // TODO: For now, the xs: is hard coded because the namespace for xs: is not included in the 
+        // STAX element where we get the type information from.  This will need to be changed so that
+        // it does not depend on the XML Schema namespace using the xs: prefix.
+        if (type.equals("xs:boolean")) {
+            value.insert_boolean(Boolean.parseBoolean(data));
+        } else if (type.equals("xs:byte")) {
+            value.insert_char((char)Byte.valueOf(data).byteValue());
+        } else if (type.equals("xs:double")) {
+            value.insert_double(Double.parseDouble(data));
+        } else if (type.equals("xs:float")) {
+            value.insert_float(Float.parseFloat(data));
+        } else if (type.equals("xs:int")) {
+            value.insert_long(Integer.parseInt(data));
+        } else if (type.equals("xs:long")) {
+            value.insert_longlong(Long.parseLong(data));
+        } else if (type.equals("xs:short")) {
+            value.insert_short(Short.parseShort(data));
+        } else if (type.equals("xs:string")) {
+            // NOTE: CORBA wchar, string, and wstrings will all be inserted as strings since they all
+            //       map to the same XML Schema type.  There is no way in Celtix of differentiating 
+            //       between the three when used in an any.
+            value.insert_string(data);
+        } else if (type.equals("xs:unsignedByte")) {
+            value.insert_octet(Byte.parseByte(data));
+        } else if (type.equals("xs:unsignedInt")) {
+            value.insert_ulong(Integer.parseInt(data));
+        } else if (type.equals("xs:unsignedLong")) {
+            value.insert_ulonglong(Long.parseLong(data));
+        } else if (type.equals("xs:unsignedShort")) {
+            value.insert_ushort(Short.parseShort(data));
+        } else {
+            throw new CorbaBindingException("Unsupported XML Schema type");
+        }
+        schemaType = type;
+    }
+}

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaAnyHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaArrayHandler.java
URL: http://svn.apache.org/viewvc/incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaArrayHandler.java?view=auto&rev=467425
==============================================================================
--- incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaArrayHandler.java (added)
+++ incubator/yoko/branches/cxf_port/bindings/src/main/java/org/apache/yoko/bindings/corba2/types/CorbaArrayHandler.java Tue Oct 24 11:11:34 2006
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.yoko.bindings.corba2.types;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.omg.CORBA.TypeCode;
+
+public class CorbaArrayHandler extends CorbaObjectHandler {
+
+    private List<CorbaObjectHandler> elements = new ArrayList<CorbaObjectHandler>();
+    
+    public CorbaArrayHandler(QName arrayName, QName arrayIdlType, TypeCode arrayTC, Object arrayType) {
+        super(arrayName, arrayIdlType, arrayTC, arrayType);
+    }
+    
+    public void addElement(CorbaObjectHandler el) {
+        elements.add(el);
+    }
+    
+    public int getNumberOfElements() {
+        return elements.size();
+    }
+    
+    public List<CorbaObjectHandler> getElements() {
+        return elements;
+    }
+    
+    public CorbaObjectHandler getElement(int index) {
+        return elements.get(index);
+    }    
+}



Mime
View raw message