cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r519798 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/interceptor/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/ testutils/src/main/java/org...
Date Mon, 19 Mar 2007 02:27:06 GMT
Author: ffang
Date: Sun Mar 18 19:27:05 2007
New Revision: 519798

URL: http://svn.apache.org/viewvc?view=rev&rev=519798
Log:
[CXF-461] if holder part is the first one of output messsage, runtime will fail
                        

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?view=diff&rev=519798&r1=519797&r2=519798
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
Sun Mar 18 19:27:05 2007
@@ -178,7 +178,12 @@
                 o = dr.read(p, xmlReader);
 
                 if (o != null) {
-                    parameters.add(o);
+                    if (p.getIndex() == -1) {
+                        parameters.add(0, o);
+                    } else {
+                        parameters.add(o);
+                    }
+                    
                 }
                 paramNum++;
             } while (StaxUtils.toNextElement(xmlReader));

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java?view=diff&rev=519798&r1=519797&r2=519798
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
Sun Mar 18 19:27:05 2007
@@ -142,6 +142,7 @@
                     outIdx++;
                 }
             }
+            message.setContent(List.class, outObjects);
         }
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java?view=diff&rev=519798&r1=519797&r2=519798
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
Sun Mar 18 19:27:05 2007
@@ -28,6 +28,8 @@
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.Holder;
 
+
+
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
@@ -50,6 +52,8 @@
 import org.apache.header_test.types.TestHeader5ResponseBody;
 import org.apache.header_test.types.TestHeader6;
 import org.apache.header_test.types.TestHeader6Response;
+import org.apache.tests.type_test.all.SimpleAll;
+import org.apache.tests.type_test.choice.SimpleChoice;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -198,7 +202,7 @@
         TestHeader6 in = new TestHeader6();
         String val = new String(TestHeader6.class.getSimpleName());
         Holder<TestHeader3> inoutHeader = new Holder<TestHeader3>();
-        for (int idx = 0; idx < 2; idx++) {
+        for (int idx = 0; idx < 1; idx++) {
             val += idx;                
             in.setRequestType(val);
             inoutHeader.value = new TestHeader3();
@@ -284,4 +288,18 @@
             throw (Exception)ex.getCause();
         }
     } 
+    
+    @Test
+    public void testHolderNotTheFirstMessagePart() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/soapheader.wsdl");
+        assertNotNull(wsdl);
+        
+        SOAPHeaderService service = new SOAPHeaderService(wsdl, serviceName);
+        assertNotNull(service);
+        TestHeader proxy = service.getPort(portName, TestHeader.class);
+        Holder<SimpleAll> simpleAll = new Holder<SimpleAll>();
+        simpleAll.value = new SimpleAll();
+        proxy.sendReceiveAnyType(simpleAll, new SimpleChoice());    
+        
+    }
 }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java?view=diff&rev=519798&r1=519797&r2=519798
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/header_test/TestHeaderImpl.java
Sun Mar 18 19:27:05 2007
@@ -33,6 +33,9 @@
 import org.apache.header_test.types.TestHeader5ResponseBody;
 import org.apache.header_test.types.TestHeader6;
 import org.apache.header_test.types.TestHeader6Response;
+import org.apache.tests.type_test.all.SimpleAll;
+import org.apache.tests.type_test.choice.SimpleChoice;
+import org.apache.tests.type_test.sequence.SimpleStruct;
 
 
 @WebService(serviceName = "SOAPHeaderService", 
@@ -120,6 +123,10 @@
         
         inoutHeader.value.setRequestType(in.getRequestType());
         return returnVal;
+    }
+
+    public SimpleStruct sendReceiveAnyType(Holder<SimpleAll> x, SimpleChoice y) {
+        return new SimpleStruct();
     }
 
 }

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl?view=diff&rev=519798&r1=519797&r2=519798
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/soapheader.wsdl Sun Mar 18 19:27:05
2007
@@ -17,7 +17,10 @@
   specific language governing permissions and limitations
   under the License.
 -->
