cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r890610 - in /cxf/branches/2.2.x-fixes: ./ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/ tools/wsdlto/test/src/tes...
Date Tue, 15 Dec 2009 02:49:03 GMT
Author: dkulp
Date: Tue Dec 15 02:49:03 2009
New Revision: 890610

URL: http://svn.apache.org/viewvc?rev=890610&view=rev
Log:
Merged revisions 890462 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r890462 | dkulp | 2009-12-14 15:02:11 -0500 (Mon, 14 Dec 2009) | 1 line
  
  [CXF-2582] Fix issues with holders for the first response part
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
    cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=890610&r1=890609&r2=890610&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Tue Dec 15 02:49:03 2009
@@ -410,31 +410,29 @@
         if (outputWrapElement.size() == 1 && inputWrapElement != null) {
             QName outElement = outputWrapElement.iterator().next();
             boolean sameWrapperChild = false;
-            if (outputWrapElement.size() > 1) {
-                for (QName inElement : inputWrapElement) {
-                    if (isSameWrapperChild(inElement, outElement)) {
-                        JavaParameter jpIn = null;
-                        for (JavaParameter j : method.getParameters()) {
-                            if (inElement.equals(j.getQName())) {
-                                jpIn = j;
-                            }
+            for (QName inElement : inputWrapElement) {
+                if (isSameWrapperChild(inElement, outElement)) {
+                    JavaParameter jpIn = null;
+                    for (JavaParameter j : method.getParameters()) {
+                        if (inElement.equals(j.getQName())) {
+                            jpIn = j;
                         }
-                        JavaParameter jp = getParameterFromQName(outputPart.getElementQName(),
outElement,
-                                                                 JavaType.Style.INOUT, outputPart);
-                        if (!qualified) {
-                            jp.setTargetNamespace("");
-                        }
-                        if (!jpIn.getClassName().equals(jp.getClassName())) {
-                            jp.setStyle(JavaType.Style.OUT);
-                        } 
-                        addParameter(method, jp);
-                        sameWrapperChild = true;
+                    }
+                    JavaParameter jp = getParameterFromQName(outputPart.getElementQName(),
outElement,
+                                                             JavaType.Style.INOUT, outputPart);
+                    if (!qualified) {
+                        jp.setTargetNamespace("");
+                    }
+                    if (!jpIn.getClassName().equals(jp.getClassName())) {
+                        jp.setStyle(JavaType.Style.OUT);
+                    } 
+                    addParameter(method, jp);
+                    sameWrapperChild = true;
 
-                        if (method.getReturn() == null) {
-                            addVoidReturn(method);
-                        }
-                        break;
+                    if (method.getReturn() == null) {
+                        addVoidReturn(method);
                     }
+                    break;
                 }
             }
             if (!sameWrapperChild) {

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java?rev=890610&r1=890609&r2=890610&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Tue Dec 15 02:49:03 2009
@@ -831,16 +831,21 @@
         processor.execute();
 
         Class<?> clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world_holder.Greeter");
-        assertEquals(1, clz.getMethods().length);
+        assertEquals(2, clz.getMethods().length);
+
+        Class<?> para = classLoader.loadClass("org.apache.cxf.w2j.hello_world_holder.types.GreetMe");
+        Method method = clz.getMethod("sayHi", new Class[] {Holder.class, para});
+        assertEquals("GreetMeResponse", method.getReturnType().getSimpleName());
 
         SOAPBinding soapBindingAnno = AnnotationUtil.getPrivClassAnnotation(clz, SOAPBinding.class);
+        if (soapBindingAnno == null) {
+            soapBindingAnno = method.getAnnotation(SOAPBinding.class);
+        }
+        assertNotNull(soapBindingAnno);
         assertEquals("BARE", soapBindingAnno.parameterStyle().name());
         assertEquals("LITERAL", soapBindingAnno.use().name());
         assertEquals("DOCUMENT", soapBindingAnno.style().name());
 
-        Class<?> para = classLoader.loadClass("org.apache.cxf.w2j.hello_world_holder.types.GreetMe");
-        Method method = clz.getMethod("sayHi", new Class[] {Holder.class, para});
-        assertEquals("GreetMeResponse", method.getReturnType().getSimpleName());
 
         WebParam webParamAnno = AnnotationUtil.getWebParam(method, "greetMe");
         assertEquals(true, webParamAnno.header());
@@ -848,6 +853,7 @@
         webParamAnno = AnnotationUtil.getWebParam(method, "sayHi");
         assertEquals("INOUT", webParamAnno.mode().name());
 
+        method = clz.getMethod("testInOut", Holder.class, Integer.TYPE);
     }
 
     @Test

Modified: cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl?rev=890610&r1=890609&r2=890610&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl
(original)
+++ cxf/branches/2.2.x-fixes/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/hello_world_holder.wsdl
Tue Dec 15 02:49:03 2009
@@ -18,69 +18,103 @@
   under the License.
 -->
 <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://cxf.apache.org/w2j/hello_world_holder" xmlns:x1="http://cxf.apache.org/w2j/hello_world_holder/types"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://cxf.apache.org/w2j/hello_world_holder" name="HelloWorld">
-	<wsdl:types>
-		<schema targetNamespace="http://cxf.apache.org/w2j/hello_world_holder/types" xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
-			<element name="sayHi">
-				<complexType>
-					<sequence>
-						<element name="responseType" type="xsd:string"/>
-					</sequence>
-				</complexType>
-			</element>
-			<element name="sayHiResponse">
-				<complexType>
-					<sequence>
-						<element name="responseType" type="xsd:string"/>
-					</sequence>
-				</complexType>
-			</element>
-			<element name="greetMe">
-				<complexType>
-					<sequence>
-						<element name="requestType" type="xsd:string"/>
-					</sequence>
-				</complexType>
-			</element>
-			<element name="greetMeResponse">
-				<complexType>
-					<sequence>
-						<element name="responseType" type="xsd:string"/>
-					</sequence>
-				</complexType>
-			</element>
-		</schema>
-	</wsdl:types>
-	<wsdl:message name="sayHi">
-		<wsdl:part name="sayIn" element="x1:sayHi"/>
-		<wsdl:part name="sayHeader" element="x1:greetMe"/>
-	</wsdl:message>
-	<wsdl:message name="sayHiResponse">
-		<wsdl:part name="sayIn" element="x1:sayHi"/>
-		<wsdl:part name="sayHeader" element="x1:greetMeResponse"/>
-	</wsdl:message>
-	<wsdl:portType name="Greeter">
-		<wsdl:operation name="sayHi">
-			<wsdl:input name="sayHiRequest" message="tns:sayHi"/>
-			<wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
-		</wsdl:operation>
-	</wsdl:portType>
-	<wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
-		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
-		<wsdl:operation name="sayHi">
-			<soap:operation style="document"/>
-			<wsdl:input>
-				<soap:body use="literal"/>
-				<soap:header message="tns:sayHi" part="sayHeader" use="literal"/>
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal"/>
-				<soap:header message="tns:sayHiResponse" part="sayHeader" use="literal"/>
-			</wsdl:output>
-		</wsdl:operation>
-	</wsdl:binding>
-	<wsdl:service name="SOAPService">
-		<wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
-			<soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
-		</wsdl:port>
-	</wsdl:service>
+    <wsdl:types>
+        <schema targetNamespace="http://cxf.apache.org/w2j/hello_world_holder/types" xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
+            <element name="sayHi">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="testInOut">
+                <complexType>
+                    <sequence>
+                        <element minOccurs='0' name='val' type='xsd:int'/>
+                        <element name='num' type='xsd:int'/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="testInOutResponse">
+                <complexType>
+                    <sequence>
+                        <element minOccurs='0' name='val' type='xsd:int'/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHi">
+        <wsdl:part name="sayIn" element="x1:sayHi"/>
+        <wsdl:part name="sayHeader" element="x1:greetMe"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part name="sayIn" element="x1:sayHi"/>
+        <wsdl:part name="sayHeader" element="x1:greetMeResponse"/>
+    </wsdl:message>
+    <wsdl:message name="testInOut">
+        <wsdl:part name="testInOut" element="x1:testInOut"/>
+    </wsdl:message>
+    <wsdl:message name="testInOutResponse">
+        <wsdl:part name="testInOutResponse" element="x1:testInOutResponse"/>
+    </wsdl:message>
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input name="sayHiRequest" message="tns:sayHi"/>
+            <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+        </wsdl:operation>
+        <wsdl:operation name="testInOut">
+            <wsdl:input name="testInOut" message="tns:testInOut"/>
+            <wsdl:output name="testInOutResponse" message="tns:testInOutResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="sayHi">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+                <soap:header message="tns:sayHi" part="sayHeader" use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+                <soap:header message="tns:sayHiResponse" part="sayHeader" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="testInOut">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
 </wsdl:definitions>



Mime
View raw message