incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r498617 - in /incubator/yoko/trunk: bindings/src/main/java/org/apache/yoko/bindings/corba/ bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/ bindings/src/main/java/org/apache/yoko/bindings/corba/types/ bindings/src/test/ja...
Date Mon, 22 Jan 2007 14:11:39 GMT
Author: bravi
Date: Mon Jan 22 06:11:35 2007
New Revision: 498617

URL: http://svn.apache.org/viewvc?view=rev&rev=498617
Log:
[YOKO-170] - Moving to the latest version of cxf which has a fix for getting the elementFormDefault attribute from the XMLSchema in order to write out the proper stax event. Also fixed some types in the type_test and added more type tests.

Modified:
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.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/interceptors/CorbaInInterceptor.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaOutInterceptor.java
    incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtils.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.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/interceptors/CorbaInInterceptorTest.java
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtilsTest.java
    incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaHelper.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaConduit.java Mon Jan 22 06:11:35 2007
@@ -187,7 +187,11 @@
                 }
                 QName elName = new QName("", raises.getException().getLocalPart());
                 CorbaObjectHandler handler =
-                    CorbaHandlerUtils.initializeObjectHandler(orb, elName, raises.getException(), typeMaps);
+                    CorbaHandlerUtils.initializeObjectHandler(orb,
+                                                              elName,
+                                                              raises.getException(),
+                                                              typeMaps,
+                                                              service);
                 
                 CorbaStreamable exStreamable = new CorbaStreamable(handler, elName);
                 exStreamable._read(except.create_input_stream());

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=498617&r1=498616&r2=498617
==============================================================================
--- 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 Mon Jan 22 06:11:35 2007
@@ -39,6 +39,8 @@
 import javax.xml.stream.events.XMLEvent;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.service.model.ServiceInfo;
+
 import org.apache.schemas.yoko.bindings.corba.Anonarray;
 import org.apache.schemas.yoko.bindings.corba.Anonsequence;
 import org.apache.schemas.yoko.bindings.corba.Array;
@@ -83,29 +85,37 @@
     
     private ORB orb;
     private List<CorbaTypeMap> typeMaps;       
-    
+    private ServiceInfo serviceInfo;
     
     public CorbaStaxObject() {         
     }
     
     public CorbaStaxObject(ORB mOrb) {
-        this.orb = mOrb;    
+        orb = mOrb;
     }
     
     public ORB getOrb() {
-        return this.orb;
+        return orb;
     }
 
     public void setOrb(ORB tOrb) {
-        this.orb = tOrb;
+        orb = tOrb;
     }
 
     public void setTypeMaps(List<CorbaTypeMap> tMaps) {
-        this.typeMaps = tMaps;
+        typeMaps = tMaps;
     }
     
     public List<CorbaTypeMap> getTypeMaps() {
-        return this.typeMaps;
+        return typeMaps;
+    }
+
+    public void setServiceInfo(ServiceInfo info) {
+        serviceInfo = info;
+    }
+    
+    public ServiceInfo getServiceInfo() {
+        return serviceInfo;
     }
 
     public CorbaObjectHandler readObjectFromStax(XMLEventReader reader, 
@@ -119,6 +129,7 @@
             if (!isNested) {
                 while (reader.peek().getEventType() != XMLStreamConstants.START_ELEMENT) {
                     reader.nextEvent();
+                    reader.nextEvent();
                 }
             }
         } catch (XMLStreamException ex) {
@@ -586,8 +597,11 @@
                     // 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);
+                        CorbaHandlerUtils.createTypeHandler(orb,
+                                                            new QName("discriminator"),
+                                                            unionType.getDiscriminator(),
+                                                            typeMaps,
+                                                            serviceInfo);
                     obj.setDiscriminator(discObj);
 
                     // Determine the value of the discriminator.  
@@ -608,8 +622,10 @@
                     obj.setValue(branchName, branchObj);
                 } else {
                     // Create an object holder with no value
-                    branchObj = CorbaHandlerUtils.createTypeHandler(orb, new QName(branch.getName()),
-                                                                    branch.getIdltype(), typeMaps);
+                    branchObj = CorbaHandlerUtils.createTypeHandler(orb,
+                                                                    new QName(branch.getName()),
+                                                                    branch.getIdltype(),
+                                                                    typeMaps, serviceInfo);
                 }
                 obj.addCase(branchObj);
             }

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptor.java Mon Jan 22 06:11:35 2007
@@ -75,10 +75,11 @@
 public class CorbaInInterceptor extends AbstractPhaseInterceptor<Message> {
     
     protected static CorbaStaxObject corbaStaxObject;
-    private List<CorbaTypeMap> typeMaps;    
+    private List<CorbaTypeMap> typeMaps;
     private XMLOutputFactory xof;
     private XMLInputFactory xif;
     private ORB orb;
+    private ServiceInfo service;
     
     public CorbaInInterceptor() {
         super();
@@ -102,11 +103,12 @@
             }
         
             typeMaps = new ArrayList<CorbaTypeMap>();                
-            ServiceInfo service = destination.getBindingInfo().getService();        
+            service = destination.getBindingInfo().getService();
             List<TypeMappingType> corbaTypes = service.getExtensors(TypeMappingType.class);
             if (corbaTypes != null) {
                 CorbaUtils.createCorbaTypeMap(typeMaps, corbaTypes);
                 corbaStaxObject.setTypeMaps(typeMaps);
+                corbaStaxObject.setServiceInfo(service);
             }
             
             // TODO: where does encoding constant go?
@@ -114,9 +116,9 @@
                                
             // check to see if we have an input or output message
             if (!ContextUtils.isRequestor(msg)) {
-                handleNotRequestMessage(message, destination, service);                
+                handleNotRequestMessage(message, destination);                
             } else {             
-                handleRequestMessage(message, destination, service);
+                handleRequestMessage(message, destination);
             } 
         } catch (Exception ex) {
             throw new Fault(ex);
@@ -124,8 +126,7 @@
     }
             
     protected void handleNotRequestMessage(CorbaMessage message,
-                                           CorbaDestination destination,
-                                           ServiceInfo service)
+                                           CorbaDestination destination)
         throws Exception {
         QName opQName = null;
         OperationType opType = null;
@@ -156,7 +157,7 @@
         }
 
         ServerRequest request = (ServerRequest)exchange.get(org.omg.CORBA.ServerRequest.class);
-        NVList list = prepareArguments(message, destination, info, service, opType, opQName);
+        NVList list = prepareArguments(message, destination, info, opType, opQName);
         request.arguments(list);
         message.setList(list);            
     