-<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/header_test" xmlns:x1="http://apache.org/header_test/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://apache.org/header_test"
name="TestHeaderWSDL">
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://apache.org/header_test" xmlns:x1="http://apache.org/header_test/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://apache.org/header_test"
name="TestHeaderWSDL"
+    xmlns:all="http://apache.org/tests/type_test/all"
+    xmlns:chc="http://apache.org/tests/type_test/choice"
+    xmlns:seq="http://apache.org/tests/type_test/sequence">
     <wsdl:types>
         <schema targetNamespace="http://apache.org/header_test/types" xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:x1="http://apache.org/header_test/types" elementFormDefault="qualified">
             <element name="testHeader1">
@@ -104,6 +107,41 @@
                 </complexType>
             </element>
         </schema>
+        <schema xmlns="http://www.w3.org/2001/XMLSchema" 
+            targetNamespace="http://apache.org/tests/type_test/all">
+            <element name="test_all" type="all:SimpleAll"/>
+            <complexType name="SimpleAll">
+                <all>
+                    <element name="varFloat" type="float"/>
+                    <element name="varInt" type="int"/>
+                    <element name="varString" type="string"/>
+                </all>
+                <attribute name="varAttrString" type="string"/>
+            </complexType>
+        </schema>
+        <schema xmlns="http://www.w3.org/2001/XMLSchema" 
+            targetNamespace="http://apache.org/tests/type_test/sequence">
+            <element name="test_seq" type="seq:SimpleStruct"/>
+            <complexType name="SimpleStruct">
+                <sequence>
+                    <element name="varFloat" type="float"/>
+                    <element name="varInt" type="int"/>
+                    <element name="varString" type="string"/>
+                </sequence>
+                <attribute name="varAttrString" type="string"/>
+            </complexType>
+        </schema>
+        <schema xmlns="http://www.w3.org/2001/XMLSchema" 
+            targetNamespace="http://apache.org/tests/type_test/choice">
+            <element name="test_chc" type="chc:SimpleChoice"/>
+            <complexType name="SimpleChoice">
+                <choice>
+                    <element name="varFloat" type="float"/>
+                    <element name="varInt" type="int"/>
+                    <element name="varString" type="string"/>
+                </choice>
+            </complexType>
+        </schema>
     </wsdl:types>
     <wsdl:message name="testHeader1Request">
         <wsdl:part name="in" element="x1:testHeader1"/>
@@ -151,6 +189,14 @@
     <wsdl:message name="testHeaderMessage">
         <wsdl:part name="inoutHeader" element="x1:testHeaderMessage"/>
     </wsdl:message>
+    <message name="AnyTypeRequest">
+        <part name="x" element="all:test_all"/>
+        <part name="y" element="chc:test_chc"/>
+    </message>
+    <message name="AnyTypeResponse">
+        <part name="x" element="all:test_all"/>
+        <part name="return" element="seq:test_seq"/>
+    </message>
     <wsdl:portType name="TestHeader">
         <wsdl:operation name="testHeader1">
             <wsdl:input name="testHeader1Request" message="tns:testHeader1Request"/>
@@ -178,6 +224,10 @@
             <wsdl:output name="testHeaderPartBeforeBodyPartResponse" 
                 message="tns:testHeaderPartBeforeBodyPartResponse"/>
         </wsdl:operation>
+        <operation name="send_receive_any_type">
+            <input name="send_receive_any_type_request" message="tns:AnyTypeRequest"/>
+            <output name="send_receive_any_type_response" message="tns:AnyTypeResponse"/>
+        </operation>
     </wsdl:portType>
     <wsdl:binding name="TestHeader_SOAPBinding" type="tns:TestHeader">
         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -246,6 +296,15 @@
                     part="inoutHeader" use="literal"/>
             </wsdl:output>
         </wsdl:operation>
+        <operation name="send_receive_any_type">
+            <soap:operation soapAction="" style="document"/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
     </wsdl:binding>
     <wsdl:service name="SOAPHeaderService">
         <wsdl:port name="SoapHeaderPort" binding="tns:TestHeader_SOAPBinding">



Mime
View raw message