cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r559158 [2/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
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java Tue Jul 24 11:47:01 2007
@@ -137,7 +137,7 @@
                 .append("@apache.org").toString();
             
             // this assumes things are in order...
-            int idx = mpi.getMessageInfo().getMessagePartIndex(mpi);
+            int idx = mpi.getIndex();
             Object o = outObjects.get(idx);
             
             if (o == null) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java Tue Jul 24 11:47:01 2007
@@ -27,6 +27,7 @@
 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.model.BindingMessageInfo;
@@ -79,7 +80,7 @@
             // Sometimes, an operation can be unwrapped according to WSDLServiceFactory,
             // but not according to JAX-WS. We should unify these at some point, but
             // for now check for the wrapper class.
-            List<?> lst = message.getContent(List.class);
+            MessageContentsList lst = MessageContentsList.getContentsList(message);
             if (lst == null) {
                 return;
             }
@@ -122,22 +123,22 @@
                 helper = createWrapperHelper(messageInfo, wrappedMessageInfo, wrapperClass);
                 wrapperPart.setProperty("WRAPPER_CLASS", helper);
             }            
-            List<Object> newParams;
+            
+            MessageContentsList newParams;
             try {
-                newParams = helper.getWrapperParts(wrappedObject);
+                newParams = new MessageContentsList(helper.getWrapperParts(wrappedObject));
                 
-                int idx = 0;
                 for (MessagePartInfo part : messageInfo.getMessageParts()) {
                     if (wrappedMessageInfo.getMessagePart(part.getName()) != null) {
-                        newParams.set(idx, lst.get(part.getIndex()));
+                        newParams.put(part, lst.get(part));
                     }
-                    ++idx;
                 }
             } catch (Exception e) {
                 throw new Fault(e);
             }
             
             message.setContent(List.class, newParams);
+            message.setContent(MessageContentsList.class, newParams);
         }
     }
     
@@ -150,9 +151,13 @@
         
         for (MessagePartInfo p : messageInfo.getMessageParts()) {
             if (wrappedMessageInfo.getMessagePart(p.getName()) != null) {
-                elTypeNames.add(null);
-                partClasses.add(null);
-                partNames.add(null);
+                int idx = p.getIndex();
+                ensureSize(elTypeNames, idx);
+                ensureSize(partClasses, idx);
+                ensureSize(partNames, idx);
+                elTypeNames.set(idx, null);
+                partClasses.set(idx, null);
+                partNames.set(idx, null);
             } else {
                 String elementType = null;
                 if (p.isElement()) {
@@ -165,15 +170,24 @@
                         elementType = p.getTypeQName().getLocalPart();
                     }
                 }
+                int idx = p.getIndex();
+                ensureSize(elTypeNames, idx);
+                ensureSize(partClasses, idx);
+                ensureSize(partNames, idx);
                 
-                elTypeNames.add(elementType);
-                partClasses.add(p.getTypeClass());
-                partNames.add(p.getName().getLocalPart());
+                elTypeNames.set(idx, elementType);
+                partClasses.set(idx, p.getTypeClass());
+                partNames.set(idx, p.getName().getLocalPart());
             }
         }
         return WrapperHelper.createWrapperHelper(wrapperClass,
                                                   partNames,
                                                   elTypeNames,
                                                   partClasses);
+    }
+    private void ensureSize(List<?> lst, int idx) {
+        while (idx >= lst.size()) {
+            lst.add(null);
+        }
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java Tue Jul 24 11:47:01 2007
@@ -22,10 +22,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-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.model.BindingMessageInfo;
@@ -63,7 +63,7 @@
         }
 
         if (wrapped != null) {
-            List<Object> objs = CastUtils.cast(message.getContent(List.class));
+            MessageContentsList objs = MessageContentsList.getContentsList(message);
 
             WrapperHelper helper = parts.get(0).getProperty("WRAPPER_CLASS", WrapperHelper.class);
             if (helper == null) {
@@ -72,7 +72,11 @@
                 List<Class<?>> partClasses = new ArrayList<Class<?>>();
                 
                 for (MessagePartInfo p : messageInfo.getMessageParts()) {
-                    partNames.add(p.getName().getLocalPart());
+                    ensureSize(partNames, p.getIndex());
+                    ensureSize(elTypeNames, p.getIndex());
+                    ensureSize(partClasses, p.getIndex());
+                    
+                    partNames.set(p.getIndex(), p.getName().getLocalPart());
                     
                     String elementType = null;
                     if (p.isElement()) {
@@ -86,8 +90,8 @@
                         }
                     }
                     
-                    elTypeNames.add(elementType);
-                    partClasses.add(p.getTypeClass());
+                    elTypeNames.set(p.getIndex(), elementType);
+                    partClasses.set(p.getIndex(), p.getTypeClass());
                 }
                 helper = WrapperHelper.createWrapperHelper(wrapped,
                                                            partNames,
@@ -98,9 +102,8 @@
             }
             try {
                 Object o2 = helper.createWrapperObject(objs);
-                objs = new ArrayList<Object>(1);
-                objs.add(o2);
-                message.setContent(List.class, objs);
+                objs.clear();
+                objs.put(parts.get(0), o2);
             } catch (Exception e) {
                 throw new Fault(e);
             }
@@ -116,6 +119,13 @@
                 message.put(MessageInfo.class, newbop.getOperationInfo().getOutput());
                 message.put(BindingMessageInfo.class, newbop.getOutput());
             }
