cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r559158 [1/2] - in /incubator/cxf/trunk: api/ api/src/main/java/org/apache/cxf/message/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/bindings/soap/src...
Date Tue, 24 Jul 2007 18:47:13 GMT
Author: dkulp
Date: Tue Jul 24 11:47:01 2007
New Revision: 559158

URL: http://svn.apache.org/viewvc?view=rev&rev=559158
Log:
[CXF-841, CXF-820, CXF-842, CXF-843, CXF-844]
Fix remaining eclipse warnings
Fix usage of MessagePartInfo.getIndex() - the index is now ALWAYS the index of that part in the resulting List<Object> content of the message.  Reading/writing can propery use that to directly work with the appropriate object.
Fix a bunch of "Code First" issues
Fix issues with methods with bunch of outs/inouts/headers all mixed up not working correctly.
Change api/pom.xml to not do javadoc when run with -Pfastinstall


Added:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java   (with props)
Modified:
    incubator/cxf/trunk/api/pom.xml
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
    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/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.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/bindings/soap/src/test/resources/rpc-req.xml
    incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-resp.xml
    incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
    incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
    incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
    incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jbi/ClientServerTest.java
    incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java

Modified: incubator/cxf/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/pom.xml?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/api/pom.xml (original)
+++ incubator/cxf/trunk/api/pom.xml Tue Jul 24 11:47:01 2007
@@ -98,28 +98,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>package</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <attach>true</attach>
-                    <quiet>true</quiet>
-                    <bottom>Apache CXF is an effort undergoing incubation at the Apache Software Foundation(ASF) and sponsored by the Apache Incubator PMC.</bottom>
-                    <header>Apache CXF API</header>
-                    <footer>Apache CXF API</footer>
-                    <sourcepath>${basedir}/src/main/java${path.separator}${basedir}/target/generated/src/main/java</sourcepath>
-                    <subpackages>org.apache.cxf</subpackages>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
                     <execution>
@@ -223,12 +201,52 @@
                 </dependencies>
             </plugin>
         </plugins>
+
     </build>
 
+    <profiles>
+        <profile>
+            <id>fastinstall</id>
+        </profile>
+        <profile>
+            <!-- default profile enables javadoc stuff -->
+            <id>javadoc</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-javadoc-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>package</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>jar</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                        <configuration>
+                            <attach>true</attach>
+                            <quiet>true</quiet>
+                            <bottom>Apache CXF is an effort undergoing incubation at the Apache Software Foundation(ASF) and sponsored by the Apache Incubator PMC.</bottom>
+                            <header>Apache CXF API</header>
+                            <footer>Apache CXF API</footer>
+                            <sourcepath>${basedir}/src/main/java${path.separator}${basedir}/target/generated/src/main/java</sourcepath>
+                            <subpackages>org.apache.cxf</subpackages>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trunk/api</connection>
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/cxf/trunk/api</developerConnection>
-      <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-api</url>
-  </scm>
+        <url>http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-api</url>
+    </scm>
 
 </project>

Added: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java?view=auto&rev=559158
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java (added)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java Tue Jul 24 11:47:01 2007
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.message;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.service.model.MessagePartInfo;
+
+public class MessageContentsList extends ArrayList<Object> {
+    public static final Object REMOVED_MARKER = new Object();
+
+    public MessageContentsList() {
+        super(6);
+    }
+    public MessageContentsList(Object ... values) {
+        super(Arrays.asList(values));
+    }
+    public MessageContentsList(List<?> values) {
+        super(values);
+    }
+    
+    public static MessageContentsList getContentsList(Message msg) {
+        List<Object> o = CastUtils.cast(msg.getContent(List.class));
+        if (o == null) {
+            return null;
+        }
+        if (!(o instanceof MessageContentsList)) {
+            MessageContentsList l2 = new MessageContentsList(o);
+            msg.setContent(List.class, l2);
+            return l2;
+        }
+        return (MessageContentsList)o;
+    }
+    
+    public Object set(int idx, Object value) {
+        ensureSize(idx);
+        return super.set(idx, value);
+    }
+    
+    private void ensureSize(int idx) {
+        while (idx >= size()) {
+            add(null);
+        }
+    }
+    
+    public Object put(MessagePartInfo key, Object value) {
+        ensureSize(key.getIndex());
+        return super.set(key.getIndex(), value);
+    }
+    
+    public boolean hasValue(MessagePartInfo key) {
+        return super.get(key.getIndex()) != REMOVED_MARKER;
+    }
+    
+    public Object get(MessagePartInfo key) {
+        Object o = super.get(key.getIndex());
+        return o == REMOVED_MARKER ? null : o;
+    }
+    public void remove(MessagePartInfo key) {
+        put(key, REMOVED_MARKER);
+    }
+}

