incubator-yoko-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mvesc...@apache.org
Subject svn commit: r512875 - in /incubator/yoko/trunk/tools/src: main/java/org/apache/yoko/tools/processors/idl/ test/resources/idl/
Date Wed, 28 Feb 2007 17:54:41 GMT
Author: mvescovi
Date: Wed Feb 28 09:54:40 2007
New Revision: 512875

URL: http://svn.apache.org/viewvc?view=rev&rev=512875
Log:
[YOKO-299] Fix to map idl:sequence<octect> to xs:base64Binary. Still have to add support
for -s hexBinary flag

Modified:
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
    incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonboundedsequence.wsdl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonsequence.wsdl
    incubator/yoko/trunk/tools/src/test/resources/idl/expected_Sequence.wsdl

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java?view=diff&rev=512875&r1=512874&r2=512875
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/DeclaratorVisitor.java
Wed Feb 28 09:54:40 2007
@@ -69,9 +69,11 @@
 
         } else {
             // add schemaType
-            schema.getItems().add(getSchemaType());
-            schema.addType(getSchemaType());
-
+            if (schemas.getTypeByQName(getSchemaType().getQName()) == null) {
+                schema.getItems().add(getSchemaType());
+                schema.addType(getSchemaType());
+            }
+            
             // add corbaType
             typeMap.getStructOrExceptionOrUnion().add(getCorbaType());
         }

Modified: incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java?view=diff&rev=512875&r1=512874&r2=512875
==============================================================================
--- incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
(original)
+++ incubator/yoko/trunk/tools/src/main/java/org/apache/yoko/tools/processors/idl/SequenceVisitor.java
Wed Feb 28 09:54:40 2007
@@ -34,6 +34,8 @@
 import org.apache.ws.commons.schema.XmlSchemaSequence;
 import org.apache.ws.commons.schema.XmlSchemaType;
 
+import org.apache.ws.commons.schema.constants.Constants;
+
 import org.apache.yoko.wsdl.CorbaTypeImpl;
 
 public class SequenceVisitor extends VisitorBase {
@@ -90,9 +92,16 @@
         } else {
             scopedName = new Scope(getScope(), identifierNode);
         }
-        
-        XmlSchemaType schemaType = generateSchemaType(stype, scopedName, bound);
 