+        }
+    }
+
+
+    private void ensureSize(List<?> lst, int idx) {
+        while (idx >= lst.size()) {
+            lst.add(null);
         }
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java Tue Jul 24 11:47:01 2007
@@ -54,20 +54,47 @@
         NONPRIMITIVE_MAP.put(Float.TYPE, Float.class.getName().replaceAll("\\.", "/"));
         NONPRIMITIVE_MAP.put(Double.TYPE, Double.class.getName().replaceAll("\\.", "/"));
     }    
-
-    private WrapperHelperCompiler() {
-        //utility class
-    }
     
-    static WrapperHelper compileWrapperHelper(Class<?> wrapperType,
-                                                      Method setMethods[],
-                                                      Method getMethods[],
-                                                      Method jaxbMethods[],
-                                                      Field fields[],
-                                                      Object objectFactory) {
-        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS 
-                                         | ClassWriter.COMPUTE_FRAMES);
+    final Class<?> wrapperType;
+    final Method setMethods[];
+    final Method getMethods[];
+    final Method jaxbMethods[];
+    final Field fields[];
+    final Object objectFactory;
+    final ClassWriter cw;
+    
+    private WrapperHelperCompiler(Class<?> wrapperType,
+                                  Method setMethods[],
+                                  Method getMethods[],
+                                  Method jaxbMethods[],
+                                  Field fields[],
+                                  Object objectFactory) {
+        this.wrapperType = wrapperType;
+        this.setMethods = setMethods;
+        this.getMethods = getMethods;
+        this.jaxbMethods = jaxbMethods;
+        this.fields = fields;
+        this.objectFactory = objectFactory;
         
+        cw = new ClassWriter(ClassWriter.COMPUTE_MAXS 
+                            | ClassWriter.COMPUTE_FRAMES);
+    }
+
+    static WrapperHelper compileWrapperHelper(Class<?> wrapperType,
+                                              Method setMethods[],
+                                              Method getMethods[],
+                                              Method jaxbMethods[],
+                                              Field fields[],
+                                              Object objectFactory) {
+        return new WrapperHelperCompiler(wrapperType,
+                                        setMethods,
+                                        getMethods,
+                                        jaxbMethods,
+                                        fields,
+                                        objectFactory).compile();
+    }
+
+    public WrapperHelper compile() {
         String newClassName = wrapperType.getName() + "_WrapperTypeHelper";
         newClassName = newClassName.replaceAll("\\$", ".");
         newClassName = periodToSlashes(newClassName);
@@ -79,12 +106,8 @@
                  null);
         
         addConstructor(newClassName, cw, objectFactory == null ? null : objectFactory.getClass());
-        boolean b = addCreateWrapperObject(newClassName, wrapperType,
-                                           setMethods,
-                                           getMethods,
-                                           jaxbMethods,
-                                           objectFactory == null ? null : objectFactory.getClass(),
-                                           cw);
+        boolean b = addCreateWrapperObject(newClassName,
+                                           objectFactory == null ? null : objectFactory.getClass());
         if (b) {
             b = addGetWrapperParts(newClassName, wrapperType,
                            getMethods, fields, cw);
@@ -107,6 +130,7 @@
         return null;
     }
     