Propchange: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/message/MessageContentsList.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Tue Jul 24 11:47:01 2007
@@ -205,22 +205,23 @@
 
             if (b.getInput() != null) {
                 List<String> bodyParts = null;
-                SoapHeaderInfo headerInfo = b.getInput().getExtensor(SoapHeaderInfo.class);
-                if (headerInfo != null) {
+                List<SoapHeaderInfo> headerInfos = b.getInput().getExtensors(SoapHeaderInfo.class);
+                if (headerInfos != null && headerInfos.size() > 0) {
                     bodyParts = new ArrayList<String>();
                     for (MessagePartInfo part : b.getInput().getMessageParts()) {
                         bodyParts.add(part.getName().getLocalPart());
                     }
 
-                    SoapHeader soapHeader = SOAPBindingUtil.createSoapHeader(extensionRegistry,
-                                                                             BindingInput.class,
-                                                                             isSoap12);
-                    soapHeader.setMessage(b.getInput().getMessageInfo().getName());
-                    soapHeader.setPart(headerInfo.getPart().getName().getLocalPart());
-                    soapHeader.setUse("literal");
-                    bodyParts.remove(headerInfo.getPart().getName().getLocalPart());
-                    b.getInput().addExtensor(soapHeader);
-
+                    for (SoapHeaderInfo headerInfo : headerInfos) { 
+                        SoapHeader soapHeader = SOAPBindingUtil.createSoapHeader(extensionRegistry,
+                                                                                 BindingInput.class,
+                                                                                 isSoap12);
+                        soapHeader.setMessage(b.getInput().getMessageInfo().getName());
+                        soapHeader.setPart(headerInfo.getPart().getName().getLocalPart());
+                        soapHeader.setUse("literal");
+                        bodyParts.remove(headerInfo.getPart().getName().getLocalPart());
+                        b.getInput().addExtensor(soapHeader);
+                    }
                 }
                 SoapBody body = SOAPBindingUtil.createSoapBody(extensionRegistry,
                                                                BindingInput.class,
@@ -239,21 +240,22 @@
 
             if (b.getOutput() != null) {
                 List<String> bodyParts = null;
-                SoapHeaderInfo headerInfo = b.getOutput().getExtensor(SoapHeaderInfo.class);
-                if (headerInfo != null) {
+                List<SoapHeaderInfo> headerInfos = b.getOutput().getExtensors(SoapHeaderInfo.class);
+                if (headerInfos != null && headerInfos.size() > 0) {
                     bodyParts = new ArrayList<String>();
                     for (MessagePartInfo part : b.getOutput().getMessageParts()) {
                         bodyParts.add(part.getName().getLocalPart());
                     }
-                    SoapHeader soapHeader = SOAPBindingUtil.createSoapHeader(extensionRegistry,
+                    for (SoapHeaderInfo headerInfo : headerInfos) { 
+                        SoapHeader soapHeader = SOAPBindingUtil.createSoapHeader(extensionRegistry,
                                                                              BindingOutput.class,
                                                                              isSoap12);
-                    soapHeader.setMessage(b.getOutput().getMessageInfo().getName());
-                    soapHeader.setPart(headerInfo.getPart().getName().getLocalPart());
-                    soapHeader.setUse("literal");
-                    bodyParts.remove(headerInfo.getPart().getName().getLocalPart());
-                    b.getOutput().addExtensor(soapHeader);
-
+                        soapHeader.setMessage(b.getOutput().getMessageInfo().getName());
+                        soapHeader.setPart(headerInfo.getPart().getName().getLocalPart());
+                        soapHeader.setUse("literal");
+                        bodyParts.remove(headerInfo.getPart().getName().getLocalPart());
+                        b.getOutput().addExtensor(soapHeader);
+                    }
                 }
                 SoapBody body = SOAPBindingUtil.createSoapBody(extensionRegistry,
                                                                BindingOutput.class,

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/Messages.properties Tue Jul 24 11:47:01 2007
@@ -27,3 +27,4 @@
 ATTACHMENT_IO=Attachment IO Exception: {0}
 INVALID_VERSION="{0}" is not a valid SOAP version.
 BP_2211_RPCLIT_CANNOT_BE_NULL=Cannot write part {0}. RPC/Literal parts cannot be null. (WS-I BP R2211)
+UNKNOWN_RPC_LIT_PART=Found element {0} but could not find matching RPC/Literal part
\ No newline at end of file

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.logging.Logger;
@@ -30,8 +29,10 @@
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
+import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessageInfo;
@@ -92,7 +93,7 @@
             msg = operation.getOperationInfo().getOutput();
         }
 
-        List<Object> parameters = new ArrayList<Object>();
+        MessageContentsList parameters = new MessageContentsList();
 
         StaxUtils.nextEvent(xmlReader);
         
@@ -104,10 +105,23 @@
                 hasNext = StaxUtils.toNextElement(xmlReader);
             }
             if (hasNext) {
-                parameters.add(dr.read(part, xmlReader));
+                QName qn = xmlReader.getName();
+                while (!qn.equals(part.getConcreteName())
+                    && itr.hasNext()) {
+                    part = itr.next();
+                }
+                if (!qn.equals(part.getConcreteName())) {
+                    throw new Fault(
+                                    new org.apache.cxf.common.i18n.Message(
+                                                                           "UNKNOWN_RPC_LIT_PART",
+                                                                           LOG,
+                                                                           qn));
+                }
+                parameters.put(part, dr.read(part, xmlReader));
             }
         }
 
         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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -30,6 +30,7 @@
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -65,20 +66,21 @@
                 parts = operation.getInput().getMessageParts();
             }
             
-            List<?> objs = message.getContent(List.class);
+            MessageContentsList objs = MessageContentsList.getContentsList(message);
             if (objs == null) {
                 return;
             }
             
             
             for (MessagePartInfo part : parts) {
-                int idx = part.getMessageInfo().getMessagePartIndex(part);
-                Object o = objs.get(idx);
-                if (o == null) {
-                    //WSI-BP R2211 - RPC/Lit parts are not allowed to be xsi:nil
-                    throw new Fault(
-                        new org.apache.cxf.common.i18n.Message("BP_2211_RPCLIT_CANNOT_BE_NULL",
-                                                               LOG, part.getConcreteName()));
+                if (objs.hasValue(part)) {
+                    Object o = objs.get(part);
+                    if (o == null) {
+                        //WSI-BP R2211 - RPC/Lit parts are not allowed to be xsi:nil
+                        throw new Fault(
+                            new org.apache.cxf.common.i18n.Message("BP_2211_RPCLIT_CANNOT_BE_NULL",
+                                                                   LOG, part.getConcreteName()));
+                    }
                 }
             }
             writeParts(message, message.getExchange(), operation, objs, parts);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java Tue Jul 24 11:47:01 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.binding.soap.interceptor;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.w3c.dom.Node;
@@ -27,13 +26,13 @@
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.headers.Header;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
 import org.apache.cxf.interceptor.BareInInterceptor;
 import org.apache.cxf.interceptor.DocLiteralInInterceptor;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -55,10 +54,10 @@
         SoapMessage message = (SoapMessage) m;
         Exchange exchange = message.getExchange();
 
-        List<Object> parameters = CastUtils.cast(message.getContent(List.class));
+        MessageContentsList parameters = MessageContentsList.getContentsList(message);
 
         if (null == parameters) {
-            parameters = new ArrayList<Object>();
+            parameters = new MessageContentsList();
         }
 
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
@@ -86,7 +85,6 @@
             MessagePartInfo mpi = header.getPart();
             Header param = findHeader(message, mpi);
             
-            int idx = mpi.getIndex();
             Object object = null;
             if (param != null) {
                 message.getHeaders().remove(param);
@@ -100,19 +98,7 @@
                 
             }
             
-            if (client) {
-                // Return parameter needs to be first, so bump everything
-                // back one notch.
-                idx++;
-            }
-            
-            if (idx > parameters.size()) {
-                parameters.add(object);
-            } else if (idx == -1) {
-                parameters.add(0, object);
-            } else {
-                parameters.add(idx, object);
-            }
+            parameters.put(mpi, object);
         }
         if (parameters.size() > 0) {
             message.setContent(List.class, parameters);

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java Tue Jul 24 11:47:01 2007
@@ -40,11 +40,11 @@
 import org.apache.cxf.headers.Header;
 import org.apache.cxf.headers.HeaderManager;
 import org.apache.cxf.headers.HeaderProcessor;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.io.WriteOnCloseOutputStream;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
@@ -163,7 +163,7 @@
         
         List<MessagePartInfo> parts = wrappedBmi.getMessageInfo().getMessageParts();
         if (parts.size() > 0) {
-            List<Object> objs = CastUtils.cast((List<?>)message.getContent(List.class));
+            MessageContentsList objs = MessageContentsList.getContentsList(message);
             if (objs == null) {
                 return endedHeader;
             }
@@ -176,9 +176,8 @@
             for (SoapHeaderInfo header : headers) {
                 MessagePartInfo part = header.getPart();
 
-                int idx = parts.indexOf(part);
-                
-                Object arg = objs.get(idx);
+                Object arg = objs.get(part);
+                objs.remove(part);
                 if (!(startedHeader || preexistingHeaders)) {
                     try {
                         xtw.writeStartElement(soapVersion.getPrefix(), 

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -55,9 +55,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().getInput().getMessagePartByIndex(0).setIndex(1);
         boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(MyComplexStruct.class);
-        boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(-1);
+        boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(0);
         soapMessage.getExchange().put(BindingOperationInfo.class, boi);
 
         control.reset(); 
@@ -104,9 +104,9 @@
         interceptor.handleMessage(soapMessage);
 
         List<?> parameters = (List<?>) soapMessage.getContent(List.class);
-        assertEquals(1, parameters.size());
+        assertEquals(2, parameters.size());
 
-        Object obj = parameters.get(0);
+        Object obj = parameters.get(1);
         assertTrue(obj instanceof MyComplexStruct);
         MyComplexStruct s = (MyComplexStruct) obj;
         assertEquals("elem1", s.getElem1());

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -21,7 +21,6 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
@@ -33,6 +32,7 @@
 import org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor;
 import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -63,7 +63,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);
+        boi.getOperationInfo().getOutput().getMessagePartByIndex(0).setIndex(0);
         soapMessage.getExchange().put(BindingOperationInfo.class, boi);
 
         control.reset();
@@ -83,7 +83,7 @@
         mcs.setElem1("elem1");
         mcs.setElem2("elem2");
         mcs.setElem3(45);
-        List<MyComplexStruct> param = new ArrayList<MyComplexStruct>();
+        MessageContentsList param = new MessageContentsList();
         param.add(mcs);
         soapMessage.setContent(List.class, param);
     }

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-req.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-req.xml?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-req.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-req.xml Tue Jul 24 11:47:01 2007
@@ -18,11 +18,11 @@
   under the License.
 -->
 <ns1:sendReceiveData xmlns:ns1="http://apache.org/hello_world_rpclit">
-    <ns3:in xmlns:ns3="http://apache.org/hello_world_rpclit"
+    <in xmlns:ns3="http://apache.org/hello_world_rpclit"
         xmlns:ns2="http://apache.org/hello_world_rpclit/types"
-        xmlns="http://www.w3.org/2005/02/addressing/wsdl">
+        >
         <ns2:elem1>elem1</ns2:elem1>
         <ns2:elem2>elem2</ns2:elem2>
         <ns2:elem3>45</ns2:elem3>
-    </ns3:in>
+    </in>
 </ns1:sendReceiveData>

Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-resp.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-resp.xml?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-resp.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/resources/rpc-resp.xml Tue Jul 24 11:47:01 2007
@@ -18,11 +18,11 @@
   under the License.
 -->
 <ns1:sendReceiveDataResponse xmlns:ns1="http://apache.org/hello_world_rpclit">
-    <ns3:out xmlns:ns3="http://apache.org/hello_world_rpclit"
+    <out xmlns:ns3="http://apache.org/hello_world_rpclit"
         xmlns:ns2="http://apache.org/hello_world_rpclit/types"
-        xmlns="http://www.w3.org/2005/02/addressing/wsdl">
+        >
         <ns2:elem1>elem1</ns2:elem1>
         <ns2:elem2>elem2</ns2:elem2>
         <ns2:elem3>45</ns2:elem3>
-    </ns3:out>
+    </out>
 </ns1:sendReceiveDataResponse>

Modified: incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/XMLMessageOutInterceptorTest.java Tue Jul 24 11:47:01 2007
@@ -23,7 +23,6 @@
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.ArrayList;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -31,6 +30,7 @@
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.service.model.BindingInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
@@ -56,7 +56,7 @@
 
     XMLMessageOutInterceptor out = new XMLMessageOutInterceptor("phase1");
 
-    List<Object> params = new ArrayList<Object>();
+    MessageContentsList params = new MessageContentsList();
 
     QName bareMyComplexStructTypeQName = new QName(bareNs, "in");
 
@@ -111,9 +111,9 @@
         myComplexStruct.setElem1("elem1");
         myComplexStruct.setElem2("elem2");
         myComplexStruct.setElem3(45);
-        params.add(myComplexStruct);
         params.add("tli");
-
+        params.add(myComplexStruct);
+        
         common("/wsdl/hello_world_xml_bare.wsdl", new QName(bareNs, "XMLPort"),
                         MyComplexStructType.class);
 
@@ -133,23 +133,23 @@
         StaxUtils.nextEvent(dxr);
         StaxUtils.toNextElement(dxr);
         
-        assertEquals(bareMyComplexStructQName.getNamespaceURI(), dxr.getNamespaceURI());
-        assertEquals("myComplexStruct", dxr.getLocalName());
+        assertEquals(bareRequestTypeQName, dxr.getName());
+        StaxUtils.nextEvent(dxr);
+        if (StaxUtils.toNextText(dxr)) {
+            assertEquals("tli", dxr.getText());
+        }
+        
         boolean foundRequest = false;
         while (true) {
             StaxUtils.nextEvent(dxr);
             StaxUtils.toNextElement(dxr);
             QName requestType = new QName(dxr.getNamespaceURI(), dxr.getLocalName());
-            if (requestType.equals(bareRequestTypeQName)) {
+            if (requestType.equals(bareMyComplexStructQName)) {
                 foundRequest = true;
                 break;
             }
         }
         assertEquals("found request type", true, foundRequest);
-        StaxUtils.nextEvent(dxr);
-        if (StaxUtils.toNextText(dxr)) {
-            assertEquals("tli", dxr.getText());
-        }
     }
 
     @Test

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/databinding/stax/StaxDataBindingInterceptor.java Tue Jul 24 11:47:01 2007
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.databinding.stax;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -32,6 +31,7 @@
 import org.apache.cxf.interceptor.URIMappingInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.staxutils.DepthXMLStreamReader;
@@ -53,7 +53,7 @@
         
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
         DataReader<XMLStreamReader> dr = getDataReader(message);
-        List<Object> parameters = new ArrayList<Object>();
+        MessageContentsList parameters = new MessageContentsList();
 
         Exchange exchange = message.getExchange();
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
@@ -65,14 +65,19 @@
             return;
         }
         
-        parameters.add(dr.read(xmlReader));
-
         if (bop == null) {
             Endpoint ep = exchange.get(Endpoint.class);
             bop = ep.getBinding().getBindingInfo().getOperations().iterator().next();
         }
         
         message.getExchange().put(BindingOperationInfo.class, bop);
+        
+        if (isRequestor(message)) {
+            parameters.put(bop.getOutput().getMessageParts().get(0), dr.read(xmlReader));            
+        } else {
+            parameters.put(bop.getInput().getMessageParts().get(0), dr.read(xmlReader));            
+        }
+
         
         if (parameters.size() > 0) {
             message.setContent(List.class, parameters);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Tue Jul 24 11:47:01 2007
@@ -22,8 +22,6 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Level;
@@ -46,6 +44,7 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.phase.PhaseChainCache;
 import org.apache.cxf.phase.PhaseInterceptorChain;
@@ -337,13 +336,8 @@
     }
 
     private void setParameters(Object[] params, Message message) {
-        if (params == null) {
-            message.setContent(List.class, Collections.emptyList());
-        } else {
-            List<Object> paramList = new ArrayList<Object>();
-            Collections.addAll(paramList, params);
-            message.setContent(List.class, paramList);
-        }
+        MessageContentsList contents = new MessageContentsList(params);
+        message.setContent(List.class, contents);
     }
     
     public void onMessage(Message message) {

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -52,12 +52,6 @@
     private static final ResourceBundle BUNDLE = BundleUtils
         .getBundle(AbstractInDatabindingInterceptor.class);
 
-    /**
-     * @deprecated
-     */
-    public AbstractInDatabindingInterceptor() {
-        super(null, null);
-    }
     
     public AbstractInDatabindingInterceptor(String phase) {
         super(phase);

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java Tue Jul 24 11:47:01 2007
@@ -32,6 +32,7 @@
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.service.Service;
@@ -57,7 +58,7 @@
     }
     
     protected void writeParts(Message message, Exchange exchange, 
-                              BindingOperationInfo operation, List<?> objs, 
+                              BindingOperationInfo operation, MessageContentsList objs, 
                               List<MessagePartInfo> parts) {
         OutputStream out = message.getContent(OutputStream.class);
         XMLStreamWriter xmlWriter = message.getContent(XMLStreamWriter.class);
@@ -77,19 +78,19 @@
             DataWriter<OutputStream> osWriter = getDataWriter(message, service, OutputStream.class);
 
             for (MessagePartInfo part : parts) {
-                int idx = part.getMessageInfo().getMessagePartIndex(part);
-                
-                Object o = objs.get(idx);
-                osWriter.write(o, part, out);
+                if (objs.hasValue(part)) {
+                    Object o = objs.get(part);
+                    osWriter.write(o, part, out);
+                }
             }
         } else {
             DataWriter<XMLStreamWriter> dataWriter = getDataWriter(message, service, XMLStreamWriter.class);
             
             for (MessagePartInfo part : parts) {
-                int idx = part.getMessageInfo().getMessagePartIndex(part);
-                
-                Object o = objs.get(idx);
-                dataWriter.write(o, part, xmlWriter);
+                if (objs.hasValue(part)) {
+                    Object o = objs.get(part);
+                    dataWriter.write(o, part, xmlWriter);
+                }
             }
         }
     }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java Tue Jul 24 11:47:01 2007
@@ -35,6 +35,7 @@
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -71,7 +72,7 @@
         Exchange exchange = message.getExchange();
 
         DataReader<XMLStreamReader> dr = getDataReader(message);
-        List<Object> parameters = new ArrayList<Object>();
+        MessageContentsList parameters = new MessageContentsList();
 
         Endpoint ep = exchange.get(Endpoint.class);
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
@@ -138,7 +139,7 @@
             o = dr.read(p, xmlReader);
 
             if (o != null) {
-                parameters.add(o);
+                parameters.put(p, o);
             }
             paramNum++;
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java Tue Jul 24 11:47:01 2007
@@ -22,6 +22,7 @@
 
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -42,7 +43,7 @@
             return;
         }
 
-        List<?> objs = message.getContent(List.class);
+        MessageContentsList objs = MessageContentsList.getContentsList(message);
         if (objs == null || objs.size() == 0) {
             return;
         }

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -37,6 +37,7 @@
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -67,7 +68,7 @@
 
         DepthXMLStreamReader xmlReader = getXMLStreamReader(message);
         DataReader<XMLStreamReader> dr = getDataReader(message);
-        List<Object> parameters = new ArrayList<Object>();
+        MessageContentsList parameters = new MessageContentsList();
 
         Exchange exchange = message.getExchange();
         BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
@@ -99,8 +100,7 @@
             // Determine if there is a wrapper class
             if (msgInfo.getMessageParts().get(0).getTypeClass() != null) {
                 Object wrappedObject = dr.read(msgInfo.getMessageParts().get(0), xmlReader);
-                parameters.add(wrappedObject);
-
+                parameters.put(msgInfo.getMessageParts().get(0), wrappedObject);
             } else {
                 // Unwrap each part individually if we don't have a wrapper
 
@@ -181,15 +181,8 @@
                 }
 
                 o = dr.read(p, xmlReader);
-
-                if (o != null) {
-                    if (p.getIndex() == -1) {
-                        parameters.add(0, o);
-                    } else {
-                        parameters.add(o);
-                    }
-                    
-                }
+                parameters.put(p, o);
+                
                 paramNum++;
             } while (StaxUtils.toNextElement(xmlReader));
 
@@ -202,7 +195,7 @@
     
     private void getPara(DepthXMLStreamReader xmlReader,
                          DataReader<XMLStreamReader> dr,
-                         List<Object> parameters,
+                         MessageContentsList parameters,
                          Iterator<MessagePartInfo> itr) {
         
         boolean hasNext = true;
@@ -218,7 +211,7 @@
                     && !rname.equals(part.getConcreteName())) {
                     if (part.getXmlSchema() instanceof XmlSchemaElement) {
                         //should check minOccurs=0
-                        parameters.add(null);
+                        parameters.put(part, null);
                     }
                     if (itr.hasNext()) {
                         part = itr.next();
@@ -233,7 +226,7 @@
                     obj = dr.read(part, xmlReader);
                 }
             }
-            parameters.add(obj);
+            parameters.put(part, obj);
         }
     }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java Tue Jul 24 11:47:01 2007
@@ -19,13 +19,13 @@
 
 package org.apache.cxf.interceptor;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.Executor;
 
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
@@ -64,14 +64,19 @@
                     }
                     copyJaxwsProperties(message, outMessage);
                     if (result != null) {
-                        if (result instanceof List) {
-                            outMessage.setContent(List.class, result);
+                        MessageContentsList resList = null;
+                        if (result instanceof MessageContentsList) {
+                            resList = (MessageContentsList)result;
+                        } else if (result instanceof List) {
+                            resList = new MessageContentsList((List)result);
                         } else if (result.getClass().isArray()) {
-                            result = Arrays.asList((Object[])result);
-                            outMessage.setContent(List.class, result);
+                            resList = new MessageContentsList((Object[])result);
                         } else {
-                            outMessage.setContent(Object.class, result);
-                        }                    
+                            outMessage.setContent(Object.class, result);                            
+                        }
+                        if (resList != null) {
+                            outMessage.setContent(List.class, resList);
+                        }
                     }                    
                 }
             }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java Tue Jul 24 11:47:01 2007