@@ -174,8 +175,7 @@
     }
     
     protected void handleRequestMessage(CorbaMessage message,
-                                        CorbaDestination destination,
-                                        ServiceInfo service)
+                                        CorbaDestination destination)
         throws Exception {
         OperationType opType = null;
         
@@ -408,9 +408,11 @@
         message.setContent(List.class, args);
     }    
     
-    protected NVList prepareArguments(CorbaMessage corbaMsg, CorbaDestination destination,
-                                      InterfaceInfo info, ServiceInfo service, 
-                                      OperationType opType, QName opQName)
+    protected NVList prepareArguments(CorbaMessage corbaMsg,
+                                      CorbaDestination destination,
+                                      InterfaceInfo info,
+                                      OperationType opType,
+                                      QName opQName)
         throws Exception {
         
         BindingInfo bInfo = destination.getBindingInfo();                              
@@ -457,7 +459,7 @@
             ModeType paramMode = param.getMode();
  
             CorbaObjectHandler obj = 
-                CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, maps);
+                CorbaHandlerUtils.initializeObjectHandler(orb, paramName, paramIdlType, maps, service);
 
             streamables[i] = new CorbaStreamable(obj, paramName);
             if (paramMode.value().equals("in")) {

Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaOutInterceptor.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaOutInterceptor.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/interceptors/CorbaOutInterceptor.java Mon Jan 22 06:11:35 2007
@@ -74,6 +74,7 @@
     private static final String XMLSCHEMA_PREFIX = "xs";
 
     protected CorbaStaxObject corbaStaxObject;
+    private ServiceInfo service;
     private List<CorbaTypeMap> typeMaps;
     private ORB orb;
     private XMLOutputFactory xof;
@@ -92,11 +93,12 @@
             Exchange exchange = message.getExchange();
             typeMaps = new ArrayList<CorbaTypeMap>();
 
-            ServiceInfo service = exchange.get(ServiceInfo.class);
+            service = exchange.get(ServiceInfo.class);
             List<TypeMappingType> corbaTypes = service.getExtensors(TypeMappingType.class);
             if (corbaTypes != null) {
                 CorbaUtils.createCorbaTypeMap(typeMaps, corbaTypes);
                 corbaStaxObject.setTypeMaps(typeMaps);
+                corbaStaxObject.setServiceInfo(service);
             }        
             getXMLOutputFactory().setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
 
@@ -132,7 +134,7 @@
             QName retIdlType = returnParam.getIdltype();
             QName retName = new QName("", returnParam.getName());
             CorbaObjectHandler obj = CorbaHandlerUtils
-                .initializeObjectHandler(orb, retName, retIdlType, typeMaps);
+                .initializeObjectHandler(orb, retName, retIdlType, typeMaps, service);
             CorbaStreamable streamable = new CorbaStreamable(obj, retName);
             message.setStreamableReturn(streamable);
         }
@@ -172,7 +174,7 @@
                 QName elName = new QName("", param.getName());
                 CorbaObjectHandler obj = null;
                 if (param.getMode().equals(ModeType.OUT)) {
-                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps);
+                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps, service);
                 } else {
                     obj = corbaStaxObject.readObjectFromStax(evtReader, idlType, false);
                 }
@@ -227,7 +229,7 @@
                 CorbaObjectHandler obj = null;
 
                 if (param.getMode().equals(ModeType.IN)) {
-                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps);
+                    obj = CorbaHandlerUtils.initializeObjectHandler(orb, elName, idlType, typeMaps, service);
                 } else {
                     obj = corbaStaxObject.readObjectFromStax(evtReader, idlType, false);
                 }