+    
     private static class TypeHelperClassLoader extends ClassLoader {
         TypeHelperClassLoader(ClassLoader parent) {
             super(parent);
@@ -155,13 +179,9 @@
         mv.visitEnd();
     }
     
-    private static boolean addCreateWrapperObject(String newClassName,
-                                               Class<?> wrapperClass,
-                                               Method[] setMethods,
-                                               Method[] getMethods,
-                                               Method[] jaxbObjectMethods,
-                                               Class<?> objectFactory,
-                                               ClassWriter cw) {
+    private boolean addCreateWrapperObject(String newClassName,
+                                           Class<?> objectFactoryClass) {
+        
         MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC,
                                           "createWrapperObject",
                                           "(Ljava/util/List;)Ljava/lang/Object;",
@@ -173,75 +193,33 @@
         Label lBegin = new Label();
         mv.visitLabel(lBegin);
         
-        mv.visitTypeInsn(Opcodes.NEW, periodToSlashes(wrapperClass.getName()));
+        mv.visitTypeInsn(Opcodes.NEW, periodToSlashes(wrapperType.getName()));
         mv.visitInsn(Opcodes.DUP);
-        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, periodToSlashes(wrapperClass.getName()),
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, periodToSlashes(wrapperType.getName()),
                            "<init>", "()V");
         mv.visitVarInsn(Opcodes.ASTORE, 2);
     
         for (int x = 0; x < setMethods.length; x++) {
-            if (getMethods[x] == null) {
-                return false;
+            if (getMethods[x] == null) { 
+                if (setMethods[x] == null
+                    && fields[x] == null) {
+                    //null placeholder, just skip it
+                    continue;
+                } else {
+                    return false;
+                }
             }
             Class<?> tp = getMethods[x].getReturnType();
             mv.visitVarInsn(Opcodes.ALOAD, 2);            
             
             if (Collection.class.isAssignableFrom(tp)) {
-                //List aVal = obj.getA();
-                //List newA = (List)lst.get(99);
-                //if (aVal == null) {
-                //    obj.setA(newA);
-                //} else {
-                //    aVal.addAll(newA);
-                //}
-                
-                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
-                                   periodToSlashes(wrapperClass.getName()),
-                                   getMethods[x].getName(),
-                                   getMethodSignature(getMethods[x]));
-                mv.visitVarInsn(Opcodes.ASTORE, 3);
-                mv.visitVarInsn(Opcodes.ALOAD, 1);
-                mv.visitIntInsn(Opcodes.BIPUSH, x);
-                mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List",
-                                   "get", "(I)Ljava/lang/Object;");
-                mv.visitTypeInsn(Opcodes.CHECKCAST, "java/util/List");
-                mv.visitTypeInsn(Opcodes.CHECKCAST, "java/util/List");
-                mv.visitVarInsn(Opcodes.ASTORE, 4);
-                mv.visitVarInsn(Opcodes.ALOAD, 3);
-                Label nonNullLabel = new Label();
-                mv.visitJumpInsn(Opcodes.IFNONNULL, nonNullLabel);
-
-                if (setMethods[x] == null) {
-                    mv.visitTypeInsn(Opcodes.NEW, "java/lang/RuntimeException");
-                    mv.visitInsn(Opcodes.DUP);
-                    mv.visitLdcInsn(getMethods[x].getName() + " returned null and there isn't a set method.");
-                    mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
-                                       "java/lang/RuntimeException",
-                                       "<init>", "(Ljava/lang/String;)V");
-                    mv.visitInsn(Opcodes.ATHROW);
-                } else {
-                    mv.visitVarInsn(Opcodes.ALOAD, 2);
-                    mv.visitVarInsn(Opcodes.ALOAD, 4);
-                    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
-                                       periodToSlashes(wrapperClass.getName()),
-                                       setMethods[x].getName(),
-                                       getMethodSignature(setMethods[x]));
-                }
-                Label jumpOverLabel = new Label();
-                mv.visitJumpInsn(Opcodes.GOTO, jumpOverLabel);
-                mv.visitLabel(nonNullLabel);
-                mv.visitVarInsn(Opcodes.ALOAD, 3);
-                mv.visitVarInsn(Opcodes.ALOAD, 4);
-                mv.visitMethodInsn(Opcodes.INVOKEINTERFACE,
-                                   "java/util/List", "addAll", "(Ljava/util/Collection;)Z");
-                mv.visitInsn(Opcodes.POP);
-                mv.visitLabel(jumpOverLabel);
+                doCollection(mv, x);
             } else { 
                 if (JAXBElement.class.isAssignableFrom(tp)) {
                     mv.visitVarInsn(Opcodes.ALOAD, 0);
                     mv.visitFieldInsn(Opcodes.GETFIELD, periodToSlashes(newClassName),
                                       "factory",
-                                      "L" + periodToSlashes(objectFactory.getName()) + ";");
+                                      "L" + periodToSlashes(objectFactoryClass.getName()) + ";");
                 }
                 mv.visitVarInsn(Opcodes.ALOAD, 1);
                 mv.visitIntInsn(Opcodes.BIPUSH, x);
@@ -253,17 +231,17 @@
                                        tp.getName() + "Value", "()" + PRIMITIVE_MAP.get(tp));
                 } else if (JAXBElement.class.isAssignableFrom(tp)) {
                     mv.visitTypeInsn(Opcodes.CHECKCAST,
-                                     periodToSlashes(jaxbObjectMethods[x].getParameterTypes()[0].getName()));
-                    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, periodToSlashes(objectFactory.getName()),
-                                       jaxbObjectMethods[x].getName(),
-                                       getMethodSignature(jaxbObjectMethods[x]));
+                                     periodToSlashes(jaxbMethods[x].getParameterTypes()[0].getName()));
+                    mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, periodToSlashes(objectFactoryClass.getName()),
+                                       jaxbMethods[x].getName(),
+                                       getMethodSignature(jaxbMethods[x]));
                 } else if (tp.isArray()) { 
                     mv.visitTypeInsn(Opcodes.CHECKCAST, getClassCode(tp));
                 } else {
                     mv.visitTypeInsn(Opcodes.CHECKCAST, periodToSlashes(tp.getName()));
                 }
                 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
-                                   periodToSlashes(wrapperClass.getName()),
+                                   periodToSlashes(wrapperType.getName()),
                                    setMethods[x].getName(), "(" + getClassCode(tp) + ")V");
             }
         }
@@ -275,12 +253,66 @@
         mv.visitLabel(lEnd);
         mv.visitLocalVariable("this", "L" + newClassName + ";", null, lBegin, lEnd, 0);
         mv.visitLocalVariable("lst", "Ljava/util/List;", "Ljava/util/List<*>;", lBegin, lEnd, 1);
-        mv.visitLocalVariable("ok", "L" + periodToSlashes(wrapperClass.getName()) + ";",
+        mv.visitLocalVariable("ok", "L" + periodToSlashes(wrapperType.getName()) + ";",
                               null, lBegin, lEnd, 2);
         mv.visitMaxs(0, 0);
         mv.visitEnd();
         return true;
     }