@@ -22,7 +22,6 @@
 import java.io.UnsupportedEncodingException;
 import java.lang.reflect.Method;
 import java.net.URLDecoder;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
@@ -39,9 +38,11 @@
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.frontend.MethodDispatcher;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
 
@@ -78,7 +79,8 @@
             throw new Fault(new org.apache.cxf.common.i18n.Message("NO_OPERATION", BUNDLE, opName));
         }
         message.getExchange().put(BindingOperationInfo.class, op);
-        message.setContent(List.class, getParameters(message, op));
+        MessageContentsList params = getParameters(message, op);
+        message.setContent(List.class, params);
     }
 
     private Method getMethod(Message message, BindingOperationInfo operation) {        
@@ -126,10 +128,8 @@
         return orderedParameters;
     }
     
-    protected List<Object> getParameters(Message message, BindingOperationInfo operation) {
-        List<Object> parameters = new ArrayList<Object>();
-        int idx = parameters.size();
-
+    protected MessageContentsList getParameters(Message message, BindingOperationInfo operation) {
+        MessageContentsList parameters = new MessageContentsList();
         Map<String, String> queries = getQueries(message);
         
         if (!isFixedParameterOrder(message)) {
@@ -151,7 +151,28 @@
         Class[] types = method.getParameterTypes();        
         
         for (String key : queries.keySet()) {
+            MessagePartInfo inf = null;
+            for (MessagePartInfo p : operation.getOperationInfo().getInput().getMessageParts()) {
+                if (p.getConcreteName().getLocalPart().equals(key)) {
+                    inf = p;
+                    break;
+                }
+            }
+            if (inf == null && operation.isUnwrappedCapable()) {
+                for (MessagePartInfo p 
+                    : operation.getUnwrappedOperation().getOperationInfo().getInput().getMessageParts()) {
+                    if (p.getConcreteName().getLocalPart().equals(key)) {
+                        inf = p;
+                        break;
+                    }
+                }  
+            }
+            int idx = 0;
+            if (inf != null) {
+                idx = inf.getIndex();
+            }
             Class<?> type = types[idx];
+            
                        
             if (type == null) {
                 LOG.warning("URIMappingInterceptor MessagePartInfo NULL ");
@@ -167,8 +188,7 @@
             } else {
                 param = queries.get(key);
             }
-            
-            parameters.add(param);
+            parameters.set(idx, param);
             
             idx = parameters.size();
         }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedInInterceptor.java Tue Jul 24 11:47:01 2007
@@ -21,7 +21,6 @@
 
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
@@ -35,6 +34,7 @@
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -90,20 +90,18 @@
         ServiceInfo si = operation.getBinding().getService();
 
         DataReader<XMLStreamReader> dr = getDataReader(message);
-        List<Object> objects;
+        MessageContentsList objects = new MessageContentsList();
 
         MessageInfo msgInfo = setMessage(message, operation, requestor, si);
         
         // Determine if there is a wrapper class
         if (operation.isUnwrappedCapable()
             && msgInfo.getMessageParts().get(0).getTypeClass() != null) {
-            objects = new ArrayList<Object>();
             Object wrappedObject = dr.read(msgInfo.getMessageParts().get(0), xmlReader);
-            objects.add(wrappedObject);
+            objects.put(msgInfo.getMessageParts().get(0), wrappedObject);
 
         } else {
             // Unwrap each part individually if we don't have a wrapper
-            objects = new ArrayList<Object>();
 
             if (operation.isUnwrappedCapable()) {
                 operation = operation.getUnwrappedOperation();
@@ -121,7 +119,7 @@
             // loop through each child element
             while (StaxUtils.toNextElement(xmlReader)) {
                 MessagePartInfo part = itr.next();
-                objects.add(dr.read(part, xmlReader));
+                objects.put(part, dr.read(part, xmlReader));
             }
         }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java Tue Jul 24 11:47:01 2007
@@ -22,7 +22,6 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.cxf.frontend.MethodDispatcher;
@@ -30,6 +29,7 @@
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.FaultMode;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingOperationInfo;
 
@@ -55,11 +55,8 @@
         List<Object> params = null;
         if (o instanceof List) {
             params = CastUtils.cast((List<?>)o);
-        } else {
-            if (o != null) {
-                params = new ArrayList<Object>();
-                params.add(o);
-            }
+        } else if (o != null) {
+            params = new MessageContentsList(o);
         }
         
         return invoke(exchange, serviceObject, m, params);
@@ -80,11 +77,7 @@
                 return null;
             }
             
-            List<Object> retList = new ArrayList<Object>();
-            if (!((Class)m.getReturnType()).getName().equals("void")) {
-                retList.add(res);
-            }
-            return retList;
+            return new MessageContentsList(res);
         } catch (InvocationTargetException e) {
             Throwable t = e.getCause();
             if (t == null) {

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -584,11 +584,10 @@
         this.copyExtensors(opInfo, op.getExtensibilityElements());
         this.copyExtensionAttributes(opInfo, op);
         Input input = op.getInput();
-        List paramOrder = op.getParameterOrdering();
         if (input != null) {
             MessageInfo minfo = opInfo.createMessage(input.getMessage().getQName());
             opInfo.setInput(input.getName(), minfo);
-            buildMessage(minfo, input.getMessage(), paramOrder);
+            buildMessage(minfo, input.getMessage());
             copyExtensors(minfo, input.getExtensibilityElements());
             copyExtensionAttributes(minfo, input);
         }
@@ -596,7 +595,7 @@
         if (output != null) {
             MessageInfo minfo = opInfo.createMessage(output.getMessage().getQName());
             opInfo.setOutput(output.getName(), minfo);
-            buildMessage(minfo, output.getMessage(), paramOrder);
+            buildMessage(minfo, output.getMessage());
             copyExtensors(minfo, output.getExtensibilityElements());
             copyExtensionAttributes(minfo, output);
         }
@@ -605,7 +604,7 @@
             Map.Entry<String, Fault> entry = cast(rawentry, String.class, Fault.class);
             FaultInfo finfo = opInfo.addFault(new QName(inf.getName().getNamespaceURI(), entry.getKey()),
                                               entry.getValue().getMessage().getQName());
-            buildMessage(finfo, entry.getValue().getMessage(), paramOrder);
+            buildMessage(finfo, entry.getValue().getMessage());
             copyExtensors(finfo, entry.getValue().getExtensibilityElements());
             copyExtensionAttributes(finfo, entry.getValue());
         }
@@ -771,10 +770,10 @@
         return false;
     }
 
-    private void buildMessage(AbstractMessageContainer minfo, Message msg, List paramOrder) {
+    private void buildMessage(AbstractMessageContainer minfo, Message msg) {
         XmlSchemaCollection schemas = (XmlSchemaCollection)minfo.getOperation().getInterface().getService()
             .getProperty(WSDL_SCHEMA_LIST);
-        List orderedParam = msg.getOrderedParts(paramOrder);
+        List orderedParam = msg.getOrderedParts(null);
         for (Part part : cast(orderedParam, Part.class)) {
             MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part
                 .getName()));
@@ -786,21 +785,6 @@
                 pi.setElementQName(part.getElementName());
                 pi.setElement(true);
                 pi.setXmlSchema(schemas.getElementByQName(part.getElementName()));
-            }
-        }
-        for (Part part : cast(msg.getParts().values(), Part.class)) {
-            if (!orderedParam.contains(part)) {
-                MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part
-                    .getName()));
-                if (part.getTypeName() != null) {
-                    pi.setTypeQName(part.getTypeName());
-                    pi.setElement(false);
-                    pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName()));
-                } else {
-                    pi.setElementQName(part.getElementName());
-                    pi.setElement(true);
-                    pi.setXmlSchema(schemas.getElementByQName(part.getElementName()));
-                }
             }
         }
     }

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/wsdl11/WSDLServiceBuilderTest.java Tue Jul 24 11:47:01 2007
@@ -481,8 +481,8 @@
         List<MessagePartInfo> parts = operation.getInput().getMessageParts();
         assertNotNull(parts);
         assertEquals(3, parts.size());