@@ -277,8 +279,8 @@
     }
     
     protected DataWriter<XMLEventWriter> getDataWriter(CorbaMessage message) {
-        Service service = ServiceModelUtil.getService(message.getExchange());
-        DataWriterFactory factory = service.getDataBinding().getDataWriterFactory();
+        Service serviceModel = ServiceModelUtil.getService(message.getExchange());
+        DataWriterFactory factory = serviceModel.getDataBinding().getDataWriterFactory();
 
         DataWriter<XMLEventWriter> dataWriter = null;
         if (factory != null) {

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=498617&r1=498616&r2=498617
==============================================================================
--- 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 Mon Jan 22 06:11:35 2007
@@ -23,6 +23,9 @@
 
 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;
 import org.apache.schemas.yoko.bindings.corba.Anonsequence;
 import org.apache.schemas.yoko.bindings.corba.Array;
@@ -32,6 +35,11 @@
 import org.apache.schemas.yoko.bindings.corba.Struct;
 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.XmlSchemaExternal;
+import org.apache.ws.commons.schema.XmlSchemaForm;
+
 import org.apache.yoko.bindings.corba.CorbaTypeMap;
 import org.apache.yoko.bindings.corba.CorbaUtils;
 import org.apache.yoko.wsdl.CorbaTypeImpl;
@@ -42,8 +50,11 @@
 
 public class CorbaHandlerUtils {
 
-    public static CorbaObjectHandler createTypeHandler(ORB orb, QName name, 
-                                                       QName idlType, List<CorbaTypeMap> typeMaps) {
+    public static CorbaObjectHandler createTypeHandler(ORB orb,
+                                                       QName name, 
+                                                       QName idlType,
+                                                       List<CorbaTypeMap> typeMaps,
+                                                       ServiceInfo serviceInfo) {
         CorbaObjectHandler handler = null;        
 
         TypeCode tc = CorbaUtils.getTypeCode(orb, idlType, typeMaps);
@@ -56,7 +67,12 @@
             }
         } 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);
@@ -92,34 +108,29 @@
         return handler;
     }
     
-    public static CorbaObjectHandler initializeObjectHandler(ORB orb, QName name, 
-                                                             QName idlType, List<CorbaTypeMap> typeMaps) {
-        /*
-        QName typeName = CorbaUtils.getCorbaType(idlType, typeMaps).getType();
-        if (typeName != null) {
-            //check to see if the schema has elementFormQualified as qualified
-            String nsURI = typeName.getNamespaceURI();
-            //name = new QName(nsURI, name.getLocalPart());
-        }
-        */
-        CorbaObjectHandler obj = createTypeHandler(orb, name, idlType, typeMaps);
-
+    public static CorbaObjectHandler initializeObjectHandler(ORB orb,
+                                                             QName name, 
+                                                             QName idlType,
+                                                             List<CorbaTypeMap> typeMaps,
+                                                             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);
+                initializeArrayHandler(orb, obj, name, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_except:
-                initializeExceptionHandler(orb, obj, name, typeMaps);
+                initializeExceptionHandler(orb, obj, name, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_sequence:
-                initializeSequenceHandler(orb, obj, name, typeMaps);
+                initializeSequenceHandler(orb, obj, name, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_struct:
-                initializeStructHandler(orb, obj, name, typeMaps);
+                initializeStructHandler(orb, obj, name, typeMaps, serviceInfo);
                 break;
             case TCKind._tk_union:
-                initializeUnionHandler(orb, obj, name, typeMaps);
+                initializeUnionHandler(orb, obj, name, typeMaps, serviceInfo);
                 break;
 
             default:
@@ -129,8 +140,11 @@
         return obj;
     }
     
-    public static void initializeArrayHandler(ORB orb, CorbaObjectHandler obj, 
-                                              QName name, List<CorbaTypeMap> typeMaps) {
+    public static void initializeArrayHandler(ORB orb,
+                                              CorbaObjectHandler obj, 
+                                              QName name,
+                                              List<CorbaTypeMap> typeMaps,
+                                              ServiceInfo serviceInfo) {
         QName arrayElementType = null;
         long arrayBound = 0;
         CorbaTypeImpl baseType = obj.getType();
@@ -146,13 +160,16 @@
         for (int i = 0; i < arrayBound; ++i) {
             QName elementName = new QName(name.getNamespaceURI(), "item");
             CorbaObjectHandler elementObj = 
-                initializeObjectHandler(orb, elementName, arrayElementType, typeMaps);
+                initializeObjectHandler(orb, elementName, arrayElementType, typeMaps, serviceInfo);
             ((CorbaArrayHandler)obj).addElement(elementObj);
         }
     }
     
-    public static void initializeExceptionHandler(ORB orb, CorbaObjectHandler obj, 
-                                                  QName name, List<CorbaTypeMap> typeMaps) {
+    public static void initializeExceptionHandler(ORB orb,
+                                                  CorbaObjectHandler obj, 
+                                                  QName name,
+                                                  List<CorbaTypeMap> typeMaps,
+                                                  ServiceInfo serviceInfo) {
         Exception exceptType = (Exception)obj.getType();
         List<MemberType> exceptMembers = exceptType.getMember();
 
@@ -161,13 +178,16 @@
             QName memberName = new QName(name.getNamespaceURI(), member.getName());
             QName memberType = member.getIdltype();
             CorbaObjectHandler memberObj = 
-                initializeObjectHandler(orb, memberName, memberType, typeMaps);
+                initializeObjectHandler(orb, memberName, memberType, typeMaps, serviceInfo);
             ((CorbaExceptionHandler)obj).addMember(memberObj);
         }
     }
     
-    public static void initializeSequenceHandler(ORB orb, CorbaObjectHandler obj, 
-                                                 QName name, List<CorbaTypeMap> typeMaps) {
+    public static void initializeSequenceHandler(ORB orb,
+                                                 CorbaObjectHandler obj, 
+                                                 QName name,
+                                                 List<CorbaTypeMap> typeMaps,
+                                                 ServiceInfo serviceInfo) {
         QName seqElementType = null;
         long seqBound = 0;
         CorbaTypeImpl baseType = obj.getType();
@@ -185,19 +205,22 @@
             // new objects as needed
             QName elementName = new QName(name.getNamespaceURI(), name.getLocalPart());
             CorbaObjectHandler elementObj = 
-                initializeObjectHandler(orb, elementName, seqElementType, typeMaps);
+                initializeObjectHandler(orb, elementName, seqElementType, typeMaps, serviceInfo);
             ((CorbaSequenceHandler)obj).setTemplateElement(elementObj);
         }
         for (int i = 0; i < seqBound; ++i) {
             QName elementName = new QName(name.getNamespaceURI(), name.getLocalPart());
             CorbaObjectHandler elementObj = 
-                initializeObjectHandler(orb, elementName, seqElementType, typeMaps);
+                initializeObjectHandler(orb, elementName, seqElementType, typeMaps, serviceInfo);
             ((CorbaSequenceHandler)obj).addElement(elementObj);
         }
     }
     
-    public static void initializeStructHandler(ORB orb, CorbaObjectHandler obj, 
-                                               QName name, List<CorbaTypeMap> typeMaps) {
+    public static void initializeStructHandler(ORB orb,
+                                               CorbaObjectHandler obj, 
+                                               QName name,
+                                               List<CorbaTypeMap> typeMaps,
+                                               ServiceInfo serviceInfo) {
         Struct structType = (Struct)obj.getType();
         List<MemberType> structMembers = structType.getMember();
 
@@ -206,19 +229,23 @@
             QName memberName = new QName(name.getNamespaceURI(), member.getName());
             QName memberType = member.getIdltype();
             CorbaObjectHandler memberObj = 
-                initializeObjectHandler(orb, memberName, memberType, typeMaps);
+                initializeObjectHandler(orb, memberName, memberType, typeMaps, serviceInfo);           
             ((CorbaStructHandler)obj).addMember(memberObj);
         }
     }
     
-    public static void initializeUnionHandler(ORB orb, CorbaObjectHandler obj, 
-                                              QName name, List<CorbaTypeMap> typeMaps) {
+    public static void initializeUnionHandler(ORB orb,
+                                              CorbaObjectHandler obj, 
+                                              QName name,
+                                              List<CorbaTypeMap> typeMaps,
+                                              ServiceInfo serviceInfo) {
         Union unionType = (Union)obj.getType();
         // First handle the discriminator
         CorbaObjectHandler discObj = initializeObjectHandler(orb, 
                                                              new QName("discriminator"),
                                                              unionType.getDiscriminator(),
-                                                             typeMaps);
+                                                             typeMaps,
+                                                             serviceInfo);
         ((CorbaUnionHandler)obj).setDiscriminator(discObj);
         
         // Now handle all of the branches
@@ -228,8 +255,44 @@
             QName branchName = new QName(name.getNamespaceURI(), branch.getName());
             QName branchIdlType = branch.getIdltype();
             CorbaObjectHandler branchObj = 
-                initializeObjectHandler(orb, branchName, branchIdlType, typeMaps);
+                initializeObjectHandler(orb, branchName, branchIdlType, typeMaps, serviceInfo);
             ((CorbaUnionHandler)obj).addCase(branchObj);
         }
+    }
+
+    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();
+            }
+        }
+        return nsUri;
+    }
+
+    public 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);
+        }
+        return false;
+    }
+
+    public 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;
     }
 }

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient.java Mon Jan 22 06:11:35 2007
@@ -35,6 +35,12 @@
 import org.apache.type_test.corba.TypeTestTester;
 import org.apache.type_test.corba.CORBAService;
 
+import org.apache.type_test.types1.AnyURIEnum;
+import org.apache.type_test.types1.DecimalEnum;
+import org.apache.type_test.types1.NMTokenEnum;
+import org.apache.type_test.types1.NumberEnum;
+import org.apache.type_test.types1.StringEnum;
+
 import junit.framework.TestCase;
 
 public abstract class AbstractTypeTestClient extends TestCase implements TypeTestTester {
@@ -839,7 +845,158 @@
             }
         }
     }