+    
+    private void doCollection(MethodVisitor mv, int x) {
+        //List aVal = obj.getA();
+        //List newA = (List)lst.get(99);
+        //if (aVal == null) {
+        //    obj.setA(newA);
+        //} else {
+        //    aVal.addAll(newA);
+        //}
+        
+        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
+                           periodToSlashes(wrapperType.getName()),
+                           getMethods[x].getName(),
+                           getMethodSignature(getMethods[x]));
+        mv.visitVarInsn(Opcodes.ASTORE, 3);
+        mv.visitVarInsn(Opcodes.ALOAD, 1);
+        mv.visitIntInsn(Opcodes.BIPUSH, x);
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List",
+                           "get", "(I)Ljava/lang/Object;");
+        mv.visitTypeInsn(Opcodes.CHECKCAST, "java/util/List");
+        mv.visitTypeInsn(Opcodes.CHECKCAST, "java/util/List");
+        mv.visitVarInsn(Opcodes.ASTORE, 4);
+        mv.visitVarInsn(Opcodes.ALOAD, 3);
+        Label nonNullLabel = new Label();
+        mv.visitJumpInsn(Opcodes.IFNONNULL, nonNullLabel);
+
+        if (setMethods[x] == null) {
+            mv.visitTypeInsn(Opcodes.NEW, "java/lang/RuntimeException");
+            mv.visitInsn(Opcodes.DUP);
+            mv.visitLdcInsn(getMethods[x].getName() + " returned null and there isn't a set method.");
+            mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
+                               "java/lang/RuntimeException",
+                               "<init>", "(Ljava/lang/String;)V");
+            mv.visitInsn(Opcodes.ATHROW);
+        } else {
+            mv.visitVarInsn(Opcodes.ALOAD, 2);
+            mv.visitVarInsn(Opcodes.ALOAD, 4);
+            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
+                               periodToSlashes(wrapperType.getName()),
+                               setMethods[x].getName(),
+                               getMethodSignature(setMethods[x]));
+        }
+        Label jumpOverLabel = new Label();
+        mv.visitJumpInsn(Opcodes.GOTO, jumpOverLabel);
+        mv.visitLabel(nonNullLabel);
+        mv.visitVarInsn(Opcodes.ALOAD, 3);
+        mv.visitVarInsn(Opcodes.ALOAD, 4);
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE,
+                           "java/util/List", "addAll", "(Ljava/util/Collection;)Z");
+        mv.visitInsn(Opcodes.POP);
+        mv.visitLabel(jumpOverLabel);
+
+    }
+    
     private static boolean addGetWrapperParts(String newClassName,
                                            Class<?> wrapperClass,
                                            Method getMethods[],

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java Tue Jul 24 11:47:01 2007
@@ -328,6 +328,7 @@
                 MessagePartInfo part = input.getMessageParts().get(0);
                 part.setTypeClass(getRequestWrapper(method));
                 part.setProperty("REQUEST.WRAPPER.CLASSNAME", getRequestWrapperClassName(method));
+                part.setIndex(0);
             }
 
             if (o.hasOutput()) {
@@ -335,7 +336,7 @@
                 MessagePartInfo part = input.getMessageParts().get(0);
                 part.setTypeClass(getResponseWrapper(method));
                 part.setProperty("RESPONSE.WRAPPER.CLASSNAME", getResponseWrapperClassName(method));
-                part.setIndex(-1);
+                part.setIndex(0);
             }
 
             setFaultClassInfo(o, method);
@@ -394,7 +395,7 @@
             }
             part.setProperty(ReflectionServiceFactoryBean.MODE_OUT, Boolean.TRUE);
             initializeParameter(part, paramType, genericType);
-            part.setIndex(i);
+            part.setIndex(i + 1);
         } else if (isIn && isOut) {
             QName name = getInPartName(o, method, i);
             part = o.getInput().getMessagePart(name);
@@ -408,11 +409,10 @@
             initializeParameter(part, paramType, genericType);
             part.setIndex(i);
 
-            name = getOutPartName(o, method, i);
             part = o.getOutput().getMessagePart(name);
             part.setProperty(ReflectionServiceFactoryBean.MODE_INOUT, Boolean.TRUE);
             initializeParameter(part, paramType, genericType);
-            part.setIndex(i);
+            part.setIndex(i + 1);
         }
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java Tue Jul 24 11:47:01 2007
@@ -62,11 +62,11 @@
         parts = op.getOutput().getMessageParts();
         assertEquals(2, parts.size());
         
-        part = parts.get(0);
+        part = parts.get(1);
         assertNotNull(part.getTypeClass());
         assertEquals(TestHeader5ResponseBody.class, part.getTypeClass());
         
-        part = parts.get(1);
+        part = parts.get(0);
         assertNotNull(part.getTypeClass());
         assertEquals(TestHeader5.class, part.getTypeClass());
           

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java Tue Jul 24 11:47:01 2007
@@ -131,10 +131,10 @@
         assertNotNull(bop);
 
         MessagePartInfo part = bop.getOutput().getMessageParts().get(0);