-        assertEquals("in1", parts.get(0).getName().getLocalPart());
-        assertEquals("in3", parts.get(1).getName().getLocalPart());
+        assertEquals("in3", parts.get(0).getName().getLocalPart());
+        assertEquals("in1", parts.get(1).getName().getLocalPart());
         assertEquals("in2", parts.get(2).getName().getLocalPart());
         
         List<String> order = operation.getParameterOrdering();

Modified: incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java (original)
+++ incubator/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java Tue Jul 24 11:47:01 2007
@@ -335,6 +335,10 @@
          * tm.getType(param.getTypeClass()); part2type.put(param, type); }
          */
 
+        int offset = 0;
+        if (paramtype == OUT_PARAM) {
+            offset = 1;
+        }
         if (type == null) {
             OperationInfo op = param.getMessageInfo().getOperation();
 
@@ -347,7 +351,7 @@
                  * with this name. For example, there could be many ns:in0
                  * paramters.
                  */
-                type = tm.getTypeCreator().createType(m, param.getIndex());
+                type = tm.getTypeCreator().createType(m, param.getIndex() - offset);
             } else {
                 type = tm.getTypeCreator().createType(param.getTypeClass());
             }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBContextInitializer.java Tue Jul 24 11:47:01 2007
@@ -60,19 +60,24 @@
         
         Type genericType = (Type) part.getProperty("generic.type");
         if (genericType != null) {
-            if (isFromWrapper
-                && genericType instanceof Class
-                && ((Class)genericType).isArray()) {
-                
-                Class cl2 = (Class)genericType;
-                if (cl2.isArray()
-                    && !Byte.TYPE.equals(cl2.getComponentType())) {
-                    genericType = cl2.getComponentType();
+            boolean isList = Collection.class.isAssignableFrom(clazz);
+            if (isFromWrapper) {
+                if (genericType instanceof Class
+                    && ((Class)genericType).isArray()) {
+                    Class cl2 = (Class)genericType;
+                    if (cl2.isArray()
+                        && !Byte.TYPE.equals(cl2.getComponentType())) {
+                        genericType = cl2.getComponentType();
+                    }
+                    addType(genericType);                
+                } else if (!isList) {
+                    addType(genericType);                
                 }
+            } else {
+                addType(genericType);                
             }
-            addType(genericType);
             
-            if (Collection.class.isAssignableFrom(clazz) 
+            if (isList 
                 && genericType instanceof ParameterizedType) {
                 ParameterizedType pt = (ParameterizedType) genericType;
                 if (pt.getActualTypeArguments().length > 0 
@@ -84,8 +89,13 @@
                     part.setTypeClass(clazz);
                 }
             }
+            if (isFromWrapper && isList) {
+                clazz = null;
+            }
+        }
+        if (clazz != null) {
+            addClass(clazz);
         }
-        addClass(clazz);
     }
     
     private void addType(Type cls) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/DispatchInDatabindingInterceptor.java Tue Jul 24 11:47:01 2007
@@ -21,7 +21,6 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.logging.Logger;
 
@@ -60,9 +59,12 @@
 import org.apache.cxf.jaxws.handler.soap.DispatchSOAPHandlerInterceptor;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.XMLMessage;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class DispatchInDatabindingInterceptor extends AbstractInDatabindingInterceptor {
@@ -81,16 +83,22 @@
     public void handleMessage(Message message) throws Fault {
         Exchange ex = message.getExchange();     
         Endpoint ep = ex.get(Endpoint.class);
-        
+        MessageInfo info = message.get(MessageInfo.class);
         if (ep.getEndpointInfo().getBinding().getOperations().iterator().hasNext()) {
             BindingOperationInfo bop = ep.getEndpointInfo().getBinding().getOperations().iterator().next();
             ex.put(BindingOperationInfo.class, bop);
-            getMessageInfo(message, bop);
+            info = getMessageInfo(message, bop);
         }      
         
         if (isGET(message)) {
-            List<Object> params = new ArrayList<Object>();    
-            params.add(null);
+            MessageContentsList params = new MessageContentsList();          
+            if (info != null) {
+                for (MessagePartInfo i : info.getMessageParts()) {
+                    params.put(i, null);
+                }
+            } else {
+                params.add(null);
+            }
             message.setContent(List.class, params);
             LOG.info("DispatchInInterceptor skipped in HTTP GET method");
             return;

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java Tue Jul 24 11:47:01 2007
@@ -27,9 +27,9 @@
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 
@@ -43,7 +43,7 @@
 
     @SuppressWarnings("unchecked")
     public void handleMessage(Message message) throws Fault {
-        List<Object> inObjects = CastUtils.cast(message.getContent(List.class));
+        MessageContentsList inObjects = MessageContentsList.getContentsList(message);
 
         Exchange exchange = message.getExchange();
         
@@ -56,35 +56,25 @@
         
         boolean client = Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE));
         if (client) {
-            int holderIdx = 0;
-            int partIdx = 0;
+            List<Holder> outHolders = CastUtils.cast((List)message.getExchange()
+                .getOutMessage().get(CLIENT_HOLDERS));
             for (MessagePartInfo part : parts) {
-                if (part.getIndex() == -1) {
-                    partIdx++;
-                    break;
-                }
-            }
-            
-            List<Holder> holders = CastUtils.cast((List)exchange.get(CLIENT_HOLDERS));
-            for (MessagePartInfo part : parts) {
-                int idx = part.getIndex();
-                if (idx >= 0) {
-                    Holder holder = holders.get(holderIdx);
-                    holder.value = inObjects.get(partIdx);
-                    holderIdx++;
-                    partIdx++;
+                if (part.getIndex() != 0) {
+                    Holder holder = (Holder)outHolders.get(part.getIndex() - 1);
+                    holder.value = inObjects.get(part);
+                    inObjects.put(part, holder);
                 }
             }
         } else {
             for (MessagePartInfo part : parts) {
-                int idx = part.getIndex();
+                int idx = part.getIndex() - 1;
                 if (idx >= 0) {
-                    if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null) {
-                        Object object = inObjects.get(idx);
-                        inObjects.set(idx, new Holder<Object>(object));
+                    if (idx >= inObjects.size()) {
+                        inObjects.set(idx, new Holder<Object>());
                     } else {
-                        inObjects.add(idx, new Holder());
-                    } 
+                        Object o = inObjects.get(idx);
+                        inObjects.set(idx, new Holder<Object>(o));
+                    }
                 }
             }
         }

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=559158&r1=559157&r2=559158
==============================================================================
--- 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 Tue Jul 24 11:47:01 2007
@@ -25,13 +25,12 @@
 
 import javax.xml.ws.Holder;
 
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 
@@ -46,7 +45,7 @@
     }
 
     public void handleMessage(Message message) throws Fault {
-        List<Object> outObjects = CastUtils.cast(message.getContent(List.class));
+        MessageContentsList outObjects = MessageContentsList.getContentsList(message);
         Exchange exchange = message.getExchange();
         OperationInfo op = exchange.get(OperationInfo.class);
         
@@ -63,133 +62,40 @@
             return;
         }
 
-        List<MessagePartInfo> parts = op.getOutput().getMessageParts();
-        LOG.fine("output message parts: " + parts);
-        
-        // is this a client invocation?
-        if (Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
-            LOG.fine("client invocation");
-            // Extract the Holders and store them for later
-            List<Holder> holders = new ArrayList<Holder>();
-            //int size = op.getInput().size() + op.getOutput().size();
-            int size = outObjects.size();
-            List<Object> newObjects = new ArrayList<Object>(size);
-            for (int i = 0; i < size; i++) {
-                newObjects.add(null);
-            }
-
-            Object deleteMarker = markOutHolderInParaList(outObjects, parts, holders, newObjects);
-            
-            if (holders.size() == 0) {
-                return;
-            }
-            
-            int i = 0;
-            for (MessagePartInfo part : op.getInput().getMessageParts()) {
-                List<String> ordering = part.getMessageInfo().getOperation().getParameterOrdering();
-                if (ordering != null && ordering.size() > 0) {
-                    int orderIdx = -1;
-                    for (int j = 0; j < ordering.size(); j++) {
-                        if (ordering.get(j).equals(part.getName().getLocalPart())) {
-                            orderIdx = j;
-                            break;
-                        }
+        if (!Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE))) {
+            List<MessagePartInfo> parts = op.getOutput().getMessageParts();
+            MessageContentsList inObjects = MessageContentsList.getContentsList(exchange.getInMessage());
+            if (inObjects != null) {
+                for (int x = 0; x < inObjects.size(); x++) {
+                    Object o = inObjects.get(x);
+                    if (o instanceof Holder) {
+                        outObjects.set(x + 1, o);
                     }
-                    if (orderIdx != -1) {                        
-                        newObjects.set(part.getIndex(), getValue(part, outObjects, orderIdx));
-                        
-                    } else {
-                        newObjects.set(part.getIndex(), getValue(part, outObjects, i));
-                    }                    
-                } else {
-                    newObjects.set(part.getIndex(), getValue(part, outObjects, i));
                 }
-                i++;
             }
-
-            if (deleteMarker != null) {
-                // regenerate the param list by removing all params marked with the deleteMarker.
-                Object[] newObjectsArray = newObjects.toArray();
-                newObjects.clear();
-                for (Object param : newObjectsArray) {
-                    if (param != deleteMarker) {
-                        newObjects.add(param);
-                    }
+            for (MessagePartInfo part : parts) {
+                if (part.getIndex() > 0) {
+                    Holder holder = (Holder)outObjects.get(part);
+                    outObjects.put(part, holder.value);
                 }
             }
-
-            message.setContent(List.class, newObjects);
-            exchange.put(HolderInInterceptor.CLIENT_HOLDERS, holders);
         } else {
-            // Add necessary holders so we match the method signature of the service class
-            List<Object> reqObjects =
-                CastUtils.cast(exchange.getInMessage().getContent(List.class));
-    
-            int outIdx = 0;
-            boolean holderOutIsFirst = false;
-            for (MessagePartInfo part : parts) {
-                if (part.getIndex() == -1) {
-                    outIdx++;
-                    break;
-                } else {
-                    holderOutIsFirst = true;
+            List<MessagePartInfo> parts = op.getOutput().getMessageParts();
+            List<Object> holders = new ArrayList<Object>(outObjects);
+            for (int x = 0; x < outObjects.size(); x++) {
+                Object o = outObjects.get(x);
+                if (!(o instanceof Holder)) {
+                    holders.set(x, null);
                 }
             }
-            
+            message.put(HolderInInterceptor.CLIENT_HOLDERS, holders);
             for (MessagePartInfo part : parts) {
-                int methodIdx = part.getIndex();
-                if (methodIdx >= 0) {
-                    Holder holder = (Holder) reqObjects.get(methodIdx);
-                    Object o = holder.value;
-                    if (methodIdx < outIdx && holderOutIsFirst) {
-                        //Holder is first part of mesage
-                        outObjects.add(methodIdx, o);
-                    } else if (outIdx >= outObjects.size()) {
-                        outObjects.add(o);
-                    } else {
-                        outObjects.add(outIdx, o);
-                    }
-                    outIdx++;
+                if (part.getIndex() > 0) {
+                    Holder holder = (Holder)outObjects.get(part.getIndex() - 1);
+                    outObjects.set(part.getIndex() - 1, holder.value);
                 }
             }
-            message.setContent(List.class, outObjects);
         }
-    }
-
-    private Object getValue(MessagePartInfo part, List<Object> outObjects, int idx) {
-        if (part.getProperty(ReflectionServiceFactoryBean.MODE_INOUT) != null) {
-            Holder holder = (Holder) outObjects.get(idx);
-            if (holder == null) {
-                return null;
-            } else {
-                return holder.value;
-            }
-        } else {
-            return outObjects.get(idx);
-        }
-    }
-
-    private Object markOutHolderInParaList(List<Object> outObjects, 
-                                           List<MessagePartInfo> parts, 
-                                           List<Holder> holders, 
-                                           List<Object> newObjects) {
-        Object deleteObject = null;
-        for (MessagePartInfo part : parts) {
-            int idx = part.getIndex();
-            if (idx >= 0) {
-                Holder holder = (Holder) outObjects.get(idx);
-
-                if (part.getProperty(ReflectionServiceFactoryBean.MODE_OUT) != null) {
-                    if (deleteObject == null) {
-                        deleteObject = new Object();
-                    }
-                    newObjects.set(idx, deleteObject);
-                }
-                
-                holders.add(holder);
-            }
-        }
-        return deleteObject;
-    }
-    
+        
+    }    
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java Tue Jul 24 11:47:01 2007
@@ -20,7 +20,6 @@
 
 import java.io.IOException;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import javax.activation.DataHandler;
@@ -30,9 +29,9 @@
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBodyInfo;
-import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.message.Attachment;
+import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -69,7 +68,7 @@
         }
         
         Set<Integer> foundAtts = new HashSet<Integer>();
-        List<Object> inObjects = CastUtils.cast(message.getContent(List.class));
+        MessageContentsList inObjects = MessageContentsList.getContentsList(message);
 
         for (MessagePartInfo mpi : sbi.getAttachments()) {
             String partName = mpi.getConcreteName().getLocalPart();
@@ -77,7 +76,6 @@
             String start = partName + "=";
             boolean found = false;
             
-            int idx = mpi.getMessageInfo().getMessagePartIndex(mpi);
             if (foundAtts.contains(mpi.getIndex())) {
                 continue;
             }
@@ -107,24 +105,14 @@
                         o = dh;
                     }
                     
-                    // If the current index is greater than the # of objects,
-                    // just append the attachment to the end
-                    if (idx >= inObjects.size()) {
-                        inObjects.add(o);
-                    } else {
-                        inObjects.add(idx, o);
-                    }
+                    inObjects.put(mpi, o);
                     found = true;
                     break;
                 }
             }
             
             if (!found) {
-                if (idx >= inObjects.size()) {
-                    inObjects.add(null);
-                } else {
-                    inObjects.add(idx, null);
-                }
+                inObjects.put(mpi, null);
             }
         }
     }



Mime
View raw message