+
+    /**
+     * XXX - In the generated code for ColourEnum, the fromValue() method
+     * is not declared static - fixed in jaxb-ri-20060421 nightly build.
+     */
+    public void testColourEnum() throws Exception {
+        /*
+        String[] xx = {"RED", "GREEN", "BLUE"};
+        String[] yy = {"GREEN", "BLUE", "RED"};
+
+        Holder<ColourEnum> z = new Holder<ColourEnum>();
+
+        for (int i = 0; i < 3; i++) {
+            ColourEnum x = ColourEnum.fromValue(xx[i]);
+            ColourEnum yOrig = ColourEnum.fromValue(yy[i]);
+            Holder<ColourEnum> y = new Holder<ColourEnum>(yOrig);
+
+            ColourEnum ret = client.testColourEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testColourEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testColourEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testColourEnum(): Incorrect return value",
+                             x.value(), ret.value());
+            }
+        }
+        */
+    }
+    
+    public void testNumberEnum() throws Exception {
+        int[] xx = {1, 2, 3};
+        int[] yy = {3, 1, 2};
+
+        Holder<NumberEnum> z = new Holder<NumberEnum>();
+
+        for (int i = 0; i < 3; i++) {
+            NumberEnum x = NumberEnum.fromValue(xx[i]);
+            NumberEnum yOrig = NumberEnum.fromValue(yy[i]);
+            Holder<NumberEnum> y = new Holder<NumberEnum>(yOrig);
+
+            NumberEnum ret = client.testNumberEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testNumberEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testNumberEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testNumberEnum(): Incorrect return value",
+                             x.value(), ret.value());
+            }
+        }
+    }
+    
+    public void testStringEnum() throws Exception {
+        String[] xx = {"a b c", "d e f", "g h i"};
+        String[] yy = {"g h i", "a b c", "d e f"};
+
+        Holder<StringEnum> z = new Holder<StringEnum>();
+        for (int i = 0; i < 3; i++) {
+            StringEnum x = StringEnum.fromValue(xx[i]);
+            StringEnum yOrig = StringEnum.fromValue(yy[i]);
+            Holder<StringEnum> y = new Holder<StringEnum>(yOrig);
+
+            StringEnum ret = client.testStringEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testStringEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testStringEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testStringEnum(): Incorrect return value",
+                             x.value(), ret.value());
+            }
+        }
+    }
+    
+    public void testDecimalEnum() throws Exception {
+        BigDecimal[] xx = {new BigDecimal("-10.34"),
+                           new BigDecimal("11.22"),
+                           new BigDecimal("14.55")};
+        BigDecimal[] yy = {new BigDecimal("14.55"),
+                           new BigDecimal("-10.34"),
+                           new BigDecimal("11.22")};
+
+        Holder<DecimalEnum> z = new Holder<DecimalEnum>();
+
+        for (int i = 0; i < 3; i++) {
+            DecimalEnum x = DecimalEnum.fromValue(xx[i]);
+            DecimalEnum yOrig = DecimalEnum.fromValue(yy[i]);
+            Holder<DecimalEnum> y = new Holder<DecimalEnum>(yOrig);
+
+            DecimalEnum ret = client.testDecimalEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testDecimalEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testDecimalEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testDecimalEnum(): Incorrect return value",
+                             x.value(), ret.value());
+            }
+        }
+    }
     
+    public void testNMTokenEnum() throws Exception {
+        String[] xx = {"hello", "there"};
+        String[] yy = {"there", "hello"};
+
+        Holder<NMTokenEnum> z = new Holder<NMTokenEnum>();
+
+        for (int i = 0; i < 2; i++) {
+            NMTokenEnum x = NMTokenEnum.fromValue(xx[i]);
+            NMTokenEnum yOrig = NMTokenEnum.fromValue(yy[i]);
+            Holder<NMTokenEnum> y = new Holder<NMTokenEnum>(yOrig);
+
+            NMTokenEnum ret = client.testNMTokenEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testNMTokenEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testNMTokenEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testNMTokenEnum(): Incorrect return value",
+                             x.value(), ret.value());
+            }
+        }
+    }
+
+    public void testAnyURIEnum() throws Exception {
+        String[] xx = {"http://www.iona.com", "http://www.google.com"};
+        String[] yy = {"http://www.google.com", "http://www.iona.com"};
+        
+        Holder<AnyURIEnum> z = new Holder<AnyURIEnum>();
+        for (int i = 0; i < 2; i++) {
+            AnyURIEnum x = AnyURIEnum.fromValue(xx[i]);
+            AnyURIEnum yOrig = AnyURIEnum.fromValue(yy[i]);
+            Holder<AnyURIEnum> y = new Holder<AnyURIEnum>(yOrig);
+            
+            AnyURIEnum ret = client.testAnyURIEnum(x, y, z);
+
+            if (!perfTestOnly) {
+                assertEquals("testAnyURIEnum(): Incorrect value for inout param",
+                             x.value(), y.value.value());
+                assertEquals("testAnyURIEnum(): Incorrect value for out param",
+                             yOrig.value(), z.value.value());
+                assertEquals("testAnyURIEnum(): Incorrect return value", x.value(), ret.value());
+            }
+        }
+    }
+
     
     protected boolean equals(byte[] x, byte[] y) {
         String xx = new String(x);

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/AbstractTypeTestClient1.java Mon Jan 22 06:11:35 2007
@@ -26,12 +26,17 @@
 import javax.xml.bind.JAXBElement;
 import javax.xml.ws.Holder;
 
+import org.apache.type_test.types1.AnonymousStruct;
 import org.apache.type_test.types1.BoundedArray;
 import org.apache.type_test.types1.CompoundArray;
+import org.apache.type_test.types1.EmptyAll;
+import org.apache.type_test.types1.EmptyChoice;
 import org.apache.type_test.types1.EmptyStruct;
 import org.apache.type_test.types1.FixedArray;
 import org.apache.type_test.types1.NestedArray;
 import org.apache.type_test.types1.NestedStruct;
+import org.apache.type_test.types1.SimpleAll;
+import org.apache.type_test.types1.SimpleChoice;
 import org.apache.type_test.types1.SimpleStruct;
 import org.apache.type_test.types1.StructWithNillables;
 import org.apache.type_test.types1.UnboundedArray;
@@ -57,7 +62,7 @@
     }
 
     //org.apache.type_test.types1.EmptyStruct
