cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1065193 - in /cxf/trunk/tools/corba/src: main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java test/resources/idl/Oneway.idl test/resources/idl/expected_Oneway.wsdl
Date Sun, 30 Jan 2011 06:04:21 GMT
Author: ffang
Date: Sun Jan 30 06:04:20 2011
New Revision: 1065193

URL: http://svn.apache.org/viewvc?rev=1065193&view=rev
Log:
[CXF-3294]idl2wsdl tool fails if inherit interface has oneway method

Modified:
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java
    cxf/trunk/tools/corba/src/test/resources/idl/Oneway.idl
    cxf/trunk/tools/corba/src/test/resources/idl/expected_Oneway.wsdl

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java?rev=1065193&r1=1065192&r2=1065193&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java
Sun Jan 30 06:04:20 2011
@@ -353,18 +353,21 @@ public class PortTypeVisitor extends Vis
                                                     mapper.mapNSToPrefix(inputNS), 
                                                     manager.getImportedWSDLDefinitionFile(inputNS));
                 }
-
-                String outputNS = op.getOutput().getMessage().getQName().getNamespaceURI();
-                manager.addWSDLDefinitionNamespace(definition, mapper.mapNSToPrefix(outputNS),
outputNS);
-
-                // Make sure we import the wsdl for the output namespace
-                if (definition.getImports().get(outputNS) == null && !mapper.isDefaultMapping()
-                    && !definition.getTargetNamespace().equals(outputNS)) {
-                    manager.addWSDLDefinitionImport(definition, 
-                                                    manager.getWSDLDefinition(outputNS),

-                                                    mapper.mapNSToPrefix(outputNS), 
-                                                    manager.getImportedWSDLDefinitionFile(outputNS));
+                if (op.getOutput() != null) {
+                    String outputNS = op.getOutput().getMessage().getQName().getNamespaceURI();
+                    manager.addWSDLDefinitionNamespace(definition, mapper.mapNSToPrefix(outputNS),
outputNS);
+
+                    // Make sure we import the wsdl for the output namespace
+                    if (definition.getImports().get(outputNS) == null && !mapper.isDefaultMapping()
+                        && !definition.getTargetNamespace().equals(outputNS)) {
+                        manager.addWSDLDefinitionImport(definition, 
+                                                        manager.getWSDLDefinition(outputNS),

+                                                        mapper.mapNSToPrefix(outputNS), 
+                                                        manager.getImportedWSDLDefinitionFile(outputNS));
+                    }
                 }
+
+                
                 
                 for (Iterator<Fault> faults = CastUtils.cast(op.getFaults().values().iterator());
                     faults.hasNext();) {

Modified: cxf/trunk/tools/corba/src/test/resources/idl/Oneway.idl
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/test/resources/idl/Oneway.idl?rev=1065193&r1=1065192&r2=1065193&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/test/resources/idl/Oneway.idl (original)
+++ cxf/trunk/tools/corba/src/test/resources/idl/Oneway.idl Sun Jan 30 06:04:20 2011
@@ -32,3 +32,7 @@ interface OperationTest {
 	short shortOperation     ();
 
 };
+
+interface inheritOperationTest : OperationTest {
+        void testOperaition();
+};

Modified: cxf/trunk/tools/corba/src/test/resources/idl/expected_Oneway.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/test/resources/idl/expected_Oneway.wsdl?rev=1065193&r1=1065192&r2=1065193&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/test/resources/idl/expected_Oneway.wsdl (original)
+++ cxf/trunk/tools/corba/src/test/resources/idl/expected_Oneway.wsdl Sun Jan 30 06:04:20
2011
@@ -17,8 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.
 -->
-<wsdl:definitions targetNamespace="http://cxf.apache.org/bindings/corba/idl/Oneway" xmlns:tns="http://cxf.apache.org/bindings/corba/idl/Oneway"
xmlns:corba="http://cxf.apache.org/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://cxf.apache.org/bindings/corba/idl/Oneway/typemap"
/>
+<wsdl:definitions targetNamespace="http://cxf.apache.org/bindings/corba/idl/Oneway" xmlns:corba="http://cxf.apache.org/bindings/corba"
xmlns:tns="http://cxf.apache.org/bindings/corba/idl/Oneway" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <corba:typeMapping targetNamespace="http://cxf.apache.org/bindings/corba/idl/Oneway/typemap"/>
   <wsdl:types>
     <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://cxf.apache.org/bindings/corba/idl/Oneway"
xmlns="http://cxf.apache.org/bindings/corba/idl/Oneway" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="onewayOperation">
@@ -153,30 +153,42 @@
           </xs:sequence>
         </xs:complexType>
       </xs:element>
+      <xs:element name="testOperaition">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+      <xs:element name="testOperaitionResponse">
+        <xs:complexType>
+          <xs:sequence>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
     </xs:schema>
   </wsdl:types>
-  <wsdl:message name="shortInOutOperationResponse">
-    <wsdl:part name="outparameter" element="tns:shortInOutOperationResponse">
+  <wsdl:message name="shortOutOperation">
+    <wsdl:part name="inparameter" element="tns:shortOutOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="onewayInOperation">
-    <wsdl:part name="inparameter" element="tns:onewayInOperation">
+  <wsdl:message name="shortOutOperationResponse">
+    <wsdl:part name="outparameter" element="tns:shortOutOperationResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortOutOperation">
-    <wsdl:part name="inparameter" element="tns:shortOutOperation">
+  <wsdl:message name="testOperaitionResponse">
+    <wsdl:part name="outparameter" element="tns:testOperaitionResponse">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="voidInOperation">
     <wsdl:part name="inparameter" element="tns:voidInOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortOperationResponse">
-    <wsdl:part name="outparameter" element="tns:shortOperationResponse">
+  <wsdl:message name="voidInOutOperationResponse">
+    <wsdl:part name="outparameter" element="tns:voidInOutOperationResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortOperation">
-    <wsdl:part name="inparameter" element="tns:shortOperation">
+  <wsdl:message name="onewayInInOperation">
+    <wsdl:part name="inparameter" element="tns:onewayInInOperation">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="voidOutOperationResponse">
@@ -187,40 +199,48 @@
     <wsdl:part name="inparameter" element="tns:onewayOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortInOperationResponse">
-    <wsdl:part name="outparameter" element="tns:shortInOperationResponse">
+  <wsdl:message name="voidInOutOperation">
+    <wsdl:part name="inparameter" element="tns:voidInOutOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="voidInOutOperationResponse">
-    <wsdl:part name="outparameter" element="tns:voidInOutOperationResponse">
+  <wsdl:message name="onewayInOperation">
+    <wsdl:part name="inparameter" element="tns:onewayInOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="voidInOperationResponse">
-    <wsdl:part name="outparameter" element="tns:voidInOperationResponse">
+  <wsdl:message name="shortOperationResponse">
+    <wsdl:part name="outparameter" element="tns:shortOperationResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="onewayInInOperation">
-    <wsdl:part name="inparameter" element="tns:onewayInInOperation">
+  <wsdl:message name="shortInOutOperation">
+    <wsdl:part name="inparameter" element="tns:shortInOutOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortInOperation">
-    <wsdl:part name="inparameter" element="tns:shortInOperation">
+  <wsdl:message name="shortInOperationResponse">
+    <wsdl:part name="outparameter" element="tns:shortInOperationResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortOutOperationResponse">
-    <wsdl:part name="outparameter" element="tns:shortOutOperationResponse">
+  <wsdl:message name="voidInOperationResponse">
+    <wsdl:part name="outparameter" element="tns:voidInOperationResponse">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="shortInOutOperation">
-    <wsdl:part name="inparameter" element="tns:shortInOutOperation">
+  <wsdl:message name="shortInOperation">
+    <wsdl:part name="inparameter" element="tns:shortInOperation">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="shortOperation">
+    <wsdl:part name="inparameter" element="tns:shortOperation">
     </wsdl:part>
   </wsdl:message>
   <wsdl:message name="voidOutOperation">
     <wsdl:part name="inparameter" element="tns:voidOutOperation">
     </wsdl:part>
   </wsdl:message>
-  <wsdl:message name="voidInOutOperation">
-    <wsdl:part name="inparameter" element="tns:voidInOutOperation">
+  <wsdl:message name="testOperaition">
+    <wsdl:part name="inparameter" element="tns:testOperaition">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="shortInOutOperationResponse">
+    <wsdl:part name="outparameter" element="tns:shortInOutOperationResponse">
     </wsdl:part>
   </wsdl:message>
   <wsdl:portType name="OperationTest">
@@ -279,31 +299,93 @@
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
+  <wsdl:portType name="inheritOperationTest">
+    <wsdl:operation name="onewayOperation">
+      <wsdl:input name="onewayOperationRequest" message="tns:onewayOperation">
+    </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="onewayInOperation">
+      <wsdl:input name="onewayInOperationRequest" message="tns:onewayInOperation">
+    </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="onewayInInOperation">
+      <wsdl:input name="onewayInInOperationRequest" message="tns:onewayInInOperation">
+    </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="voidInOperation">
+      <wsdl:input name="voidInOperationRequest" message="tns:voidInOperation">
+    </wsdl:input>
+      <wsdl:output name="voidInOperationResponse" message="tns:voidInOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="voidOutOperation">
+      <wsdl:input name="voidOutOperationRequest" message="tns:voidOutOperation">
+    </wsdl:input>
+      <wsdl:output name="voidOutOperationResponse" message="tns:voidOutOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="voidInOutOperation">
+      <wsdl:input name="voidInOutOperationRequest" message="tns:voidInOutOperation">
+    </wsdl:input>
+      <wsdl:output name="voidInOutOperationResponse" message="tns:voidInOutOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortInOperation">
+      <wsdl:input name="shortInOperationRequest" message="tns:shortInOperation">
+    </wsdl:input>
+      <wsdl:output name="shortInOperationResponse" message="tns:shortInOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortOutOperation">
+      <wsdl:input name="shortOutOperationRequest" message="tns:shortOutOperation">
+    </wsdl:input>
+      <wsdl:output name="shortOutOperationResponse" message="tns:shortOutOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortInOutOperation">
+      <wsdl:input name="shortInOutOperationRequest" message="tns:shortInOutOperation">
+    </wsdl:input>
+      <wsdl:output name="shortInOutOperationResponse" message="tns:shortInOutOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortOperation">
+      <wsdl:input name="shortOperationRequest" message="tns:shortOperation">
+    </wsdl:input>
+      <wsdl:output name="shortOperationResponse" message="tns:shortOperationResponse">
+    </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testOperaition">
+      <wsdl:input name="testOperaitionRequest" message="tns:testOperaition">
+    </wsdl:input>
+      <wsdl:output name="testOperaitionResponse" message="tns:testOperaitionResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
   <wsdl:binding name="OperationTestCORBABinding" type="tns:OperationTest">
-    <corba:binding repositoryID="IDL:OperationTest:1.0" />
+    <corba:binding repositoryID="IDL:OperationTest:1.0"/>
     <wsdl:operation name="onewayOperation">
-      <corba:operation name="onewayOperation" />
+      <corba:operation name="onewayOperation"/>
       <wsdl:input name="onewayOperationRequest">
       </wsdl:input>
     </wsdl:operation>
     <wsdl:operation name="onewayInOperation">
       <corba:operation name="onewayInOperation">
-        <corba:param mode="in" idltype="corba:string" name="inString" />
+        <corba:param mode="in" name="inString" idltype="corba:string"/>
       </corba:operation>
       <wsdl:input name="onewayInOperationRequest">
       </wsdl:input>
     </wsdl:operation>
     <wsdl:operation name="onewayInInOperation">
       <corba:operation name="onewayInInOperation">
-        <corba:param mode="in" idltype="corba:string" name="inString1" />
-        <corba:param mode="in" idltype="corba:string" name="inString2" />
+        <corba:param mode="in" name="inString1" idltype="corba:string"/>
+        <corba:param mode="in" name="inString2" idltype="corba:string"/>
       </corba:operation>
       <wsdl:input name="onewayInInOperationRequest">
       </wsdl:input>
     </wsdl:operation>
     <wsdl:operation name="voidInOperation">
       <corba:operation name="voidInOperation">
-        <corba:param mode="in" idltype="corba:long" name="inLong" />
+        <corba:param mode="in" name="inLong" idltype="corba:long"/>
       </corba:operation>
       <wsdl:input name="voidInOperationRequest">
       </wsdl:input>
@@ -312,7 +394,7 @@
     </wsdl:operation>
     <wsdl:operation name="voidOutOperation">
       <corba:operation name="voidOutOperation">
-        <corba:param mode="out" idltype="corba:long" name="outLong" />
+        <corba:param mode="out" name="outLong" idltype="corba:long"/>
       </corba:operation>
       <wsdl:input name="voidOutOperationRequest">
       </wsdl:input>
@@ -321,7 +403,7 @@
     </wsdl:operation>
     <wsdl:operation name="voidInOutOperation">
       <corba:operation name="voidInOutOperation">
-        <corba:param mode="inout" idltype="corba:long" name="inOutLong" />
+        <corba:param mode="inout" name="inOutLong" idltype="corba:long"/>
       </corba:operation>
       <wsdl:input name="voidInOutOperationRequest">
       </wsdl:input>
@@ -330,8 +412,8 @@
     </wsdl:operation>
     <wsdl:operation name="shortInOperation">
       <corba:operation name="shortInOperation">
-        <corba:param mode="in" idltype="corba:short" name="inShort" />
-        <corba:return idltype="corba:short" name="return" />
+        <corba:param mode="in" name="inShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
       </corba:operation>
       <wsdl:input name="shortInOperationRequest">
       </wsdl:input>
@@ -340,8 +422,8 @@
     </wsdl:operation>
     <wsdl:operation name="shortOutOperation">
       <corba:operation name="shortOutOperation">
-        <corba:param mode="out" idltype="corba:short" name="outShort" />
-        <corba:return idltype="corba:short" name="return" />
+        <corba:param mode="out" name="outShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
       </corba:operation>
       <wsdl:input name="shortOutOperationRequest">
       </wsdl:input>
@@ -350,8 +432,8 @@
     </wsdl:operation>
     <wsdl:operation name="shortInOutOperation">
       <corba:operation name="shortInOutOperation">
-        <corba:param mode="inout" idltype="corba:short" name="inOutShort" />
-        <corba:return idltype="corba:short" name="return" />
+        <corba:param mode="inout" name="inOutShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
       </corba:operation>
       <wsdl:input name="shortInOutOperationRequest">
       </wsdl:input>
@@ -360,7 +442,7 @@
     </wsdl:operation>
     <wsdl:operation name="shortOperation">
       <corba:operation name="shortOperation">
-        <corba:return idltype="corba:short" name="return" />
+        <corba:return name="return" idltype="corba:short"/>
       </corba:operation>
       <wsdl:input name="shortOperationRequest">
       </wsdl:input>
@@ -368,9 +450,110 @@
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
+  <wsdl:binding name="inheritOperationTestCORBABinding" type="tns:inheritOperationTest">
+    <corba:binding repositoryID="IDL:inheritOperationTest:1.0" bases="IDL:OperationTest:1.0"/>
+    <wsdl:operation name="onewayOperation">
+      <corba:operation name="onewayOperation"/>
+      <wsdl:input name="onewayOperationRequest">
+      </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="onewayInOperation">
+      <corba:operation name="onewayInOperation">
+        <corba:param mode="in" name="inString" idltype="corba:string"/>
+      </corba:operation>
+      <wsdl:input name="onewayInOperationRequest">
+      </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="onewayInInOperation">
+      <corba:operation name="onewayInInOperation">
+        <corba:param mode="in" name="inString1" idltype="corba:string"/>
+        <corba:param mode="in" name="inString2" idltype="corba:string"/>
+      </corba:operation>
+      <wsdl:input name="onewayInInOperationRequest">
+      </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="voidInOperation">
+      <corba:operation name="voidInOperation">
+        <corba:param mode="in" name="inLong" idltype="corba:long"/>
+      </corba:operation>
+      <wsdl:input name="voidInOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="voidInOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="voidOutOperation">
+      <corba:operation name="voidOutOperation">
+        <corba:param mode="out" name="outLong" idltype="corba:long"/>
+      </corba:operation>
+      <wsdl:input name="voidOutOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="voidOutOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="voidInOutOperation">
+      <corba:operation name="voidInOutOperation">
+        <corba:param mode="inout" name="inOutLong" idltype="corba:long"/>
+      </corba:operation>
+      <wsdl:input name="voidInOutOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="voidInOutOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortInOperation">
+      <corba:operation name="shortInOperation">
+        <corba:param mode="in" name="inShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
+      </corba:operation>
+      <wsdl:input name="shortInOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="shortInOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortOutOperation">
+      <corba:operation name="shortOutOperation">
+        <corba:param mode="out" name="outShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
+      </corba:operation>
+      <wsdl:input name="shortOutOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="shortOutOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortInOutOperation">
+      <corba:operation name="shortInOutOperation">
+        <corba:param mode="inout" name="inOutShort" idltype="corba:short"/>
+        <corba:return name="return" idltype="corba:short"/>
+      </corba:operation>
+      <wsdl:input name="shortInOutOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="shortInOutOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="shortOperation">
+      <corba:operation name="shortOperation">
+        <corba:return name="return" idltype="corba:short"/>
+      </corba:operation>
+      <wsdl:input name="shortOperationRequest">
+      </wsdl:input>
+      <wsdl:output name="shortOperationResponse">
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="testOperaition">
+      <corba:operation name="testOperaition"/>
+      <wsdl:input name="testOperaitionRequest">
+      </wsdl:input>
+      <wsdl:output name="testOperaitionResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="inheritOperationTestCORBAService">
+    <wsdl:port name="inheritOperationTestCORBAPort" binding="tns:inheritOperationTestCORBABinding">
+      <corba:address location="IOR:"/>
+    </wsdl:port>
+  </wsdl:service>
   <wsdl:service name="OperationTestCORBAService">
     <wsdl:port name="OperationTestCORBAPort" binding="tns:OperationTestCORBABinding">
-      <corba:address location="IOR:" />
+      <corba:address location="IOR:"/>
     </wsdl:port>
   </wsdl:service>
 </wsdl:definitions>



Mime
View raw message