cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r497313 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ bindings/soap/src/test/java/org/apache/cxf/binding/soap/ core/src/main/java/org/apache/cxf/wsdl11/ frontend/jaxws/src/main/java/org/a...
Date Thu, 18 Jan 2007 05:50:35 GMT
Author: tli
Date: Wed Jan 17 21:50:34 2007
New Revision: 497313

URL: http://svn.apache.org/viewvc?view=rev&rev=497313
Log:
CXF-367 bug fix

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCInInterceptorTest.java
    incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCOutInterceptorTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java?view=diff&rev=497313&r1=497312&r2=497313
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
Wed Jan 17 21:50:34 2007
@@ -96,28 +96,40 @@
 
         StaxUtils.nextEvent(xmlReader);
         while (StaxUtils.toNextElement(xmlReader)) {
-            QName name = xmlReader.getName();
-            int idx = parameters.size();
-            MessagePartInfo p = msg.getMessageParts().get(idx);
-            if (p == null) {
-                throw new SoapFault("Parameter " + xmlReader.getName() + " does not exist!",
-                                    ((SoapMessage)message).getVersion().getSender());
-            }
-            QName elName = new QName(operation.getOperationInfo().getName().getNamespaceURI(),

-                    p.getName().getLocalPart());
-
-            if (!elName.getLocalPart().equals(name.getLocalPart())) {
-                String expMessage = "Parameter " + name + " is not equal to the name ["
-                                    + elName.getLocalPart() + "] in the servicemodel!";
-                throw new SoapFault(expMessage, ((SoapMessage)message).getVersion().getSender());
-            }
-            Object param = null;
-            param = dr.read(p, message);
-            if (param != null) {
-                parameters.add(param);
-            } else {
-                throw new RuntimeException(p.getName() + " can not be unmarshalled");
+            QName name = xmlReader.getName();            
+            MessagePartInfo part = null;
+            for (MessagePartInfo mpi : msg.getMessageParts()) {
+                if (mpi.getName().getLocalPart().equals(name.getLocalPart())) { 
+                    part = mpi;
+                    break;
+                }
             }
+            if (part == null) {
+                throw new SoapFault("Parameter " + xmlReader.getName() + " does not exist!",
+                              ((SoapMessage)message).getVersion().getSender());
+            }            
+            Object param = dr.read(part, message);
+            parameters.add(param);
+//            MessagePartInfo p = msg.getMessageParts().get(idx);
+//            if (p == null) {
+//                throw new SoapFault("Parameter " + xmlReader.getName() + " does not exist!",
+//                                    ((SoapMessage)message).getVersion().getSender());
+//            }
+//            QName elName = new QName(operation.getOperationInfo().getName().getNamespaceURI(),

+//                    p.getName().getLocalPart());
+//
+//            if (!elName.getLocalPart().equals(name.getLocalPart())) {
+//                String expMessage = "Parameter " + name + " is not equal to the name ["
+//                                    + elName.getLocalPart() + "] in the servicemodel!";
+//                throw new SoapFault(expMessage, ((SoapMessage)message).getVersion().getSender());
+//            }
+//            Object param = null;
+//            param = dr.read(p, message);
+//            if (param != null) {
+//                parameters.add(param);
+//            } else {
+//                throw new RuntimeException(p.getName() + " can not be unmarshalled");
+//            }
         }
         message.setContent(List.class, parameters);
     }

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=497313&r1=497312&r2=497313
==============================================================================
--- 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
Wed Jan 17 21:50:34 2007
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
+import java.util.LinkedList;
 import java.util.List;
 
 import javax.xml.stream.XMLStreamException;
@@ -75,11 +76,27 @@
                     throw new SoapFault("The number of arguments is not equal!", 
                                         ((SoapMessage) message).getVersion().getSender());
                 }
-
+                int notNullIndex = 0;
+                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++) {
-                    Object arg = objs.get(idx);
-                    MessagePartInfo part = (MessagePartInfo) parts.get(idx);
-
+                    Object arg = null;
+                    for (arg = objs.get(notNullIndex); arg == null; notNullIndex++) {
+                        arg = objs.get(notNullIndex);
+                    }
+                    notNullIndex++;
+                    MessagePartInfo part = (MessagePartInfo) llist.get(idx);
                     dataWriter.write(arg, part, message);
                 }
             }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCInInterceptorTest.java?view=diff&rev=497313&r1=497312&r2=497313
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCInInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCInInterceptorTest.java
Wed Jan 17 21:50:34 2007
@@ -51,7 +51,9 @@
         BindingInfo bi = si.getBinding(new QName(TNS, "Greeter_SOAPBinding_RPCLit"));
         BindingOperationInfo boi = bi.getOperation(new QName(TNS, OPNAME));
         boi.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(MyComplexStruct.class);
+        boi.getOperationInfo().getInput().getMessagePartByIndex(0).setIndex(0);
         boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(MyComplexStruct.class);
+        boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(-1);
         soapMessage.getExchange().put(BindingOperationInfo.class, boi);
 
         control.reset(); 

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCOutInterceptorTest.java?view=diff&rev=497313&r1=497312&r2=497313
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCOutInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/RPCOutInterceptorTest.java
Wed Jan 17 21:50:34 2007
@@ -58,6 +58,7 @@
                 .toString());
         BindingInfo bi = si.getBinding(new QName(TNS, "Greeter_SOAPBinding_RPCLit"));
         BindingOperationInfo boi = bi.getOperation(new QName(TNS, OPNAME));
+        boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(-1);
         soapMessage.getExchange().put(BindingOperationInfo.class, boi);
 
         control.reset();
@@ -131,6 +132,7 @@
 
         StaxUtils.nextEvent(reader);
         StaxUtils.toNextElement(reader);
+                     
         assertEquals(new QName("http://apache.org/hello_world_rpclit", "out"), reader.getName());
 
         StaxUtils.nextEvent(reader);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=497313&r1=497312&r2=497313
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Wed Jan 17 21:50:34 2007
@@ -540,7 +540,8 @@
         }
         for (Part part : cast(msg.getParts().values(), Part.class)) {
             if (!orderedParam.contains(part)) {
-                MessagePartInfo pi = minfo.addMessagePart(part.getName());
+                MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(),

+                        part.getName()));
                 if (part.getTypeName() != null) {
                     pi.setTypeQName(part.getTypeName());
                     pi.setElement(false);

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=497313&r1=497312&r2=497313
==============================================================================
--- 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
Wed Jan 17 21:50:34 2007
@@ -72,7 +72,7 @@
             LOG.fine("client invocation");
             // Extract the Holders and store them for later
             List<Holder> holders = new ArrayList<Holder>();
-            int size = op.getInput().size();
+            int size = op.getInput().size() + op.getOutput().size();
             List<Object> newObjects = new ArrayList<Object>(size);
             for (int i = 0; i < size; i++) {
                 newObjects.add(null);



Mime
View raw message