-    /*
+    
     public void testEmptyStruct() throws Exception {
         EmptyStruct x = new EmptyStruct();
         EmptyStruct yOrig = new EmptyStruct();
@@ -73,7 +78,7 @@
             assertTrue("testEmptyStruct(): Null return value", notNull(x, ret));
         }
     }
-    */
+    
     //org.apache.type_test.types1.SimpleStruct
 
     protected boolean equals(SimpleStruct x, SimpleStruct y) {
@@ -108,7 +113,7 @@
     }
     
     //org.apache.type_test.types1.StructWithNillables
-    /*
+    
     protected boolean equals(StructWithNillables x, StructWithNillables y) {
         return equalsNilable(x.getVarFloat(), y.getVarFloat())
             && equalsNilable(x.getVarInt(), x.getVarInt())
@@ -361,6 +366,140 @@
             }
         }
     }
-    */
+    
+    protected boolean equals(AnonymousStruct x, AnonymousStruct y) {
+        return (x.getVarFloat() == y.getVarFloat())
+            && (x.getVarInt() == y.getVarInt())
+            && (x.getVarString().equals(y.getVarString()));
+    }
+    
+    public void testAnonymousStruct() throws Exception {
+        AnonymousStruct x = new AnonymousStruct();
+        x.setVarInt(100);
+        x.setVarString("hello");
+        x.setVarFloat(1.1f);
+
+        AnonymousStruct yOrig = new AnonymousStruct();
+        yOrig.setVarInt(11);
+        yOrig.setVarString("world");
+        yOrig.setVarFloat(10.1f);
+
+        Holder<AnonymousStruct> y = new Holder<AnonymousStruct>(yOrig);
+        Holder<AnonymousStruct> z = new Holder<AnonymousStruct>();
+        AnonymousStruct ret = client.testAnonymousStruct(x, y, z);
+
+        if (!perfTestOnly) {
+            assertTrue("testAnonymousStruct(): Incorrect value for inout param",
+                       equals(x, y.value));
+            assertTrue("testAnonymousStruct(): Incorrect value for out param",
+                       equals(yOrig, z.value));
+            assertTrue("testAnonymousStruct(): Incorrect return value", equals(x, ret));
+        }
+    }
+
+    //org.apache.type_test.types1.EmptyChoice
+
+    public void testEmptyChoice() throws Exception {
+        EmptyChoice x = new EmptyChoice();
+        EmptyChoice yOrig = new EmptyChoice();
+        Holder<EmptyChoice> y = new Holder<EmptyChoice>(yOrig);
+        Holder<EmptyChoice> z = new Holder<EmptyChoice>();
+        EmptyChoice ret = client.testEmptyChoice(x, y, z);
+        if (!perfTestOnly) {
+            assertTrue("testEmptyChoice(): Null value for inout param",
+                       notNull(x, y.value));
+            assertTrue("testEmptyChoice(): Null value for out param",
+                       notNull(yOrig, z.value));
+            assertTrue("testEmptyChoice(): Null return value", notNull(x, ret));
+        }
+    }
+    
+    //org.apache.type_test.types1.SimpleChoice
+    
+    protected boolean equals(SimpleChoice x, SimpleChoice y) {
+        if (x.getVarFloat() != null && y.getVarFloat() != null) {
+            return x.getVarFloat().compareTo(y.getVarFloat()) == 0;
+        } else if (x.getVarInt() != null && y.getVarInt() != null) {
+            return x.getVarInt().compareTo(y.getVarInt()) == 0;
+        } else if (x.getVarString() != null && y.getVarString() != null) {
+            return x.getVarString().equals(y.getVarString());
+        } else {
+            return false;
+        }
+    }
+
+    public void testSimpleChoice() throws Exception {
+        SimpleChoice x = new SimpleChoice();
+        x.setVarFloat(-3.14f);
+        SimpleChoice yOrig = new SimpleChoice();
+        yOrig.setVarString("Cheerio");
+
+        Holder<SimpleChoice> y = new Holder<SimpleChoice>(yOrig);
+        Holder<SimpleChoice> z = new Holder<SimpleChoice>();
+
+        SimpleChoice ret = client.testSimpleChoice(x, y, z);
+        if (!perfTestOnly) {
+            assertTrue("testSimpleChoice(): Incorrect value for inout param",
+                       equals(x, y.value));
+            assertTrue("testSimpleChoice(): Incorrect value for out param",
+                       equals(yOrig, z.value));
+            assertTrue("testSimpleChoice(): Incorrect return value", equals(x, ret));
+        }
+    }
+    
+    //org.apache.type_test.types1.EmptyAll
+
+    public void testEmptyAll() throws Exception {
+        EmptyAll x = new EmptyAll();
+        EmptyAll yOrig = new EmptyAll();
+        Holder<EmptyAll> y = new Holder<EmptyAll>(yOrig);
+        Holder<EmptyAll> z = new Holder<EmptyAll>();
+        EmptyAll ret = client.testEmptyAll(x, y, z);
+
+        if (!perfTestOnly) {
+            assertTrue("testEmptyAll(): Null value for inout param",
+                       notNull(x, y.value));
+            assertTrue("testEmptyAll(): Null value for out param",
+                       notNull(yOrig, z.value));
+            assertTrue("testEmptyAll(): Null return value", notNull(x, ret));
+        }
+    }
+    
+    //org.apache.type_test.types1.SimpleAll
+
+    protected boolean equals(SimpleAll x, SimpleAll y) {
+        return (x.getVarFloat() == y.getVarFloat())
+            && (x.getVarInt() == y.getVarInt())
+            && (x.getVarString().equals(y.getVarString()))
+            && (x.getVarAttrString().equals(y.getVarAttrString()));
+    }
+    
+    public void testSimpleAll() throws Exception {
+        SimpleAll x = new SimpleAll();
+        x.setVarFloat(3.14f);
+        x.setVarInt(42);
+        x.setVarString("Hello There");
+        x.setVarAttrString("Attr-x");
+
+        SimpleAll yOrig = new SimpleAll();
+        yOrig.setVarFloat(-9.14f);
+        yOrig.setVarInt(10);
+        yOrig.setVarString("Cheerio");
+        yOrig.setVarAttrString("Attr-y");
+
+        Holder<SimpleAll> y = new Holder<SimpleAll>(yOrig);
+        Holder<SimpleAll> z = new Holder<SimpleAll>();
+
+        SimpleAll ret = client.testSimpleAll(x, y, z);
+
+        if (!perfTestOnly) {
+            assertTrue("testSimpleAll(): Incorrect value for inout param",
+                       equals(x, y.value));
+            assertTrue("testSimpleAll(): Incorrect value for out param",
+                       equals(yOrig, z.value));
+            assertTrue("testSimpleAll(): Incorrect return value", equals(x, ret));
+        }
+    }
+
 
 }

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=498617&r1=498616&r2=498617
==============================================================================
--- 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 Mon Jan 22 06:11:35 2007
@@ -69,9 +69,6 @@
 
     public void testQName() throws Exception {
     }
