incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eno...@apache.org
Subject svn commit: r527218 [1/2] - in /incubator/yoko/trunk: bindings/ bindings/src/test/java/org/apache/yoko/bindings/corba/ bindings/src/test/resources/idl/type_test/ tools/src/main/java/org/apache/yoko/tools/processors/idl/ tools/src/test/java/org/apache/y...
Date Tue, 10 Apr 2007 17:51:30 GMT
Author: enolan
Date: Tue Apr 10 10:51:27 2007
New Revision: 527218

URL: http://svn.apache.org/viewvc?view=rev&rev=527218
Log:
Yoko-262 - Add support for IDL scoped names
Yoko-333 - Imports generated incorrectly for in idltowsdl for ObjectReferenceTypes
Also a fix for exceptions when getting the fully qualified names.

Added:
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopedStruct.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRef.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRefGlobal.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingOperation.wsdl   (with props)
    incubator/yoko/trunk/tools/src/test/resources/idl/scopedStruct.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/scopingObjectRef.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/scopingObjectRefGlobal.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/scopingOperation.idl
Modified:
    incubator/yoko/trunk/bindings/pom.xml
    incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTestImpl.java
    incubator/yoko/trunk/bindings/src/test/resources/idl/type_test/idltowsdl_type_test.idl
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
    incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/WSDLGenerationTester.java
    incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Exception.wsdl

Modified: incubator/yoko/trunk/bindings/pom.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/pom.xml?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/bindings/pom.xml (original)
+++ incubator/yoko/trunk/bindings/pom.xml Tue Apr 10 10:51:27 2007
@@ -257,7 +257,7 @@
                         <id>idltowsdl-generate-type-test-corba-binding</id>
                         <phase>process-test-sources</phase>
                         <configuration>
