cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r530345 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/interceptor/ systests/src/test/java/org/apache/cxf/systest/swa/
Date Thu, 19 Apr 2007 09:17:19 GMT
Author: ffang
Date: Thu Apr 19 02:17:18 2007
New Revision: 530345

URL: http://svn.apache.org/viewvc?view=rev&rev=530345
Log:
[CXF-548] fix message part search bug in AbstractInDatabindingInterceptor if message part
tns is empty
[CXF-284] get SwA system test working


Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/SwAServiceImpl.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=530345&r1=530344&r2=530345
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Thu Apr 19 02:17:18 2007
@@ -139,6 +139,10 @@
             }
 
             MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
+            if (name.getNamespaceURI() == null || name.getNamespaceURI().length() == 0) {
+                // message part has same namespace with the message
+                name = new QName(p.getMessageInfo().getName().getNamespaceURI(), name.getLocalPart());
+            }
             if (name.equals(p.getConcreteName())) {
                 exchange.put(BindingOperationInfo.class, boi);
                 exchange.put(OperationInfo.class, boi.getOperationInfo());

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java?view=diff&rev=530345&r1=530344&r2=530345
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/ClientServerSwaTest.java
Thu Apr 19 02:17:18 2007
@@ -18,6 +18,8 @@
  */
 package org.apache.cxf.systest.swa;
 
+import java.io.InputStream;
+
 import javax.activation.DataHandler;
 import javax.mail.util.ByteArrayDataSource;
 import javax.xml.ws.BindingProvider;
@@ -57,8 +59,14 @@
         data.value = handler;
         
         structHolder.value = struct;
-        // TODO: Fails currently...
-//         port.echoData(structHlder, data);
+
+        port.echoData(structHolder, data);
+        InputStream bis = null;
+        bis = data.value.getDataSource().getInputStream();
+        byte b[] = new byte[10];
+        bis.read(b, 0, 10);
+        String string = new String(b);
+        assertEquals("testfoobar", string);
         
     }
 

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/SwAServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/SwAServiceImpl.java?view=diff&rev=530345&r1=530344&r2=530345
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/SwAServiceImpl.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/swa/SwAServiceImpl.java
Thu Apr 19 02:17:18 2007
@@ -18,8 +18,12 @@
  */
 package org.apache.cxf.systest.swa;
 
+import java.io.IOException;
+import java.io.InputStream;
+
 import javax.activation.DataHandler;
 import javax.jws.WebService;
+import javax.mail.util.ByteArrayDataSource;
 import javax.xml.ws.Holder;
 
 import org.apache.cxf.swa.SwAServiceInterface;
@@ -32,6 +36,21 @@
 public class SwAServiceImpl implements SwAServiceInterface {
 
     public void echoData(Holder<DataStruct> text, Holder<DataHandler> data) {
+
+        try {
+            InputStream bis = null;
+            bis = data.value.getDataSource().getInputStream();
+            byte b[] = new byte[6];
+            bis.read(b, 0, 6);
+            String string = new String(b);
+            
+            ByteArrayDataSource source = 
+                new ByteArrayDataSource(("test" + string).getBytes(), "text/xml");
+            data.value = new DataHandler(source);
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+
+        }
 
     }
 



Mime
View raw message