-
-    public void testDecimal() throws Exception {
-    }
         
     public void testBase64Binary() throws Exception  {
     }
@@ -79,26 +76,43 @@
     public void testHexBinary() throws Exception  {
     }
 
-    public void testEmptyStruct() throws Exception  {
-    }
-    public void testSimpleStruct() throws Exception  {
-    }
-
     public void testStructWithNillables() throws Exception  {
     }
-    public void testNestedStruct() throws Exception  {
-    }
 
-    public void testFixedArray() throws Exception  {
-    }
     public void testBoundedArray() throws Exception  {
+	//super.testBoundedArray();
     }
+
     public void testUnboundedArray() throws Exception  {
     }
     public void testCompoundArray() throws Exception  {
     }
     public void testNestedArray() throws Exception  {
     }
+
+    public void testAnonymousStruct() throws Exception {
+    }
+
+    public void testEmptyChoice() throws Exception {
+    }
+
+    public void testSimpleAll() throws Exception {
+    }
+
+    public void testSimpleChoice() throws Exception {
+    }
+
+    public void testNumberEnum() throws Exception {
+    }
+    public void testStringEnum() throws Exception {
+    }
+    public void testDecimalEnum() throws Exception {
+    }
+    public void testAnyURIEnum() throws Exception {
+    }
+    public void testNMTokenEnum() throws Exception {
+    }
+
 
     static abstract class CorbaTypeTestSetup extends TestSetup {
 

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptorTest.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptorTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/interceptors/CorbaInInterceptorTest.java Mon Jan 22 06:11:35 2007
@@ -136,7 +136,7 @@
     
     public void testHandleMessage() throws Exception {        
         Method m = CorbaInInterceptor.class.getDeclaredMethod("handleNotRequestMessage", 
-                new Class[] {CorbaMessage.class, CorbaDestination.class, ServiceInfo.class});                                                       
+                new Class[] {CorbaMessage.class, CorbaDestination.class});                                                       
         CorbaInInterceptor inInterceptor = EasyMock.createMock(CorbaInInterceptor.class, new Method[] {m});       
                                                     
         CorbaMessage msg = control.createMock(CorbaMessage.class);
@@ -148,7 +148,7 @@
         EasyMock.expect(bInfo.getService()).andReturn(sInfo);
         EasyMock.expect(sInfo.getExtensors(TypeMappingType.class)).andReturn(null);
         
-        inInterceptor.handleNotRequestMessage(msg, destination, sInfo);
+        inInterceptor.handleNotRequestMessage(msg, destination);
         EasyMock.expectLastCall();
         
         control.replay();
@@ -158,7 +158,7 @@
     
     public void testHandleMessage1() throws Exception {        
         Method m = CorbaInInterceptor.class.getDeclaredMethod("handleRequestMessage", 
-                new Class[] {CorbaMessage.class, CorbaDestination.class, ServiceInfo.class});                                                       
+                new Class[] {CorbaMessage.class, CorbaDestination.class});                                                       
         CorbaInInterceptor inInterceptor = EasyMock.createMock(CorbaInInterceptor.class, new Method[] {m});       
                                                     
         CorbaMessage msg = control.createMock(CorbaMessage.class);
@@ -171,7 +171,7 @@
         EasyMock.expect(sInfo.getExtensors(TypeMappingType.class)).andReturn(null);
         EasyMock.expect(msg.containsKey(Message.REQUESTOR_ROLE)).andReturn(true);
         
-        inInterceptor.handleRequestMessage(msg, destination, sInfo);
+        inInterceptor.handleRequestMessage(msg, destination);
         EasyMock.expectLastCall();
         
         control.replay();
@@ -181,7 +181,7 @@
     
     public void testHandleMessage2() throws Exception {        
         Method m = CorbaInInterceptor.class.getDeclaredMethod("handleRequestMessage", 
-                new Class[] {CorbaMessage.class, CorbaDestination.class, ServiceInfo.class});                                                       
+                new Class[] {CorbaMessage.class, CorbaDestination.class});                                                       
          CorbaInInterceptor inInterceptor = EasyMock.createMock(CorbaInInterceptor.class, new Method[] {m});       
                                                     
         CorbaMessage msg = control.createMock(CorbaMessage.class);
@@ -197,7 +197,7 @@
         EasyMock.expect(sInfo.getExtensors(TypeMappingType.class)).andReturn(null);
         EasyMock.expect(msg.containsKey(Message.REQUESTOR_ROLE)).andReturn(true);
         
-        inInterceptor.handleRequestMessage(msg, destination, sInfo);
+        inInterceptor.handleRequestMessage(msg, destination);
         EasyMock.expectLastCall();
         
         control.replay();
@@ -339,7 +339,7 @@
         EasyMock.expect(paramTypes.size()).andReturn(0);
         
         control.replay();
-        inInterceptor.prepareArguments(message, destination, info, sInfo, opType, qname);
+        inInterceptor.prepareArguments(message, destination, info, opType, qname);
         control.verify();    
     }
     

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtilsTest.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtilsTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/types/CorbaHandlerUtilsTest.java Mon Jan 22 06:11:35 2007
@@ -41,6 +41,7 @@
     protected EndpointInfo endpointInfo;
     BindingFactory factory;
     List<CorbaTypeMap> typeMaps;
+    ServiceInfo service;
     
     public CorbaHandlerUtilsTest(String arg0) {
         super(arg0);
@@ -68,7 +69,7 @@
         typeMaps = new ArrayList<CorbaTypeMap>();
         //CorbaDestination destination = (CorbaDestination)getDestination();
         CorbaDestination destination = testUtils.getComplexTypesTestDestination();
-        ServiceInfo service = destination.getBindingInfo().getService();           
+        service = destination.getBindingInfo().getService();
         List<TypeMappingType> corbaTypes = service.getExtensors(TypeMappingType.class);        
         CorbaUtils.createCorbaTypeMap(typeMaps, corbaTypes);
     }
@@ -113,43 +114,43 @@
         // Test for an array handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestArray", complexTypesPrefix);        
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaArrayHandler);
 
         // Test for an enum handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestEnum", complexTypesPrefix);
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaEnumHandler);
 
         // Test for a fixed handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestFixed", complexTypesPrefix);
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaFixedHandler);
 
         // Test for a primitive handler
         objName = new QName("object");
         objIdlType = CorbaConstants.NT_CORBA_BOOLEAN;  
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaPrimitiveHandler);
 
         // Test for a sequence handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestSequence", complexTypesPrefix);
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaSequenceHandler);
 
         // Test for a struct handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestStruct", complexTypesPrefix);
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaStructHandler);
 
         // Test for a union handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestUnion", complexTypesPrefix);