+        XmlSchemaType schemaType = null;
+        if (stype != schemas.getTypeByQName(Constants.XSD_UNSIGNEDBYTE)) {
+            schemaType = generateSchemaType(stype, scopedName, bound);
+        } else {
+            // According to CORBA Binding for WSDL specification,
+            // idl:sequence<octet> maps to xs:base64Binary by default.
+            schemaType = schemas.getTypeByQName(Constants.XSD_BASE64);
+        }
+        
         CorbaTypeImpl corbaType = null;
         if (identifierNode == null) {
             corbaType = generateCorbaAnonsequence(ctype,
@@ -162,9 +171,11 @@
         result.setElemtype(ctype.getQName());
 
         // add schemaType
-        schema.getItems().add(schemaType);
-        schema.addType(schemaType);
-
+        if (schemas.getTypeByQName(schemaType.getQName()) == null) {
+            schema.getItems().add(schemaType);
+            schema.addType(schemaType);
+        }
+        
         // add corbaType
         typeMap.getStructOrExceptionOrUnion().add(result);
         

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonboundedsequence.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonboundedsequence.wsdl?view=diff&rev=512875&r1=512874&r2=512875
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonboundedsequence.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonboundedsequence.wsdl Wed
Feb 28 09:54:40 2007
@@ -114,7 +114,7 @@
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonboundedsequence"
xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap" elemtype="anonBoundedSequences._1_myWcharBoundedSeqSeq"
bound="0" repositoryID="IDL:anonBoundedSequences/myWcharBoundedSeqSeq:1.0" name="anonBoundedSequences.myWcharBoundedSeqSeq"
type="ns4:anonBoundedSequences.myWcharBoundedSeqSeq" />
     <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonboundedsequence"
xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap" elemtype="corba:boolean"
bound="5" name="anonBoundedSequences._1_myBooleanBoundedSeqSeq" type="ns4:anonBoundedSequences._1_myBooleanBoundedSeqSeq"
/>
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonboundedsequence"
xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap" elemtype="anonBoundedSequences._1_myBooleanBoundedSeqSeq"
bound="0" repositoryID="IDL:anonBoundedSequences/myBooleanBoundedSeqSeq:1.0" name="anonBoundedSequences.myBooleanBoundedSeqSeq"
type="ns4:anonBoundedSequences.myBooleanBoundedSeqSeq" />
-    <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonboundedsequence"
xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap" elemtype="corba:octet"
bound="5" name="anonBoundedSequences._1_myOctetBoundedSeqSeq" type="ns4:anonBoundedSequences._1_myOctetBoundedSeqSeq"
/>
+    <corba:anonsequence xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap"
elemtype="corba:octet" bound="5" name="anonBoundedSequences._1_myOctetBoundedSeqSeq" type="xs:base64Binary"
/>
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonboundedsequence"
xmlns="http://schemas.apache.org/yoko/idl/Anonboundedsequence/typemap" elemtype="anonBoundedSequences._1_myOctetBoundedSeqSeq"
bound="0" repositoryID="IDL:anonBoundedSequences/myOctetBoundedSeqSeq:1.0" name="anonBoundedSequences.myOctetBoundedSeqSeq"
type="ns4:anonBoundedSequences.myOctetBoundedSeqSeq" />
   </corba:typeMapping>
   <wsdl:types>
@@ -547,15 +547,9 @@
           </xs:element>
         </xs:sequence>
       </xs:complexType>
-      <xs:complexType name="anonBoundedSequences._1_myOctetBoundedSeqSeq">
-        <xs:sequence>
-          <xs:element maxOccurs="5" minOccurs="0" name="item" type="xs:unsignedByte">
-          </xs:element>
-        </xs:sequence>
-      </xs:complexType>
       <xs:complexType name="anonBoundedSequences.myOctetBoundedSeqSeq">
         <xs:sequence>
-          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="anonBoundedSequences._1_myOctetBoundedSeqSeq">
+          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="xs:base64Binary">
           </xs:element>
         </xs:sequence>
       </xs:complexType>

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonsequence.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonsequence.wsdl?view=diff&rev=512875&r1=512874&r2=512875
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonsequence.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Anonsequence.wsdl Wed Feb 28
09:54:40 2007
@@ -114,7 +114,7 @@
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonsequence" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="anonSequences._1_myWcharSeqSeq" bound="0" repositoryID="IDL:anonSequences/myWcharSeqSeq:1.0"
name="anonSequences.myWcharSeqSeq" type="ns4:anonSequences.myWcharSeqSeq" />
     <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonsequence" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="corba:boolean" bound="0" name="anonSequences._1_myBooleanSeqSeq" type="ns4:anonSequences._1_myBooleanSeqSeq"
/>
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonsequence" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="anonSequences._1_myBooleanSeqSeq" bound="0" repositoryID="IDL:anonSequences/myBooleanSeqSeq:1.0"
name="anonSequences.myBooleanSeqSeq" type="ns4:anonSequences.myBooleanSeqSeq" />
-    <corba:anonsequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonsequence" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="corba:octet" bound="0" name="anonSequences._1_myOctetSeqSeq" type="ns4:anonSequences._1_myOctetSeqSeq"
/>
+    <corba:anonsequence xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="corba:octet" bound="0" name="anonSequences._1_myOctetSeqSeq" type="xs:base64Binary"
/>
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Anonsequence" xmlns="http://schemas.apache.org/yoko/idl/Anonsequence/typemap"
elemtype="anonSequences._1_myOctetSeqSeq" bound="0" repositoryID="IDL:anonSequences/myOctetSeqSeq:1.0"
name="anonSequences.myOctetSeqSeq" type="ns4:anonSequences.myOctetSeqSeq" />
   </corba:typeMapping>
   <wsdl:types>
@@ -547,15 +547,9 @@
           </xs:element>
         </xs:sequence>
       </xs:complexType>
-      <xs:complexType name="anonSequences._1_myOctetSeqSeq">
-        <xs:sequence>
-          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="xs:unsignedByte">
-          </xs:element>
-        </xs:sequence>
-      </xs:complexType>
       <xs:complexType name="anonSequences.myOctetSeqSeq">
         <xs:sequence>
-          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="anonSequences._1_myOctetSeqSeq">
+          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="xs:base64Binary">
           </xs:element>
         </xs:sequence>
       </xs:complexType>

Modified: incubator/yoko/trunk/tools/src/test/resources/idl/expected_Sequence.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/tools/src/test/resources/idl/expected_Sequence.wsdl?view=diff&rev=512875&r1=512874&r2=512875
==============================================================================
--- incubator/yoko/trunk/tools/src/test/resources/idl/expected_Sequence.wsdl (original)
+++ incubator/yoko/trunk/tools/src/test/resources/idl/expected_Sequence.wsdl Wed Feb 28 09:54:40
2007
@@ -39,7 +39,7 @@
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Sequence" xmlns="http://schemas.apache.org/yoko/idl/Sequence/typemap"
elemtype="corba:char" bound="0" repositoryID="IDL:sequences/myChar:1.0" name="sequences.myChar"
type="ns4:sequences.myChar" />
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Sequence" xmlns="http://schemas.apache.org/yoko/idl/Sequence/typemap"
elemtype="corba:wchar" bound="0" repositoryID="IDL:sequences/myWchar:1.0" name="sequences.myWchar"
type="ns4:sequences.myWchar" />
     <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Sequence" xmlns="http://schemas.apache.org/yoko/idl/Sequence/typemap"
elemtype="corba:boolean" bound="0" repositoryID="IDL:sequences/myBoolean:1.0" name="sequences.myBoolean"
type="ns4:sequences.myBoolean" />
-    <corba:sequence xmlns:ns4="http://schemas.apache.org/yoko/idl/Sequence" xmlns="http://schemas.apache.org/yoko/idl/Sequence/typemap"
elemtype="corba:octet" bound="0" repositoryID="IDL:sequences/myOctet:1.0" name="sequences.myOctet"
type="ns4:sequences.myOctet" />
+    <corba:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.apache.org/yoko/idl/Sequence/typemap"
elemtype="corba:octet" bound="0" repositoryID="IDL:sequences/myOctet:1.0" name="sequences.myOctet"
type="xs:base64Binary" />
   </corba:typeMapping>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/Sequence"
xmlns="http://schemas.apache.org/yoko/idl/Sequence" xmlns:xs="http://www.w3.org/2001/XMLSchema">
@@ -160,12 +160,6 @@
       <xs:complexType name="sequences.myBoolean">
         <xs:sequence>
           <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="xs:boolean">
-          </xs:element>
-        </xs:sequence>
-      </xs:complexType>
-      <xs:complexType name="sequences.myOctet">
-        <xs:sequence>
-          <xs:element maxOccurs="unbounded" minOccurs="0" name="item" type="xs:unsignedByte">
           </xs:element>
         </xs:sequence>
       </xs:complexType>



Mime
View raw message