-        assertEquals(-1, part.getIndex());
+        assertEquals(0, part.getIndex());
         
         d.setMessageObserver(new MessageReplayObserver("sayHiResponse.xml"));
-        Object ret[] = client.invoke(bop, new Object[0], null);
+        Object ret[] = client.invoke(bop, new Object[] {"hi"}, null);
         assertNotNull(ret);
         assertEquals("Wrong number of return objects", 1, ret.length);
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/SoapFaultTest.java Tue Jul 24 11:47:01 2007
@@ -66,6 +66,7 @@
         svrFactory.create();
     }
 
+    
     @Test
     public void testInterceptorThrowingSoapFault() throws Exception {
         service.getInInterceptors().add(new FaultThrowingInterceptor());
@@ -78,7 +79,6 @@
 
         assertValid("/s:Envelope/s:Body/s:Fault/faultstring[text()='I blame Hadrian.']", response);
     }
-
 
     /**
      * We need to get the jaxws fault -> soap fault conversion working for this

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Jul 24 11:47:01 2007
@@ -788,7 +788,7 @@
                     }
                 }
 
-                part.setIndex(-1);
+                part.setIndex(0);
             }
 
             for (int j = 0; j < paramClasses.length; j++) {
@@ -809,7 +809,7 @@
 
                     MessagePartInfo part = outMsg.addMessagePart(q);
                     initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
-                    part.setIndex(j);
+                    part.setIndex(j + 1);
 
                     if (!isRPC(method) && !isWrapped(method)) {
                         part.setProperty(ELEMENT_NAME, q2);
@@ -819,9 +819,12 @@
                         part.setProperty(MODE_INOUT, Boolean.TRUE);
                     }
                     if (isHeader(method, j)) {
-                        //part.setElementQName(q2);
-                        part.setProperty(ELEMENT_NAME, q2);
                         part.setProperty(HEADER, Boolean.TRUE);
+                        if (isRPC(method) || !isWrapped(method)) {
+                            part.setElementQName(q2);
+                        } else {
+                            part.setProperty(ELEMENT_NAME, q2);
+                        }
                     }
                 }
             }
@@ -833,6 +836,7 @@
     
     protected void createInputWrappedMessageParts(OperationInfo op, Method method, MessageInfo inMsg) {
         MessagePartInfo part = inMsg.addMessagePart("parameters");
+        part.setIndex(0);
         part.setElement(true);
         for (Iterator itr = serviceConfigurations.iterator(); itr.hasNext();) {
             AbstractServiceConfiguration c = (AbstractServiceConfiguration)itr.next();
@@ -864,7 +868,7 @@
     protected void createOutputWrappedMessageParts(OperationInfo op, Method method, MessageInfo outMsg) {
         MessagePartInfo part = outMsg.addMessagePart("result");
         part.setElement(true);
-        part.setIndex(-1);
+        part.setIndex(0);
         for (Iterator itr = serviceConfigurations.iterator(); itr.hasNext();) {
             AbstractServiceConfiguration c = (AbstractServiceConfiguration)itr.next();
             QName q = c.getResponseWrapperName(op, method);

Modified: incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestination.java Tue Jul 24 11:47:01 2007
@@ -109,9 +109,6 @@
         public void prepare(Message message) throws IOException {
             // setup the message to be send back
             DeliveryChannel dc = channel;
-            if (dc == null) {
-                dc = JBITransportFactory.getDeliveryChannel();
-            }
             message.put(MessageExchange.class, inMessage.get(MessageExchange.class));
             message.setContent(OutputStream.class,
                                new JBIDestinationOutputStream(inMessage, dc));

Modified: incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java Tue Jul 24 11:47:01 2007
@@ -52,7 +52,7 @@
     private static final Logger LOG = LogUtils.getL7dLogger(JBITransportFactory.class);
 
 
-    private static DeliveryChannel deliveryChannel;
+    private DeliveryChannel deliveryChannel;
     private Bus bus;
     private final Map<String, JBIDestination> destinationMap =  new HashMap<String, JBIDestination>();
     
@@ -100,11 +100,11 @@
     
 
     
-    public static DeliveryChannel getDeliveryChannel() {
+    public DeliveryChannel getDeliveryChannel() {
         return deliveryChannel;
     }
 
-    public static void setDeliveryChannel(DeliveryChannel newDeliverychannel) {
+    public void setDeliveryChannel(DeliveryChannel newDeliverychannel) {
         LOG.info(new org.apache.cxf.common.i18n.Message(
             "CONFIG.DELIVERY.CHANNEL", LOG).toString() + newDeliverychannel);
         deliveryChannel = newDeliverychannel;

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Tue Jul 24 11:47:01 2007
@@ -338,7 +338,7 @@
         partInfo.setElementQName(RMConstants.getCreateSequenceResponseOperationName());
         partInfo.setElement(true);
         partInfo.setTypeClass(CreateSequenceResponseType.class);
-        partInfo.setIndex(-1);
+        partInfo.setIndex(0);
 
         operationInfo = ii.addOperation(RMConstants.getCreateSequenceOnewayOperationName());
         messageInfo = operationInfo.createMessage(RMConstants.getCreateSequenceOperationName());

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java Tue Jul 24 11:47:01 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.systest.jaxws;
 
 import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -29,6 +30,7 @@
 import javax.xml.ws.Holder;
 import javax.xml.ws.Service;
 import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexType;
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeService;
@@ -50,7 +52,7 @@
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(ServerMisc.class, true));
+        assertTrue("server did not launch correctly", launchServer(ServerMisc.class));
     }
 
     @Test
@@ -150,7 +152,7 @@
     }
     
     @Test
-    public void testStringListOut() throws Exception {
+    public void testStringListOutDocLitNoWsdl() throws Exception {
         QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", 
                                    "DocLitWrappedCodeFirstServicePort");
         QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", 
@@ -160,13 +162,27 @@
         service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, ServerMisc.DOCLIT_CODEFIRST_URL);
         DocLitWrappedCodeFirstService port = service.getPort(portName,
                                                              DocLitWrappedCodeFirstService.class);
+        runDocLitTest(port);
+    }
+
+    @Test
+    public void testStringListOutDocLitWsdl() throws Exception {
+        QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", 
+                                   "DocLitWrappedCodeFirstServicePort");
+        QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", 
+                                   "DocLitWrappedCodeFirstService");
         
-        
-        
+        Service service = Service.create(new URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl"),
+                                         servName);
+        DocLitWrappedCodeFirstService port = service.getPort(portName,
+                                                             DocLitWrappedCodeFirstService.class);
+        runDocLitTest(port);
+    }
+    
+    private void runDocLitTest(DocLitWrappedCodeFirstService port) throws Exception {
         List<String> rev = new ArrayList<String>(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA));
         Collections.reverse(rev);
         
-        
         String s;
         
         String arrayOut[] = port.arrayOutput();
@@ -205,5 +221,135 @@
                                         null, 24);
         assertEquals("string1string2string3string3string2string1<null>24", s);
         
+        Holder<String> a = new Holder<String>();
+        Holder<String> b = new Holder<String>("Hello");
+        Holder<String> c = new Holder<String>();
+        Holder<String> d = new Holder<String>(" ");
+        Holder<String> e = new Holder<String>("world!");
+        Holder<String> f = new Holder<String>();
+        Holder<String> g = new Holder<String>();
+        s = port.multiInOut(a, b, c, d, e, f, g);
+        assertEquals("Hello world!", s);
+        assertEquals("a", a.value);
+        assertEquals("b", b.value);
+        assertEquals("c", c.value);
+        assertEquals("d", d.value);
+        assertEquals("e", e.value);
+        assertEquals("f", f.value);
+        assertEquals("g", g.value);
+    }
+    @Test
+    public void testRpcLitNoWsdl() throws Exception {
+        QName portName = new QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService", 
+                                   "RpcLitCodeFirstServicePort");
+        QName servName = new QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService", 
+                                   "RpcLitCodeFirstService");
+        
+        Service service = Service.create(servName);
+        service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, ServerMisc.RPCLIT_CODEFIRST_URL);
+        RpcLitCodeFirstService port = service.getPort(portName,
+                                                      RpcLitCodeFirstService.class);
+        runRpcLitTest(port);
+    }
+    
+    
+    @Test
+    public void testRpcLitWsdl() throws Exception {
+        QName portName = new QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService", 
+            "RpcLitCodeFirstServicePort");
+        QName servName = new QName("http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService", 
+            "RpcLitCodeFirstService");
+        
+        Service service = Service.create(new URL(ServerMisc.RPCLIT_CODEFIRST_URL + "?wsdl"),
+                                         servName);
+        RpcLitCodeFirstService port = service.getPort(portName,
+                                                      RpcLitCodeFirstService.class);
+        runRpcLitTest(port);
+    }
+
+    private void runRpcLitTest(RpcLitCodeFirstService port) throws Exception {
+        List<String> rev = new ArrayList<String>(Arrays.asList(RpcLitCodeFirstServiceImpl.DATA));
+        Collections.reverse(rev);
+        
+        String s;
+        
+        String arrayOut[] = port.arrayOutput();
+        assertNotNull(arrayOut);
+        assertEquals(3, arrayOut.length);
+        for (int x = 0; x < 3; x++) {
+            assertEquals(RpcLitCodeFirstServiceImpl.DATA[x], arrayOut[x]);
+        }
+        
+        List<String> listOut = port.listOutput();
+        assertNotNull(listOut);
+        assertEquals(3, listOut.size());
+        for (int x = 0; x < 3; x++) {
+            assertEquals(RpcLitCodeFirstServiceImpl.DATA[x], listOut.get(x));
+        }
+        
+        s = port.arrayInput(RpcLitCodeFirstServiceImpl.DATA);
+        assertEquals("string1string2string3", s);
+        s = port.listInput(java.util.Arrays.asList(RpcLitCodeFirstServiceImpl.DATA));
+        assertEquals("string1string2string3", s);
+        
+        s = port.multiListInput(Arrays.asList(RpcLitCodeFirstServiceImpl.DATA),
+                                rev,
+                                "Hello", 24);
+        assertEquals("string1string2string3string3string2string1Hello24", s);
+        
+        
+        s = port.listInput(new ArrayList<String>());
+        assertEquals("", s);
+
+        try {
+            s = port.listInput(null);
+            fail("RPC/Lit parts cannot be null");
+        } catch (SOAPFaultException ex) {
+            //ignore, expected
+        }
+
+        try {
+            s = port.multiListInput(Arrays.asList(RpcLitCodeFirstServiceImpl.DATA),
+                                            rev,
+                                            null, 24);
+            fail("RPC/Lit parts cannot be null");
+        } catch (SOAPFaultException ex) {
+            //ignore, expected
+        }
+        
+        Holder<String> a = new Holder<String>();
+        Holder<String> b = new Holder<String>("Hello");
+        Holder<String> c = new Holder<String>();
+        Holder<String> d = new Holder<String>(" ");
+        Holder<String> e = new Holder<String>("world!");
+        Holder<String> f = new Holder<String>();
+        Holder<String> g = new Holder<String>();
+        s = port.multiInOut(a, b, c, d, e, f, g);
+        assertEquals("Hello world!", s);
+        assertEquals("a", a.value);
+        assertEquals("b", b.value);
+        assertEquals("c", c.value);
+        assertEquals("d", d.value);
+        assertEquals("e", e.value);
+        assertEquals("f", f.value);
+        assertEquals("g", g.value);
+        
+        a = new Holder<String>();
+        b = new Holder<String>("Hello");
+        c = new Holder<String>();
+        d = new Holder<String>(" ");
+        e = new Holder<String>("world!");
+        f = new Holder<String>();
+        g = new Holder<String>();
+        s = port.multiHeaderInOut(a, b, c, d, e, f, g);
+        assertEquals("Hello world!", s);
+        assertEquals("a", a.value);
+        assertEquals("b", b.value);
+        assertEquals("c", c.value);
+        assertEquals("d", d.value);
+        assertEquals("e", e.value);
+        assertEquals("f", f.value);
+        assertEquals("g", g.value);        
     }
+       
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java Tue Jul 24 11:47:01 2007
@@ -25,6 +25,7 @@
 import javax.jws.WebParam;
 import javax.jws.WebService;
 import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
 
 
 @WebService(name = "DocLitWrappedCodeFirstService",
@@ -47,4 +48,21 @@
 
     @WebMethod
     String multiListInput(List<String> inputs1, List<String> inputs2, String x, int y);
+    
+    @WebMethod
+    String multiInOut(@WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> a,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> b,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> c,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> d,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> e,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> f,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> g);
+    
 }

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java Tue Jul 24 11:47:01 2007
@@ -23,6 +23,7 @@
 import java.util.Vector;
 
 import javax.jws.WebService;
+import javax.xml.ws.Holder;
 
 @WebService(endpointInterface = "org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService",
             serviceName = "DocLitWrappedCodeFirstService",
@@ -77,5 +78,19 @@
         buf.append(Integer.toString(y));
         return buf.toString();
     }
+    
+    public String multiInOut(Holder<String> a, Holder<String> b, Holder<String> c, Holder<String> d,
+                             Holder<String> e, Holder<String> f, Holder<String> g) {
+        String ret = b.value + d.value + e.value; 
+        a.value = "a";
+        b.value = "b";
+        c.value = "c";
+        d.value = "d";
+        e.value = "e";
+        f.value = "f";
+        g.value = "g";
+        return ret;
+    }
+   
 
 }

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java?view=auto&rev=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java Tue Jul 24 11:47:01 2007
@@ -0,0 +1,86 @@
+/**
+ * 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.systest.jaxws;
+
+import java.util.List;
+import java.util.Vector;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
+
+
+@WebService(name = "RpcLitCodeFirstService",
+            targetNamespace = "http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService")
+@SOAPBinding(style = SOAPBinding.Style.RPC,
+             use = SOAPBinding.Use.LITERAL)
+public interface RpcLitCodeFirstService {
+    @WebMethod
+    String[] arrayOutput();
+
+    @WebMethod
+    String arrayInput(
+            @WebParam(name = "input") String[] inputs);
+
+    @WebMethod
+    Vector<String> listOutput();
+    
+    @WebMethod
+    String listInput(List<String> inputs);
+
+    @WebMethod
+    String multiListInput(List<String> inputs1, List<String> inputs2, String x, int y);
+    
+    
+    @WebMethod
+    String multiInOut(@WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> a,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> b,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> c,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> d,
+                      @WebParam(mode = WebParam.Mode.INOUT)
+                      Holder<String> e,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> f,
+                      @WebParam(mode = WebParam.Mode.OUT)
+                      Holder<String> g);
+    
+    @WebMethod
+    String multiHeaderInOut(
+                        @WebParam(mode = WebParam.Mode.OUT, header = true)
+                        Holder<String> a,
+                        @WebParam(mode = WebParam.Mode.INOUT)
+                        Holder<String> b,
+                        @WebParam(mode = WebParam.Mode.OUT)
+                        Holder<String> c,
+                        @WebParam(mode = WebParam.Mode.INOUT, header = true)
+                        Holder<String> d,
+                        @WebParam(mode = WebParam.Mode.INOUT)
+                        Holder<String> e,
+                        @WebParam(mode = WebParam.Mode.OUT, header = true)
+                        Holder<String> f,
+                        @WebParam(mode = WebParam.Mode.OUT)
+                        Holder<String> g);
+
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstService.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java?view=auto&rev=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java Tue Jul 24 11:47:01 2007
@@ -0,0 +1,107 @@
+/**
+ * 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.systest.jaxws;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import javax.jws.WebService;
+import javax.xml.ws.Holder;
+
+@WebService(endpointInterface = "org.apache.cxf.systest.jaxws.RpcLitCodeFirstService",
+            serviceName = "RpcLitCodeFirstService",
+            portName = "RpcLitCodeFirstServicePort",
+            targetNamespace = "http://cxf.apache.org/systest/jaxws/RpcLitCodeFirstService")
+public class RpcLitCodeFirstServiceImpl implements RpcLitCodeFirstService {
+    public static final String DATA[] = new String[] {"string1", "string2", "string3"};
+    
+    public int thisShouldNotBeInTheWSDL(int i) {
+        return i;
+    }
+    
+    public String[] arrayOutput() {
+        return DATA;
+    }
+
+    public Vector<String> listOutput() {
+        return new Vector<String>(Arrays.asList(DATA));
+    }
+
+    public String arrayInput(String[] inputs) {
+        StringBuffer buf = new StringBuffer();
+        for (String s : inputs) {
+            buf.append(s);
+        }
+        return buf.toString();
+    }
+
+    public String listInput(List<String> inputs) {
+        StringBuffer buf = new StringBuffer();
+        if (inputs != null) {
+            for (String s : inputs) {
+                buf.append(s);
+            }
+        }
+        return buf.toString();
+    }
+    
+    public String multiListInput(List<String> inputs1, List<String> inputs2, String x, int y) {
+        StringBuffer buf = new StringBuffer();
+        for (String s : inputs1) {
+            buf.append(s);
+        }
+        for (String s : inputs2) {
+            buf.append(s);
+        }
+        if (x == null) {
+            buf.append("<null>");
+        } else {
+            buf.append(x);
+        }
+        buf.append(Integer.toString(y));
+        return buf.toString();
+    }
+
+    public String multiInOut(Holder<String> a, Holder<String> b, Holder<String> c, Holder<String> d,
+                             Holder<String> e, Holder<String> f, Holder<String> g) {
+        String ret = b.value + d.value + e.value; 
+        a.value = "a";
+        b.value = "b";
+        c.value = "c";
+        d.value = "d";
+        e.value = "e";
+        f.value = "f";
+        g.value = "g";
+        return ret;
+    }
+    public String multiHeaderInOut(Holder<String> a, Holder<String> b,
+                                   Holder<String> c,  Holder<String> d,
+                                   Holder<String> e, Holder<String> f, Holder<String> g) {
+        String ret = b.value + d.value + e.value; 
+        a.value = "a";
+        b.value = "b";
+        c.value = "c";
+        d.value = "d";
+        e.value = "e";
+        f.value = "f";
+        g.value = "g";
+        return ret;
+    }
+}

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/RpcLitCodeFirstServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java Tue Jul 24 11:47:01 2007
@@ -30,6 +30,8 @@
 public class ServerMisc extends AbstractBusTestServerBase {
     public static final String DOCLIT_CODEFIRST_URL = 
         "http://localhost:9003/DocLitWrappedCodeFirstService/";
+    public static final String RPCLIT_CODEFIRST_URL = 
+        "http://localhost:9003/RpcLitCodeFirstService/";
     
     
     protected void run() {
@@ -47,6 +49,9 @@
         
         Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
         Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
+        
+        Object implementor5 = new RpcLitCodeFirstServiceImpl();
+        Endpoint.publish(RPCLIT_CODEFIRST_URL, implementor5);
     }
 
     public static void main(String[] args) {

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jbi/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jbi/ClientServerTest.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jbi/ClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jbi/ClientServerTest.java Tue Jul 24 11:47:01 2007
@@ -94,7 +94,7 @@
                 getConduitInitiator(CXFServiceEngine.JBI_TRANSPORT_ID);
         jbiTransportFactory.setBus(bus);
         
-        JBITransportFactory.setDeliveryChannel(channel);
+        jbiTransportFactory.setDeliveryChannel(channel);
         HelloWorldService ss = new HelloWorldService(wsdl, serviceName);
         
         Greeter port = ss.getSoapPort();

Modified: incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java?view=diff&rev=559158&r1=559157&r2=559158
==============================================================================
--- incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java (original)
+++ incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/ResponseWrapper.java Tue Jul 24 11:47:01 2007
@@ -92,10 +92,10 @@
         final Class[] paramClasses = method.getParameterTypes();
         for (MessagePartInfo mpi : message.getMessageParts()) {
             int idx = mpi.getIndex();
-            if (idx >= 0) {
+            if (idx > 0) {
                 String name = mpi.getName().getLocalPart();
                 String type;
-                Class clz = paramClasses[idx];
+                Class clz = paramClasses[idx - 1];
                 if (clz.isArray()) {
                     if (isBuiltInTypes(clz.getComponentType())) {
                         type = clz.getComponentType().getSimpleName() + "[]";



Mime
View raw message