-        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.createTypeHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaUnionHandler);
     }
     
@@ -161,7 +162,7 @@
         // Test for an array handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestArray", complexTypesPrefix);
-        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaArrayHandler);
         CorbaArrayHandler arrayHandler = (CorbaArrayHandler)result;
         // WSDL defines the array to have 5 elements
@@ -171,7 +172,7 @@
         // Test for a sequence handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestSequence", complexTypesPrefix);
-        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaSequenceHandler);
         CorbaSequenceHandler seqHandler = (CorbaSequenceHandler)result;
         // This is an unbounded sequence so make sure there are no elements and the template
@@ -182,7 +183,7 @@
         // Test for a bounded sequence handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestBoundedSequence", complexTypesPrefix);
-        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaSequenceHandler);
         CorbaSequenceHandler boundedSeqHandler = (CorbaSequenceHandler)result;
         // This is a bounded sequence with WSDL defining 5 elements.
@@ -191,7 +192,7 @@
         // Test for a struct handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestStruct", complexTypesPrefix);
-        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaStructHandler);
         CorbaStructHandler structHandler = (CorbaStructHandler)result;
         // The WSDL defines this struct as having three members
@@ -200,7 +201,7 @@
         // Test for a union handler
         objName = new QName("object");
         objIdlType = new QName(complexTypesNamespaceURI, "TestUnion", complexTypesPrefix);
-        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps);
+        result = CorbaHandlerUtils.initializeObjectHandler(orb, objName, objIdlType, typeMaps, service);
         assertTrue(result instanceof CorbaUnionHandler);
     }
 }

Modified: incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd (original)
+++ incubator/yoko/trunk/bindings/src/test/resources/wsdl/type_test/type_test.xsd Mon Jan 22 06:11:35 2007
@@ -135,6 +135,15 @@
             <element name="varStruct" type="x1:SimpleStruct"/>
         </sequence>
     </complexType>
+    <complexType name="AnonymousStruct">
+        <sequence>
+            <element name="varFloat" type="float"/>
+            <sequence>
+                <element name="varInt" type="int"/>
+                <element name="varString" type="string"/>
+            </sequence>
+        </sequence>
+    </complexType>
     <complexType name="FixedArray">
         <sequence>
             <element maxOccurs="3" minOccurs="3" name="item" type="int"/>
@@ -165,6 +174,116 @@
 		     type="x1:UnboundedArray"/>
         </sequence>
     </complexType>
+
+    <!-- Simple types -->
+    
+    <!-- enumerations -->
+    
+    <simpleType name="ColourEnum">
+        <restriction base="string">
+            <enumeration value="RED"/>
+            <enumeration value="GREEN"/>
+            <enumeration value="BLUE"/>
+        </restriction>
+    </simpleType>
+    <simpleType name="NumberEnum">
+        <xsd:annotation>
+            <xsd:appinfo>
+                <jaxb:typesafeEnumClass name="NumberEnum">
+                    <jaxb:typesafeEnumMember name="ONE" value="1"/>
+                    <jaxb:typesafeEnumMember name="TWO" value="2"/>
+                    <jaxb:typesafeEnumMember name="THREE" value="3"/>
+                </jaxb:typesafeEnumClass>
+            </xsd:appinfo>
+        </xsd:annotation>
+        <restriction base="int">
+            <enumeration value="1"/>
+            <enumeration value="2"/>
+            <enumeration value="3"/>
+        </restriction>
+    </simpleType>
+    <simpleType name="StringEnum">
+        <restriction base="string">
+            <enumeration value="a b c"/>
+            <enumeration value="d e f"/>
+            <enumeration value="g h i"/>
+        </restriction>
+    </simpleType>
+    <simpleType name="DecimalEnum">
+        <xsd:annotation>
+            <xsd:appinfo>
+                <jaxb:typesafeEnumClass name="DecimalEnum">
+                    <jaxb:typesafeEnumMember name="ONE" value="-10.34"/>
+                    <jaxb:typesafeEnumMember name="TWO" value="11.22"/>
+                    <jaxb:typesafeEnumMember name="THREE" value="14.55"/>
+                </jaxb:typesafeEnumClass>
+            </xsd:appinfo>
+        </xsd:annotation>
+        <restriction base="decimal">
+            <enumeration value="-10.34"/>
+            <enumeration value="11.22"/>
+            <enumeration value="14.55"/>
+        </restriction>
+    </simpleType>
+    <simpleType name="NMTokenEnum">
+        <restriction base="NMTOKEN">
+            <enumeration value="hello"/>
+            <enumeration value="there"/>
+        </restriction>
+    </simpleType>
+
+    <simpleType name="AnyURIEnum">
+        <xsd:annotation>
+            <xsd:appinfo>
+                <jaxb:typesafeEnumClass name="AnyURIEnum"/>
+            </xsd:appinfo>
+        </xsd:annotation>
+        <restriction base="anyURI">
+            <enumeration value="http://www.iona.com">
+                <xsd:annotation>
+                    <xsd:appinfo>
+                            <jaxb:typesafeEnumMember name="IONA"/>
+                    </xsd:appinfo>
+                </xsd:annotation>
+            </enumeration>
+            <enumeration value="http://www.google.com">
+                <xsd:annotation>
+                    <xsd:appinfo>
+                            <jaxb:typesafeEnumMember name="GOOGLE"/>
+                    </xsd:appinfo>
+                </xsd:annotation>
+            </enumeration>
+        </restriction>
+    </simpleType>
+
+    <complexType name="EmptyChoice">
+        <choice/>
+    </complexType>
+
+    <complexType name="SimpleChoice">
+        <choice>
+            <element name="varFloat" type="float"/>
+            <element name="varInt" type="int"/>
+            <element name="varString" type="string"/>
+        </choice>
+        <!--CORBA MAPPING BROKEN-->
+        <!--attribute name="varAttrString" type="string"/-->
+    </complexType>
+
+    <!-- AllComplexType types -->
+    <complexType name="EmptyAll">
+        <all/>
+    </complexType>
+
+    <complexType name="SimpleAll">
+        <all>
+            <element name="varFloat" type="float"/>
+            <element name="varInt" type="int"/>
+            <element name="varString" type="string" minOccurs="0"/>
+        </all>
+        <attribute name="varAttrString" type="string"/>
+    </complexType>
+
   </itst:it_test_group>
 </schema>
 

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaHelper.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaHelper.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaHelper.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLToCorbaHelper.java Mon Jan 22 06:11:35 2007
@@ -203,10 +203,9 @@
                 if (corbatype != null) {
                     MemberType member;
                     String memberName = element.getQName().getLocalPart();
-
                     member = new MemberType();
                     member.setName(memberName);
-                    member.setIdltype(corbatype.getQName());                    
+                    member.setIdltype(corbatype.getQName());
                     members.add(member);
                 } else {
                     String msg = "Unsupported Element Found in CORBA Binding Generation:"
@@ -267,7 +266,7 @@
                 elName = createQNameTargetNamespace(element.getQName().getLocalPart());
             }
             memtype = createNillableUnion(name, elName, 
-                                             elemtype.getQName());
+                                          elemtype.getQName());
             memName = createQNameCorbaNamespace(memtype.getQName().getLocalPart());
                                     
             if (memtype != null) {                          
@@ -328,7 +327,6 @@
                 }                
             }                   
         }
