cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r542301 - /incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
Date Mon, 28 May 2007 19:15:58 GMT
Author: dandiep
Date: Mon May 28 12:15:57 2007
New Revision: 542301

URL: http://svn.apache.org/viewvc?view=rev&rev=542301
Log:
Make the RPCOutInterceptor use the proper message part index.

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java?view=diff&rev=542301&r1=542300&r2=542301
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
Mon May 28 12:15:57 2007
@@ -19,14 +19,11 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
-import java.util.LinkedList;
 import java.util.List;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.cxf.binding.soap.SoapFault;
-import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.helpers.NSStack;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
@@ -60,7 +57,6 @@
 
             addOperationNode(nsStack, message, xmlWriter);
 
-            int countParts = 0;
             List<MessagePartInfo> parts = null;
 
             if (!isRequestor(message)) {
@@ -68,32 +64,19 @@
             } else {
                 parts = operation.getInput().getMessageParts();
             }
-            countParts = parts.size();
-
-            if (countParts > 0) {
-                List<?> objs = (List<?>) message.getContent(List.class);    
           
-                if (objs.size() < parts.size()) {
-                    throw new SoapFault("The number of arguments is not equal!", 
-                                        ((SoapMessage) message).getVersion().getSender());
-                }
-                List<MessagePartInfo> llist = new LinkedList<MessagePartInfo>();
-                for (MessagePartInfo mpi : parts) {
-                    if (!llist.contains(mpi)) {
-                        int i = 0;
-                        for (; i < llist.size(); i++) {
-                            if (llist.get(i).getIndex() > mpi.getIndex()) {
-                                i++;
-                                break;
-                            }
-                        }
-                        llist.add(i, mpi);
-                    }
-                }
-                for (int idx = 0; idx < countParts; idx++) {                    
-                    MessagePartInfo part = llist.get(idx);
-                    dataWriter.write(objs.get(idx), part, xmlWriter);                   

-                }
+            
+            List<?> objs = message.getContent(List.class);
+            if (objs == null) {
+                return;
+            }
+            
+            for (MessagePartInfo part : parts) {
+                int idx = part.getMessageInfo().getMessagePartIndex(part);
+                
+                Object o = objs.get(idx);
+                dataWriter.write(o, part, xmlWriter);
             }
+            
             // Finishing the writing.
             xmlWriter.writeEndElement();            
         } catch (XMLStreamException e) {



Mime
View raw message