-                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
+                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>                            
                             <outputDir>${basedir}/target/generated/src/test/resources/wsdl/type_test</outputDir>
 			    <idltowsdlOptions>
                                 <idltowsdlOption>

Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTestImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTestImpl.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTestImpl.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/IdlToWsdlTypeTestImpl.java Tue Apr 10 10:51:27 2007
@@ -32,11 +32,13 @@
             targetNamespace = "http://schemas.apache.org/yoko/idl/idltowsdl_type_test")
 public class IdlToWsdlTypeTestImpl implements IdltowsdlTypeTest {
     
+        
+    
     public java.lang.String greetMe(java.lang.String name) {
         return new String("Hallo there " + name);
     }
 
-    // base
+    // base       
 
     public int testAlias(int inDuration,
 			 javax.xml.ws.Holder<java.lang.Integer> inoutDuration,

Modified: incubator/yoko/trunk/bindings/src/test/resources/idl/type_test/idltowsdl_type_test.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/resources/idl/type_test/idltowsdl_type_test.idl?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/resources/idl/type_test/idltowsdl_type_test.idl (original)
+++ incubator/yoko/trunk/bindings/src/test/resources/idl/type_test/idltowsdl_type_test.idl Tue Apr 10 10:51:27 2007
@@ -18,7 +18,7 @@
  */ 
 
 interface idltowsdlTypeTest {
-
+    
     string greetMe(in string name);
 
     ////

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/IDLToWSDLProcessor.java Tue Apr 10 10:51:27 2007
@@ -91,7 +91,7 @@
         Object obj = env.get(ToolConstants.CFG_OUTPUTDIR);
         String outputDir = ".";
         if (obj != null) {
-            outputDir = obj.toString();
+            outputDir =  obj.toString();
         }
 
         // target namespace

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ObjectReferenceVisitor.java Tue Apr 10 10:51:27 2007
@@ -51,14 +51,16 @@
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 public class ObjectReferenceVisitor extends VisitorBase {
-
-    private static boolean declaredWSAImport;
+    
     private Definition wsdlDefinition;
+    private WSDLASTVisitor objRefWsdlVisitor;
     
     public ObjectReferenceVisitor(Scope scope,
                                   WSDLASTVisitor wsdlVisitor) {
         super(scope, wsdlVisitor);
         wsdlDefinition = wsdlVisitor.getDefinition();
+        objRefWsdlVisitor = wsdlVisitor;
+        
     }
 
     public static boolean accept(AST node) {
@@ -70,7 +72,7 @@
     }
     
     public void visit(AST node) {
-        if (!declaredWSAImport) {
+        if (!objRefWsdlVisitor.getDeclaredWSAImport()) {
             // We need to add an import statement to include the WS addressing types
             XmlSchemaImport wsaImport = new XmlSchemaImport();
             wsaImport.setNamespace(ReferenceConstants.WSADDRESSING_NAMESPACE);
@@ -100,7 +102,7 @@
                 // just not as clear.
             }
         }
-        declaredWSAImport = true;
+        objRefWsdlVisitor.setDeclaredWSAImport(true);
         
         // There are two types of object references we can encounter.  Each one 
         // requires us to do something differnt so we'll have methods for each
@@ -138,12 +140,45 @@
     }
     
     private void visitCustomTypeObjectReference(AST node) {
-        Scope customScope = new Scope(getScope().getParent(), node);
-        QName referenceName = new QName(schema.getTargetNamespace(),
-                                        customScope.toString() + "Ref");
+        QName bindingName = null;
+        QName referenceName = null;
+        String repositoryID = null;
+        Scope currentScope = getScope();
+        Scope customScope = null;
+        if ((node.getFirstChild() == null) || (node.getFirstChild() != null 
+            && node.getFirstChild().getType() != IDLTokenTypes.SCOPEOP)) {        
+            while (bindingName == null
+                && currentScope != currentScope.getParent()) {                
+                if (isFullyScopedName(node)) {
+                    customScope = getFullyScopedName(currentScope, node);                
+                } else {
+                    customScope = new Scope(currentScope, node);                    
+                }
+                referenceName = new QName(schema.getTargetNamespace(),
+                                                customScope.toString() + "Ref");
 
-        String repositoryID = customScope.toIDLRepositoryID();
-        QName bindingName = getBindingQNameByID(repositoryID);
+                repositoryID = customScope.toIDLRepositoryID();
+                bindingName = getBindingQNameByID(repositoryID);
+                currentScope = currentScope.getParent();
+            }
+        }
+                
+        if (bindingName == null) {
+           // Global scope is our last chance to resolve the node               
+            if (isFullyScopedName(node)) {
+                customScope = getFullyScopedName(new Scope(), node);                               
+                referenceName = new QName(schema.getTargetNamespace(),
+                                                customScope.toString() + "Ref");           
+            } else {
+                //customScope = currentScope;
+                customScope = new Scope(new Scope(), node);
+                referenceName = new QName(schema.getTargetNamespace(),
+                                               customScope.toString() + "Ref");               
+            }
+            repositoryID = customScope.toIDLRepositoryID();
+            bindingName = getBindingQNameByID(repositoryID);
+        }
+        
         if (bindingName == null) {
             // We need to have a binding for this kind of object reference to work
             throw new RuntimeException("[ObjectReferenceVisitor: No binding available for endpoint]");
@@ -154,7 +189,30 @@
         XmlSchema wsaSchema = new XmlSchema(ReferenceConstants.WSADDRESSING_NAMESPACE, schemas);
         XmlSchemaType wsaType = new XmlSchemaType(wsaSchema);
         wsaType.setName(ReferenceConstants.WSADDRESSING_LOCAL_NAME);
+        
+        // Check to see if we have already defined an element for this reference type.  If
+        // we have, then there is no need to add it to the schema again.
+        isDuplicateReference(referenceName, bindingName, wsaType);        
 
+        setSchemaType(wsaType);
+        
+        // Build and assign the corba:object to the visitor
+        Object corbaObject = new Object();
+        corbaObject.setBinding(bindingName);
+        corbaObject.setQName(new QName(typeMap.getTargetNamespace(), customScope.toString()));
+        corbaObject.setRepositoryID(repositoryID);
+        corbaObject.setType(wsaType.getQName());
+        setCorbaType(corbaObject);
+        
+        // Add the object definition to the typemap.  We only need to add the default
+        // type once.
+        if (!isReferenceCORBATypeDefined(corbaObject.getQName())) {
+            typeMap.getStructOrExceptionOrUnion().add(corbaObject);
+        } 
+    }
+    
+    private void isDuplicateReference(QName referenceName, QName bindingName, 
+                                 XmlSchemaType wsaType) {
         // Check to see if we have already defined an element for this reference type.  If
         // we have, then there is no need to add it to the schema again.
         if (!isReferenceSchemaTypeDefined(referenceName)) {
@@ -188,23 +246,7 @@
 
             schema.getElements().add(referenceName, refElement);
             schema.getItems().add(refElement);
-        }
-
-        setSchemaType(wsaType);
-        
-        // Build and assign the corba:object to the visitor
-        Object corbaObject = new Object();
-        corbaObject.setBinding(bindingName);
-        corbaObject.setQName(new QName(typeMap.getTargetNamespace(), customScope.toString()));
-        corbaObject.setRepositoryID(repositoryID);
-        corbaObject.setType(wsaType.getQName());
-        setCorbaType(corbaObject);
-        
-        // Add the object definition to the typemap.  We only need to add the default
-        // type once.
-        if (!isReferenceCORBATypeDefined(corbaObject.getQName())) {
-            typeMap.getStructOrExceptionOrUnion().add(corbaObject);
-        } 
+        }        
     }
     
     private boolean isReferenceCORBATypeDefined(QName objectReferenceName) {
@@ -262,5 +304,37 @@
         }
         
         return null;
+    }
+    
+    // Check if its a fully scoped name or in the global scope
+    private static boolean isFullyScopedName(AST node) {        
+        if (node.getType() == IDLTokenTypes.IDENT) {    
+            if (node.getFirstChild() != null) {
+                if ((node.getFirstChild().getType() == IDLTokenTypes.SCOPEOP)
+                    || (node.getFirstChild().getType() == IDLTokenTypes.IDENT)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    
+    // Get the fully scoped name 
+    private static Scope getFullyScopedName(Scope currentScope, AST node) {                    
+        Scope scopedName = new Scope();
+        if (!currentScope.toString().equals(node.getText())) {
+            scopedName = new Scope(currentScope);
+        }
+        scopedName = new Scope(scopedName, node);
+        AST scopeNode = node.getFirstChild();
+        if (node.getFirstChild().getType() == IDLTokenTypes.IDENT) {
+            scopedName = new Scope(scopedName, scopeNode);
+        }                                
+        while (scopeNode.getNextSibling() != null) {
+            scopeNode = scopeNode.getNextSibling(); 
+            scopedName = new Scope(scopedName, scopeNode);                            
+        }   
+        
+        return scopedName;
     }
 }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/OperationVisitor.java Tue Apr 10 10:51:27 2007
@@ -170,17 +170,17 @@
             && node.getType() == IDLTokenTypes.LITERAL_raises) {
             node = node.getFirstChild();
             
-            while (node != null) {
-//            ScopedNameVisitor visitor = new ScopedNameVisitor(schemas,
-//                                                              schema,
-//                                                              typeMap);
-//            visitor.visit(node);
-//            XmlSchemaType schemaType = visitor.getSchemaType();
-//            CorbaTypeImpl corbaType = visitor.getCorbaType();
-
-                createFaultMessage(node, operation, bindingOperation);
+            while (node != null) {            
+                // 
+                ScopedNameVisitor visitor = new ScopedNameVisitor(getScope(),
+                                                                  wsdlVisitor);                
+                visitor.setExceptionMode(true);
+                visitor.visit(node);                
+                CorbaTypeImpl corbaType = visitor.getCorbaType();
+                createFaultMessage(corbaType, operation, bindingOperation);
                 
                 node = node.getNextSibling();
+                visitor.setExceptionMode(false);
             }
         }
         
@@ -335,10 +335,10 @@
         corbaOperation.setReturn(param);
     }
 
-    private void createFaultMessage(AST node,
+    private void createFaultMessage(CorbaTypeImpl corbaType,
                                     Operation operation, 
                                     BindingOperation bindingOperation) {
-        String exceptionName = node.toString();
+        String exceptionName = corbaType.getQName().getLocalPart();
 
         // message
         Message faultMsg = definition.createMessage();
@@ -347,9 +347,7 @@
 
         // message - part
         Part part = definition.createPart();
-        part.setName("exception");
-        // REVISIT: should be reading QName from exception XmlSchemaElement
-        // part.setElementName(element.getQName());
+        part.setName("exception");        
         part.setElementName(new QName(definition.getTargetNamespace(), exceptionName));
         faultMsg.addPart(part);
 

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/ScopedNameVisitor.java Tue Apr 10 10:51:27 2007
@@ -37,10 +37,15 @@
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 public class ScopedNameVisitor extends VisitorBase {
+    private static boolean exceptionMode;
 
     public ScopedNameVisitor(Scope scope,
                              WSDLASTVisitor wsdlVisitor) {
-        super(scope, wsdlVisitor);
+        super(scope, wsdlVisitor);         
+    }
+    
+    public void setExceptionMode(boolean value) {
+        exceptionMode = value;
     }
     
     public static boolean accept(Scope scope,
@@ -50,7 +55,7 @@
                                  AST node) {
         boolean result = false;
         if (PrimitiveTypesVisitor.accept(node)) {
-            result = true;
+            result = true; 
         } else if (findSchemaType(scope, schemas, schema, typeMap, node) != null) {
             result = true;
         }
@@ -72,22 +77,15 @@
             primitiveVisitor.visit(node);
             
             stype = primitiveVisitor.getSchemaType();
-            ctype = primitiveVisitor.getCorbaType();
-        } else {
+            ctype = primitiveVisitor.getCorbaType();        
+        } else { 
             stype = findSchemaType(getScope(), schemas, schema, typeMap, node);
             if (stype != null) {
-                if (stype.getQName().equals(Constants.XSD_STRING)) {
-                    ctype = new CorbaTypeImpl();
-                    ctype.setName(CorbaConstants.NT_CORBA_STRING.getLocalPart());
-                    ctype.setQName(CorbaConstants.NT_CORBA_STRING);
-                    ctype.setType(Constants.XSD_STRING);
-                } else {
-                    ctype = findCorbaType(typeMap, stype.getQName());
-                }
+                ctype = getCorbaSchemaType(stype);                
             } else {
                 Scope scopedName = new Scope(getScope(), node);
                 QName qname = new QName(schema.getTargetNamespace(), scopedName.toString());
-                throw new RuntimeException("[ScopedNameVisitor: Corba type "
+                throw new RuntimeException("[ScopedNameVisitor:  Corba type "
                                            + qname
                                            + " not found in typeMap]");
             }
@@ -98,28 +96,86 @@
         
     }
     
-    private static XmlSchemaType findSchemaType(Scope scope,
+    
+    private CorbaTypeImpl getCorbaSchemaType(XmlSchemaType stype) {       
+        CorbaTypeImpl ctype = null;
+        if (stype.getQName().equals(Constants.XSD_STRING)) {
+            ctype = new CorbaTypeImpl();
+            ctype.setName(CorbaConstants.NT_CORBA_STRING.getLocalPart());
+            ctype.setQName(CorbaConstants.NT_CORBA_STRING);
+            ctype.setType(Constants.XSD_STRING);
+        } else {                    
+            QName qname = null;
+            // Revisit: Exceptions are treated as a special case.
+            // we should be able to do this in a better way.
+            if (exceptionMode) {
+                String name = null;
+                if (stype.getName().endsWith("Type")) {
+                    name = stype.getName().substring(0, stype.getName().length() - 4);
+                } else {
+                    name = stype.getName();
+                }
+                qname = new QName(schema.getTargetNamespace(), name);                     
+            } else {
+                qname = stype.getQName();      
+            }
+            ctype = findCorbaType(typeMap, qname);
+        }
+        return ctype;
+    }
+    
+    protected static XmlSchemaType findSchemaType(Scope scope,
                                                 XmlSchemaCollection schemas,
                                                 XmlSchema schema,
                                                 TypeMappingType typeMap,
                                                 AST node) {
         XmlSchemaType result = null; 
         Scope currentScope = scope;
-        while (result == null
-            && currentScope != currentScope.getParent()) {
-            // A name can be used in an unqualified form within a particular scope;
-            // it will be resolved by successvely searching farther out in enclosing
-            // scopes, while taking into consideration inheritance relationships 
-            // among interfaces. 
-            // INHERITANCE NOT IMPLEMENTED YET
-            Scope scopedName = new Scope(currentScope, node);
-            QName qname = new QName(schema.getTargetNamespace(), scopedName.toString());
-            result = schema.getTypeByName(qname);
-            currentScope = currentScope.getParent();
+        
+        if ((node.getFirstChild() == null) || (node.getFirstChild() != null 
+            && node.getFirstChild().getType() != IDLTokenTypes.SCOPEOP)) {        
+            while (result == null
+                && currentScope != currentScope.getParent()) {
+                // A name can be used in an unqualified form within a particular scope;
+                // it will be resolved by successvely searching farther out in enclosing
+                // scopes, while taking into consideration inheritance relationships 
+                // among interfaces. 
+                // INHERITANCE NOT IMPLEMENTED YET
+                Scope scopedName = null;
+                if (isFullyScopedName(node)) {
+                    scopedName = getFullyScopedName(currentScope, node);                
+                } else {
+                    scopedName = new Scope(currentScope, node);
+                }
+                QName qname = null;
+                
+                //Exceptions are treated as a special case as for the doc/literal style
+                // in the schema we will have an element and a complextype so the name
+                // and the typename will be different.
+                if (exceptionMode) {
+                    qname = new QName(schema.getTargetNamespace(), scopedName.toString() + "Type");
+                } else {
+                    qname = new QName(schema.getTargetNamespace(), scopedName.toString());      
+                }
+                //QName qname = new QName(schema.getTargetNamespace(), scopedName.toString());
+                result = schema.getTypeByName(qname);
+                currentScope = currentScope.getParent();
+            }
         }
         if (result == null) {
             // Global scope is our last chance to resolve the node
-            QName qname = new QName(schema.getTargetNamespace(), node.toString());
+            QName qname = null;
+            if (isFullyScopedName(node)) {
+                Scope scopedName = getFullyScopedName(new Scope(), node);                               
+                qname = new QName(schema.getTargetNamespace(), scopedName.toString());
+            } else {
+                qname = new QName(schema.getTargetNamespace(), node.toString());
+            }
+           
+            // 
+            if (exceptionMode) {
+                qname = new QName(schema.getTargetNamespace(), qname.getLocalPart() + "Type");
+            }
             result = schema.getTypeByName(qname);
         }
             
@@ -162,6 +218,36 @@
             }
         }
         return result;
+    }
+    
+    private static boolean isFullyScopedName(AST node) {        
+        if (node.getType() == IDLTokenTypes.IDENT) {    
+            if (node.getFirstChild() != null) {
+                if ((node.getFirstChild().getType() == IDLTokenTypes.SCOPEOP)
+                    || (node.getFirstChild().getType() == IDLTokenTypes.IDENT)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+    
+    private static Scope getFullyScopedName(Scope currentScope, AST node) {
+        Scope scopedName = new Scope();
+        if (!currentScope.toString().equals(node.getText())) {
+            scopedName = new Scope(currentScope);
+        }
+        scopedName = new Scope(scopedName, node);
+        AST scopeNode = node.getFirstChild();
+        if (node.getFirstChild().getType() == IDLTokenTypes.IDENT) {
+            scopedName = new Scope(scopedName, scopeNode);
+        }                                
+        while (scopeNode.getNextSibling() != null) {
+            scopeNode = scopeNode.getNextSibling(); 
+            scopedName = new Scope(scopedName, scopeNode);                            
+        }   
+        
+        return scopedName;
     }
 
 }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java (original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/WSDLASTVisitor.java Tue Apr 10 10:51:27 2007
@@ -64,12 +64,12 @@
 
 public class WSDLASTVisitor implements ASTVisitor {
     
-    Definition definition;
-
-    XmlSchema schema;
-    XmlSchemaCollection schemas;
     
+    Definition definition;    
+    XmlSchema schema;
+    XmlSchemaCollection schemas;    
     TypeMappingType typeMap;
+    private boolean declaredWSAImport;
 
     private XmlSchemaType sequenceOctetType;
     private boolean boundedStringOverride;
@@ -81,6 +81,7 @@
         
         schemas = new XmlSchemaCollection();
         schema = createSchema(schemans);
+        declaredWSAImport = false;
         
         addAnyType();
         
@@ -105,7 +106,8 @@
         }
         
         try {
-            attachSchema();
+            //attachImport();
+            attachSchema();            
         } catch (Exception ex) {
             throw new RuntimeException(ex);
         }
@@ -259,7 +261,7 @@
         }
         org.w3c.dom.Element el = XmlSchemaSerializer.serializeSchema(schema, true)[0].getDocumentElement();
         wsdlSchema.setElement(el);
-        
+                
         types.addExtensibilityElement(wsdlSchema);
 
         definition.setTypes(types);
@@ -277,5 +279,48 @@
                 }
             }
         }
+    }
+    
+    /*private void attachImport() {
+        if (!declaredWSAImport) {
+            // We need to add an import statement to include the WS addressing types
+            XmlSchemaImport wsaImport = new XmlSchemaImport();
+            wsaImport.setNamespace(ReferenceConstants.WSADDRESSING_NAMESPACE);
+            wsaImport.setSchemaLocation(ReferenceConstants.WSADDRESSING_LOCATION);
+            schema.getItems().add(wsaImport);
+            
+            // Add the addressing namespace to the WSDLs list of namespaces.
+            definition.addNamespace(ReferenceConstants.WSADDRESSING_PREFIX,
+                                        ReferenceConstants.WSADDRESSING_NAMESPACE);
+            
+            try {
+                // This is used to get the correct prefix in the schema section of
+                // the wsdl.  If we don't have this, then this namespace gets an 
+                // arbitrary prefix (e.g. ns5 instead of wsa).
+                NamespaceMap nsMap = (NamespaceMap)schema.getNamespaceContext();
+                if (nsMap == null) {
+                    nsMap = new NamespaceMap();
+                    nsMap.add(ReferenceConstants.WSADDRESSING_PREFIX, 
+                              ReferenceConstants.WSADDRESSING_NAMESPACE);
+                    schema.setNamespaceContext(nsMap);
+                } else {
+                    nsMap.add(ReferenceConstants.WSADDRESSING_PREFIX, 
+                              ReferenceConstants.WSADDRESSING_NAMESPACE);
+                }
+            } catch (ClassCastException ex) {
+                // Consume the exception.  It is still OK with the default prefix, 
+                // just not as clear.
+            }
+        }
+        declaredWSAImport = true;
+        
+    }*/
+    
+    public boolean getDeclaredWSAImport() {
+        return declaredWSAImport;
+    }
+    
+    public void setDeclaredWSAImport(boolean declaredImport) {
+        declaredWSAImport = declaredImport;        
     }
 }

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/processors/IDLToWSDLGenerationTest.java Tue Apr 10 10:51:27 2007
@@ -58,14 +58,14 @@
     
     public void testWSDLGeneration(String sourceIdlFilename, 
                                    String expectedWsdlFilename) 
-        throws Exception {      
+        throws Exception {
         URL idl = getClass().getResource(sourceIdlFilename);
         ProcessorEnvironment env = new ProcessorEnvironment();
         Map<String, Object> cfg = new HashMap<String, Object>();
         cfg.put(ToolCorbaConstants.CFG_IDLFILE, idl.getFile());
         env.setParameters(cfg);
         IDLToWSDLProcessor processor = new IDLToWSDLProcessor();
-        processor.setEnvironment(env);
+        processor.setEnvironment(env);        
         java.io.CharArrayWriter out = new java.io.CharArrayWriter();
         processor.setOutputWriter(out);
         processor.process();
@@ -79,7 +79,7 @@
         wsdlGenTester.compare(orig, actual);
 
     }
-
+    
     public void testHelloWorldWSDLGeneration() throws Exception {
         testWSDLGeneration("/idl/HelloWorld.idl", "/idl/expected_HelloWorld.wsdl");
     }
@@ -95,6 +95,10 @@
     public void testStructGeneration() throws Exception {
         testWSDLGeneration("/idl/Struct.idl", "/idl/expected_Struct.wsdl");
     }
+    
+    public void testScopedStructGeneration() throws Exception {
+        testWSDLGeneration("/idl/scopedStruct.idl", "/idl/expected_scopedStruct.wsdl");
+    }
 
     public void testOnewayGeneration() throws Exception {
         testWSDLGeneration("/idl/Oneway.idl", "/idl/expected_Oneway.wsdl");
@@ -154,11 +158,28 @@
 
     public void testMultipleDeclaratorsGeneration() throws Exception {
         testWSDLGeneration("/idl/Declarators.idl", "/idl/expected_Declarators.wsdl");
-    }
-
+    }   
+    
     public void testObjectReferenceGeneration() throws Exception {
         testWSDLGeneration("/idl/ObjectRef.idl", "/idl/expected_ObjectRef.wsdl");
     }
+    
+    
+    public void testScopingOperationGeneration() throws Exception {
+        testWSDLGeneration("/idl/scopingOperation.idl", "/idl/expected_scopingOperation.wsdl");
+    }
+    
+    public void testScopingObjectRefGlobalGeneration() throws Exception {
+        testWSDLGeneration("/idl/scopingObjectRefGlobal.idl", "/idl/expected_scopingObjectRefGlobal.wsdl");
+    }
+    
+    public void testScopingObjectRefGeneration() throws Exception {
+        testWSDLGeneration("/idl/scopingObjectRef.idl", "/idl/expected_scopingObjectRef.wsdl");
+    }
+    
+    
+    
+    
 
     public void testIncludeGeneration() throws Exception {
         testWSDLGeneration("/idl/included.idl", "/idl/expected_Included.wsdl");

Modified: incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/WSDLGenerationTester.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/WSDLGenerationTester.java?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/WSDLGenerationTester.java (original)
+++ incubator/yoko/trunk/tools/src/test/java/org/apache/yoko/tools/utils/WSDLGenerationTester.java Tue Apr 10 10:51:27 2007
@@ -1,17 +1,13 @@
 package org.apache.yoko.tools.utils;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamReader;
 
 import junit.framework.Assert;
 
 public class WSDLGenerationTester {
-    
-    XMLInputFactory factory;
-    
-    public WSDLGenerationTester() {
-        factory = XMLInputFactory.newInstance();
+       
+    public WSDLGenerationTester() {    
     }
     
     public void compare(XMLStreamReader orig, XMLStreamReader actual)
@@ -54,7 +50,7 @@
     }
 
     private void compareStartElement(XMLStreamReader orig, XMLStreamReader actual)
-        throws Exception {
+        throws Exception {        
         Assert.assertEquals("Start element is not matched", orig.getName(), actual.getName());
         Assert.assertEquals("Attribute count is not matched for element " + orig.getName(),
                      orig.getAttributeCount(),

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/ObjectRef.idl Tue Apr 10 10:51:27 2007
@@ -38,3 +38,4 @@
          void barOp(in foo fooPar);
      };
 }; 
+

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Exception.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Exception.wsdl?view=diff&rev=527218&r1=527217&r2=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Exception.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Exception.wsdl Tue Apr 10 10:51:27 2007
@@ -20,12 +20,12 @@
 <wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/Exception" xmlns:tns="http://schemas.apache.org/yoko/idl/Exception" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
   <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/Exception/typemap">
     <corba:exception xmlns:ns4="http://schemas.apache.org/yoko/idl/Exception" xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" repositoryID="IDL:ExternalException:1.0" name="ExternalException" type="ns4:ExternalExceptionType">
-      <corba:member idltype="corba:string" name="description" />
+      <corba:member name="description" idltype="corba:string" />
     </corba:exception>
     <corba:exception xmlns:ns4="http://schemas.apache.org/yoko/idl/Exception" xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" repositoryID="IDL:InterfaceWithExceptions/EmptyException:1.0" name="InterfaceWithExceptions.EmptyException" type="ns4:InterfaceWithExceptions.EmptyExceptionType" />
     <corba:exception xmlns:ns4="http://schemas.apache.org/yoko/idl/Exception" xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" repositoryID="IDL:InterfaceWithExceptions/LongException:1.0" name="InterfaceWithExceptions.LongException" type="ns4:InterfaceWithExceptions.LongExceptionType">
-      <corba:member idltype="corba:string" name="error" />
-      <corba:member idltype="corba:long" name="code" />
+      <corba:member name="error" idltype="corba:string" />
+      <corba:member name="code" idltype="corba:long" />
     </corba:exception>
   </corba:typeMapping>
   <wsdl:types>
@@ -92,8 +92,8 @@
       </xs:element>
     </xs:schema>
   </wsdl:types>
-  <wsdl:message name="LongException">
-    <wsdl:part name="exception" element="tns:LongException">
+  <wsdl:message name="InterfaceWithExceptions.LongException">
+    <wsdl:part name="exception" element="tns:InterfaceWithExceptions.LongException">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="method">
@@ -108,14 +108,14 @@
     <wsdl:part name="outparameter" element="tns:methodResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="EmptyException">
-    <wsdl:part name="exception" element="tns:EmptyException">
-    </wsdl:part>
-  </wsdl:message>
   <wsdl:message name="raiseExternalExceptionResponse">
     <wsdl:part name="outparameter" element="tns:raiseExternalExceptionResponse">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="InterfaceWithExceptions.EmptyException">
+    <wsdl:part name="exception" element="tns:InterfaceWithExceptions.EmptyException">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="raiseExternalException">
     <wsdl:part name="inparameter" element="tns:raiseExternalException">
     </wsdl:part>
@@ -126,9 +126,9 @@
     </wsdl:input>
       <wsdl:output name="methodResponse" message="tns:methodResponse">
     </wsdl:output>
-      <wsdl:fault name="LongException" message="tns:LongException">
+      <wsdl:fault name="InterfaceWithExceptions.EmptyException" message="tns:InterfaceWithExceptions.EmptyException">
     </wsdl:fault>
-      <wsdl:fault name="EmptyException" message="tns:EmptyException">
+      <wsdl:fault name="InterfaceWithExceptions.LongException" message="tns:InterfaceWithExceptions.LongException">
     </wsdl:fault>
     </wsdl:operation>
     <wsdl:operation name="raiseExternalException">
@@ -144,25 +144,25 @@
     <corba:binding repositoryID="IDL:InterfaceWithExceptions:1.0" />
     <wsdl:operation name="method">
       <corba:operation name="method">
-        <corba:param mode="in" idltype="corba:string" name="in_string" />
-        <corba:param mode="out" idltype="corba:long" name="out_long" />
-        <corba:param mode="inout" idltype="corba:short" name="inout_short" />
-        <corba:return idltype="corba:string" name="return" />
-        <corba:raises xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" exception="LongException" />
-        <corba:raises xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" exception="EmptyException" />
+        <corba:param mode="in" name="in_string" idltype="corba:string" />
+        <corba:param mode="out" name="out_long" idltype="corba:long" />
+        <corba:param mode="inout" name="inout_short" idltype="corba:short" />
+        <corba:return name="return" idltype="corba:string" />
+        <corba:raises xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" exception="InterfaceWithExceptions.LongException" />
+        <corba:raises xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" exception="InterfaceWithExceptions.EmptyException" />
       </corba:operation>
       <wsdl:input name="methodRequest">
       </wsdl:input>
       <wsdl:output name="methodResponse">
       </wsdl:output>
-      <wsdl:fault name="LongException">
+      <wsdl:fault name="InterfaceWithExceptions.EmptyException">
       </wsdl:fault>
-      <wsdl:fault name="EmptyException">
+      <wsdl:fault name="InterfaceWithExceptions.LongException">
       </wsdl:fault>
     </wsdl:operation>
     <wsdl:operation name="raiseExternalException">
       <corba:operation name="raiseExternalException">
-        <corba:param mode="in" idltype="corba:string" name="aString" />
+        <corba:param mode="in" name="aString" idltype="corba:string" />
         <corba:raises xmlns="http://schemas.apache.org/yoko/idl/Exception/typemap" exception="ExternalException" />
       </corba:operation>
       <wsdl:input name="raiseExternalExceptionRequest">

Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopedStruct.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopedStruct.wsdl?view=auto&rev=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopedStruct.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopedStruct.wsdl Tue Apr 10 10:51:27 2007
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns:tns="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/scopedStruct/typemap">
+    <corba:struct xmlns:ns4="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" repositoryID="IDL:globalStruct:1.0" name="globalStruct" type="ns4:globalStruct">
+      <corba:member name="time" idltype="corba:long" />
+    </corba:struct>
+    <corba:struct xmlns:ns4="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" repositoryID="IDL:firstModule/firstInterface/firstStruct:1.0" name="firstModule.firstInterface.firstStruct" type="ns4:firstModule.firstInterface.firstStruct">
+      <corba:member name="number" idltype="corba:long" />
+      <corba:member name="word" idltype="corba:string" />
+    </corba:struct>
+    <corba:struct xmlns:ns4="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" repositoryID="IDL:secondModule/secondInterface/secondStruct:1.0" name="secondModule.secondInterface.secondStruct" type="ns4:secondModule.secondInterface.secondStruct">
+      <corba:member name="hour" idltype="globalStruct" />
+      <corba:member name="minute" idltype="firstModule.firstInterface.firstStruct" />
+      <corba:member name="second" idltype="firstModule.firstInterface.firstStruct" />
+      <corba:member name="currency" idltype="corba:string" />
+      <corba:member name="praise" idltype="corba:string" />
+    </corba:struct>
+  </corba:typeMapping>
+  <wsdl:types>
+    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns="http://schemas.apache.org/yoko/idl/scopedStruct" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:complexType name="globalStruct">
+        <xs:sequence>
+          <xs:element name="time" type="xs:int">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="firstModule.firstInterface.firstStruct">
+        <xs:sequence>
+          <xs:element name="number" type="xs:int">
+          </xs:element>
+          <xs:element name="word" type="xs:string">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="secondModule.secondInterface.secondStruct">
+        <xs:sequence>
+          <xs:element name="hour" type="globalStruct">
+          </xs:element>
+          <xs:element name="minute" type="firstModule.firstInterface.firstStruct">
+          </xs:element>
+          <xs:element name="second" type="firstModule.firstInterface.firstStruct">
+          </xs:element>
+          <xs:element name="currency" type="xs:string">
+          </xs:element>
+          <xs:element name="praise" type="xs:string">
+          </xs:element>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:element name="congratulate">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="str" type="globalStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="congratulateResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="reward" type="secondModule.secondInterface.secondStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="secondOp">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="fst" type="firstModule.firstInterface.firstStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="secondOpResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="dest" type="firstModule.firstInterface.firstStruct">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:schema>
+  </wsdl:types>
+  <wsdl:message name="congratulateResponse">
+    <wsdl:part name="outparameter" element="tns:congratulateResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="congratulate">
+    <wsdl:part name="inparameter" element="tns:congratulate">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="secondOpResponse">
+    <wsdl:part name="outparameter" element="tns:secondOpResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="secondOp">
+    <wsdl:part name="inparameter" element="tns:secondOp">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="secondModule.secondInterface">
+    <wsdl:operation name="congratulate">
+      <wsdl:input name="congratulateRequest" message="tns:congratulate">
+    </wsdl:input>
+      <wsdl:output name="congratulateResponse" message="tns:congratulateResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="secondOp">
+      <wsdl:input name="secondOpRequest" message="tns:secondOp">
+    </wsdl:input>
+      <wsdl:output name="secondOpResponse" message="tns:secondOpResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="firstModule.firstInterface">
+  </wsdl:portType>
+  <wsdl:binding name="secondModule.secondInterfaceCORBABinding" type="tns:secondModule.secondInterface">
+    <corba:binding repositoryID="IDL:secondModule/secondInterface:1.0" />
+    <wsdl:operation name="congratulate">
+      <corba:operation name="congratulate">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" mode="in" name="str" idltype="globalStruct" />
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" mode="out" name="reward" idltype="secondModule.secondInterface.secondStruct" />
+      </corba:operation>
+      <wsdl:input name="congratulateRequest">
+      </wsdl:input>
+      <wsdl:output name="congratulateResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="secondOp">
+      <corba:operation name="secondOp">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" mode="in" name="fst" idltype="firstModule.firstInterface.firstStruct" />
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopedStruct/typemap" mode="out" name="dest" idltype="firstModule.firstInterface.firstStruct" />
+      </corba:operation>
+      <wsdl:input name="secondOpRequest">
+      </wsdl:input>
+      <wsdl:output name="secondOpResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:binding name="firstModule.firstInterfaceCORBABinding" type="tns:firstModule.firstInterface">
+    <corba:binding repositoryID="IDL:firstModule/firstInterface:1.0" />
+  </wsdl:binding>
+  <wsdl:service name="firstModule.firstInterfaceCORBAService">
+    <wsdl:port name="firstModule.firstInterfaceCORBAPort" binding="tns:firstModule.firstInterfaceCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="secondModule.secondInterfaceCORBAService">
+    <wsdl:port name="secondModule.secondInterfaceCORBAPort" binding="tns:secondModule.secondInterfaceCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

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

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

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

Added: incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRef.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRef.wsdl?view=auto&rev=527218
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRef.wsdl (added)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_scopingObjectRef.wsdl Tue Apr 10 10:51:27 2007
@@ -0,0 +1,410 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/scopingObjectRef" xmlns:tns="http://schemas.apache.org/yoko/idl/scopingObjectRef" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap">
+    <corba:object xmlns:ns4="http://www.w3.org/2005/08/addressing" xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" repositoryID="IDL:omg.org/CORBA/Object/1.0" name="CORBA.Object" type="ns4:EndpointReferenceType" />
+    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef" binding="TestModule.Test2.TestObjectCORBABinding" repositoryID="IDL:TestModule/Test2/TestObject:1.0" name="ns4:TestModule.Test2.TestObject" type="ns5:EndpointReferenceType" />
+    <corba:object xmlns:ns5="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef" binding="foobar.fooCORBABinding" repositoryID="IDL:foobar/foo:1.0" name="ns4:foobar.foo" type="ns5:EndpointReferenceType" />
+  </corba:typeMapping>
+  <wsdl:types>
+    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/scopingObjectRef" xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="http://www.w3.org/2005/08/addressing/ws-addr.xsd">
+      </xs:import>
+      <xs:element name="testObjectValue">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testObjectValueResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:int">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testObjectValueUpdate">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="value" type="xs:int">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testObjectValueUpdateResponse">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testDefaultObjectParam">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="param" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testDefaultObjectParamResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:boolean">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testDefaultObjectReturn">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testDefaultObjectReturnResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectParam">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="param" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectParamResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:boolean">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="TestModule.Test2.TestObjectRef" type="wsa:EndpointReferenceType">
+        <xs:annotation>
+          <xs:appinfo>
+          </xs:appinfo>
+        </xs:annotation>
+      </xs:element>
+      <xs:element name="testCustomObjectReturn">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectReturnResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectParam">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="param" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectParamResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="xs:boolean">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectReturn">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testCustomObjectReturnResponse">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="return" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="barOp">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element name="fooPar" type="wsa:EndpointReferenceType">
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="barOpResponse">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="foobar.fooRef" type="wsa:EndpointReferenceType">
+        <xs:annotation>
+          <xs:appinfo>
+          </xs:appinfo>
+        </xs:annotation>
+      </xs:element>
+    </xs:schema>
+  </wsdl:types>
+  <wsdl:message name="testObjectValueResponse">
+    <wsdl:part name="outparameter" element="tns:testObjectValueResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testCustomObjectParamResponse">
+    <wsdl:part name="outparameter" element="tns:testCustomObjectParamResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testDefaultObjectReturnResponse">
+    <wsdl:part name="outparameter" element="tns:testDefaultObjectReturnResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="barOp">
+    <wsdl:part name="inparameter" element="tns:barOp">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testObjectValueUpdate">
+    <wsdl:part name="inparameter" element="tns:testObjectValueUpdate">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testObjectValue">
+    <wsdl:part name="inparameter" element="tns:testObjectValue">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="barOpResponse">
+    <wsdl:part name="outparameter" element="tns:barOpResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testCustomObjectReturnResponse">
+    <wsdl:part name="outparameter" element="tns:testCustomObjectReturnResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testDefaultObjectReturn">
+    <wsdl:part name="inparameter" element="tns:testDefaultObjectReturn">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testDefaultObjectParam">
+    <wsdl:part name="inparameter" element="tns:testDefaultObjectParam">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testCustomObjectParam">
+    <wsdl:part name="inparameter" element="tns:testCustomObjectParam">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testObjectValueUpdateResponse">
+    <wsdl:part name="outparameter" element="tns:testObjectValueUpdateResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testDefaultObjectParamResponse">
+    <wsdl:part name="outparameter" element="tns:testDefaultObjectParamResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="testCustomObjectReturn">
+    <wsdl:part name="inparameter" element="tns:testCustomObjectReturn">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="foobar.foo">
+  </wsdl:portType>
+  <wsdl:portType name="TestInterface">
+    <wsdl:operation name="testDefaultObjectParam">
+      <wsdl:input name="testDefaultObjectParamRequest" message="tns:testDefaultObjectParam">
+    </wsdl:input>
+      <wsdl:output name="testDefaultObjectParamResponse" message="tns:testDefaultObjectParamResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testDefaultObjectReturn">
+      <wsdl:input name="testDefaultObjectReturnRequest" message="tns:testDefaultObjectReturn">
+    </wsdl:input>
+      <wsdl:output name="testDefaultObjectReturnResponse" message="tns:testDefaultObjectReturnResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectParam">
+      <wsdl:input name="testCustomObjectParamRequest" message="tns:testCustomObjectParam">
+    </wsdl:input>
+      <wsdl:output name="testCustomObjectParamResponse" message="tns:testCustomObjectParamResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectReturn">
+      <wsdl:input name="testCustomObjectReturnRequest" message="tns:testCustomObjectReturn">
+    </wsdl:input>
+      <wsdl:output name="testCustomObjectReturnResponse" message="tns:testCustomObjectReturnResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectParam">
+      <wsdl:input name="testCustomObjectParamRequest" message="tns:testCustomObjectParam">
+    </wsdl:input>
+      <wsdl:output name="testCustomObjectParamResponse" message="tns:testCustomObjectParamResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectReturn">
+      <wsdl:input name="testCustomObjectReturnRequest" message="tns:testCustomObjectReturn">
+    </wsdl:input>
+      <wsdl:output name="testCustomObjectReturnResponse" message="tns:testCustomObjectReturnResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="TestModule.Test2.TestObject">
+    <wsdl:operation name="testObjectValue">
+      <wsdl:input name="testObjectValueRequest" message="tns:testObjectValue">
+    </wsdl:input>
+      <wsdl:output name="testObjectValueResponse" message="tns:testObjectValueResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testObjectValueUpdate">
+      <wsdl:input name="testObjectValueUpdateRequest" message="tns:testObjectValueUpdate">
+    </wsdl:input>
+      <wsdl:output name="testObjectValueUpdateResponse" message="tns:testObjectValueUpdateResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="foobar.bar">
+    <wsdl:operation name="barOp">
+      <wsdl:input name="barOpRequest" message="tns:barOp">
+    </wsdl:input>
+      <wsdl:output name="barOpResponse" message="tns:barOpResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="foobar.fooCORBABinding" type="tns:foobar.foo">
+    <corba:binding repositoryID="IDL:foobar/foo:1.0" />
+  </wsdl:binding>
+  <wsdl:binding name="TestInterfaceCORBABinding" type="tns:TestInterface">
+    <corba:binding repositoryID="IDL:TestInterface:1.0" />
+    <wsdl:operation name="testDefaultObjectParam">
+      <corba:operation name="testDefaultObjectParam">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" mode="in" name="param" idltype="CORBA.Object" />
+        <corba:return name="return" idltype="corba:boolean" />
+      </corba:operation>
+      <wsdl:input name="testDefaultObjectParamRequest">
+      </wsdl:input>
+      <wsdl:output name="testDefaultObjectParamResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testDefaultObjectReturn">
+      <corba:operation name="testDefaultObjectReturn">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" name="return" idltype="CORBA.Object" />
+      </corba:operation>
+      <wsdl:input name="testDefaultObjectReturnRequest">
+      </wsdl:input>
+      <wsdl:output name="testDefaultObjectReturnResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectParam">
+      <corba:operation name="testCustomObjectParam">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" mode="in" name="param" idltype="TestModule.Test2.TestObject" />
+        <corba:return name="return" idltype="corba:boolean" />
+      </corba:operation>
+      <wsdl:input name="testCustomObjectParamRequest">
+      </wsdl:input>
+      <wsdl:output name="testCustomObjectParamResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectReturn">
+      <corba:operation name="testCustomObjectReturn">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" name="return" idltype="TestModule.Test2.TestObject" />
+      </corba:operation>
+      <wsdl:input name="testCustomObjectReturnRequest">
+      </wsdl:input>
+      <wsdl:output name="testCustomObjectReturnResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectParam">
+      <corba:operation name="testCustomObjectParam">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" mode="in" name="param" idltype="TestModule.Test2.TestObject" />
+        <corba:return name="return" idltype="corba:boolean" />
+      </corba:operation>
+      <wsdl:input name="testCustomObjectParamRequest">
+      </wsdl:input>
+      <wsdl:output name="testCustomObjectParamResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testCustomObjectReturn">
+      <corba:operation name="testCustomObjectReturn">
+        <corba:return xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" name="return" idltype="TestModule.Test2.TestObject" />
+      </corba:operation>
+      <wsdl:input name="testCustomObjectReturnRequest">
+      </wsdl:input>
+      <wsdl:output name="testCustomObjectReturnResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:binding name="foobar.barCORBABinding" type="tns:foobar.bar">
+    <corba:binding repositoryID="IDL:foobar/bar:1.0" />
+    <wsdl:operation name="barOp">
+      <corba:operation name="barOp">
+        <corba:param xmlns="http://schemas.apache.org/yoko/idl/scopingObjectRef/typemap" mode="in" name="fooPar" idltype="foobar.foo" />
+      </corba:operation>
+      <wsdl:input name="barOpRequest">
+      </wsdl:input>
+      <wsdl:output name="barOpResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:binding name="TestModule.Test2.TestObjectCORBABinding" type="tns:TestModule.Test2.TestObject">
+    <corba:binding repositoryID="IDL:TestModule/Test2/TestObject:1.0" />
+    <wsdl:operation name="testObjectValue">
+      <corba:operation name="testObjectValue">
+        <corba:return name="return" idltype="corba:long" />
+      </corba:operation>
+      <wsdl:input name="testObjectValueRequest">
+      </wsdl:input>
+      <wsdl:output name="testObjectValueResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testObjectValueUpdate">
+      <corba:operation name="testObjectValueUpdate">
+        <corba:param mode="in" name="value" idltype="corba:long" />
+      </corba:operation>
+      <wsdl:input name="testObjectValueUpdateRequest">
+      </wsdl:input>
+      <wsdl:output name="testObjectValueUpdateResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="TestModule.Test2.TestObjectCORBAService">
+    <wsdl:port name="TestModule.Test2.TestObjectCORBAPort" binding="tns:TestModule.Test2.TestObjectCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="foobar.fooCORBAService">
+    <wsdl:port name="foobar.fooCORBAPort" binding="tns:foobar.fooCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="foobar.barCORBAService">
+    <wsdl:port name="foobar.barCORBAPort" binding="tns:foobar.barCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+  <wsdl:service name="TestInterfaceCORBAService">
+    <wsdl:port name="TestInterfaceCORBAPort" binding="tns:TestInterfaceCORBABinding">
+      <corba:address location="IOR:" />
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

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

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

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



Mime
View raw message