-
         return membertype;
     }
 
@@ -440,17 +438,24 @@
         QName qName = createQNameXmlSchemaNamespace(typeName.getLocalPart());        
         CorbaTypeImpl corbatype = (CorbaTypeImpl)CORBAPRIMITIVEMAP.get(qName);
         if (corbatype == null) {
+            //REVISIT, bravi, not an ideal way to add the fixed & octet type to the typemap.
+            CorbaTypeImpl type = null;
             if (typeName.equals(W3CConstants.NT_SCHEMA_DECIMAL)) {
                 QName name = new QName(idlNamespace, "fixed_1");
+                type = WSDLTypes.getFixedCorbaType(name, typeName, 31, 6);
                 corbatype = WSDLTypes.getFixedCorbaType(name, typeName, 31, 6);
             } else if (typeName.equals(W3CConstants.NT_SCHEMA_BASE64)
                        || typeName.equals(W3CConstants.NT_SCHEMA_HBIN)) {
-                       //|| typeName.equals(SOAPConstants.NT_SOAP_BASE64)
-                       //|| typeName.equals(SOAPConstants.NT_SOAP_HBIN)) {
                 QName name = new QName(idlNamespace, typeName.getLocalPart() + "Seq");
+                type = WSDLTypes.getOctetCorbaType(name, typeName, 0);
                 corbatype = WSDLTypes.getOctetCorbaType(name, typeName, 0);
             }
-
+            if (type != null) {
+                type.setQName(null);
+                if (!isDuplicate(type)) {
+                    typeMappingType.getStructOrExceptionOrUnion().add(type);
+                }
+            }
         }
         return corbatype;
     }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/wsdl/WSDLTypes.java Mon Jan 22 06:11:35 2007
@@ -443,7 +443,10 @@
         fixed.setQName(name);
         fixed.setType(stype);
         fixed.setDigits(digits);
-        fixed.setScale(scale);        
+        fixed.setScale(scale);
+        fixed.setRepositoryID(WSDLToCorbaHelper.REPO_STRING
+                              + name.getLocalPart().replace('.', '/')
+                              + WSDLToCorbaHelper.IDL_VERSION);       
         return fixed;
     }
     
@@ -453,7 +456,7 @@
         fixed.setQName(name);
         fixed.setType(stype);
         fixed.setDigits(digits);
-        fixed.setScale(scale);        
+        fixed.setScale(scale);
         return fixed;
     }
     
@@ -464,6 +467,9 @@
         seq.setType(stype);        
         seq.setElemtype(CorbaConstants.NT_CORBA_OCTET);
         seq.setBound(bound);
+        seq.setRepositoryID(WSDLToCorbaHelper.REPO_STRING
+                            + name.getLocalPart().replace('.', '/')
+                            + WSDLToCorbaHelper.IDL_VERSION);
         return seq;
     }
         

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTest.java Mon Jan 22 06:11:35 2007
@@ -184,7 +184,7 @@
                 assertEquals(3, corbaOpType.getParam().size());
                 assertEquals("fixed_1", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
                 assertEquals("fixed_1", corbaOpType.getReturn().getIdltype().getLocalPart());
-                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(2);
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(0);
 
                 assertNotNull("Could not find the decimal type", fixed.getType());
                 assertEquals("Fixed digits is incorrect for the return corba parameter", 31, fixed
@@ -205,7 +205,7 @@
                 assertEquals(3, corbaOpType.getParam().size());
                 assertEquals("X.PARAM.H", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
                 assertEquals("X.H", corbaOpType.getReturn().getIdltype().getLocalPart());
-                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(1);
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(2);
                 assertNotNull("Could not find the decimal type", fixed.getType());
                 assertEquals("Fixed digits is incorrect for the return corba parameter", 10, fixed
                     .getDigits());
@@ -225,7 +225,7 @@
                 assertEquals(3, corbaOpType.getParam().size());
                 assertEquals("fixed_1", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
                 assertEquals("Z.H", corbaOpType.getReturn().getIdltype().getLocalPart());
-                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(0);
+                Fixed fixed = (Fixed)mapType.getStructOrExceptionOrUnion().get(1);
                 assertNotNull("Could not find the decimal type", fixed.getType());
                 assertEquals("Fixed digits is incorrect for the return corba parameter", 8, fixed
                     .getDigits());

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java?view=diff&rev=498617&r1=498616&r2=498617
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/WSDLToCorbaBindingTypeTest.java Mon Jan 22 06:11:35 2007
@@ -448,19 +448,19 @@
             idlgen.setOutputFile("atype.idl");
             idlgen.generateIDL(model);
 
-            Anonstring str = (Anonstring)mapType.getStructOrExceptionOrUnion().get(1);
+            Anonstring str = (Anonstring)mapType.getStructOrExceptionOrUnion().get(2);
             assertEquals("Name is incorrect for Array Type", "X._1_S", 
                          str.getName());
             assertEquals("Type is incorrect for AnonString Type", "string", 
                          str.getType().getLocalPart());
             
-            Anonfixed fx = (Anonfixed)mapType.getStructOrExceptionOrUnion().get(2);
+            Anonfixed fx = (Anonfixed)mapType.getStructOrExceptionOrUnion().get(3);
             assertEquals("Name is incorrect for Anon Array Type", "X._2_S", 
                          fx.getName());
             assertEquals("Type is incorrect for AnonFixed Type", "decimal", 
                          fx.getType().getLocalPart());
             
-            Struct struct = (Struct)mapType.getStructOrExceptionOrUnion().get(0);
+            Struct struct = (Struct)mapType.getStructOrExceptionOrUnion().get(1);
             assertEquals("Name is incorrect for Anon Array Type", "X.S", 
                          struct.getName());            
             assertEquals("Type is incorrect for Struct Type", "X.S", 



Mime
View raw message