cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r755153 - in /cxf/trunk: api/src/main/java/org/apache/cxf/databinding/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/ rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbea...
Date Tue, 17 Mar 2009 08:47:07 GMT
Author: ningjiang
Date: Tue Mar 17 08:47:06 2009
New Revision: 755153

URL: http://svn.apache.org/viewvc?rev=755153&view=rev
Log:
CXF-2116, CXF-2099 Refactoring of the WrapperHelper

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java   (with props)
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java   (with props)
    cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java   (with props)
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java   (with props)
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java   (contents, props changed)
      - copied, changed from r755069, cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java   (contents, props changed)
      - copied, changed from r755069, cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperHelperTest.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java   (with props)
Removed:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelper.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperHelperTest.java
Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java

Added: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java?rev=755153&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java Tue Mar 17 08:47:06 2009
@@ -0,0 +1,135 @@
+/**
+ * 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.databinding;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.Fault;
+
+/**
+ *  This wrapper helper will use reflection to handle the wrapped message
+ */
+public abstract class AbstractWrapperHelper implements WrapperHelper {
+    
+    public static final Class NO_CLASSES[] = new Class[0];
+    public static final Object NO_PARAMS[] = new Object[0];
+        
+    protected final Class<?> wrapperType;
+    protected final Method setMethods[];
+    protected final Method getMethods[];    
+    protected final Field fields[];   
+                 
+    protected AbstractWrapperHelper(Class<?> wt,
+                  Method sets[],
+                  Method gets[],                  
+                  Field f[]) {
+        setMethods = sets;
+        getMethods = gets;
+        fields = f;        
+        wrapperType = wt;        
+    }
+    
+    public String getSignature() {
+        return "" + System.identityHashCode(this);
+    }
+    
+    protected abstract Object createWrapperObject(Class typeClass) throws Exception;
+    
+    protected abstract Object getWrapperObject(Object object) throws Exception;
+    
+    protected Object getPartObject(int index, Object object) throws Exception {
+        return object;
+    }
+    
+    protected Object getValue(Method method, Object in) throws IllegalAccessException,
+    InvocationTargetException {        
+        return method.invoke(in);    
+    }
+    
+    public Object createWrapperObject(List<?> lst) 
+        throws Fault {
+        try {
+            Object wrapperObject = createWrapperObject(wrapperType);
+            
+            for (int x = 0; x < setMethods.length; x++) {
+                if (getMethods[x] == null
+                    && setMethods[x] == null 
+                    && fields[x] == null) {
+                    //this part is a header or something
+                    //that is not part of the wrapper.
+                    continue;
+                }
+                Object o = lst.get(x);
+                o = getPartObject(x, o);                
+                if (o instanceof List) {
+                    List<Object> col = CastUtils.cast((List)getMethods[x].invoke(wrapperObject));
+                    if (col == null) {
+                        //broken generated java wrappers
+                        if (setMethods[x] != null) {
+                            setMethods[x].invoke(wrapperObject, o);
+                        } else {
+                            fields[x].set(wrapperObject, lst.get(x));
+                        }
+                    } else {
+                        List<Object> olst = CastUtils.cast((List)o);
+                        col.addAll(olst);
+                    }
+                } else if (setMethods[x] != null) {                        
+                    setMethods[x].invoke(wrapperObject, o);
+                } else if (fields[x] != null) {
+                    fields[x].set(wrapperObject, lst.get(x));
+                }
+            }
+            return wrapperObject;
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            throw new Fault(ex.getCause());
+        }
+    }
+    
+    public List<Object> getWrapperParts(Object o) throws Fault {
+        try {
+            Object wrapperObject = getWrapperObject(o);                          
+            List<Object> ret = new ArrayList<Object>(getMethods.length);
+            for (int x = 0; x < getMethods.length; x++) {
+                if (getMethods[x] != null) {
+                    ret.add(getValue(getMethods[x], wrapperObject));                        
+                } else if (fields[x] != null) {
+                    ret.add(fields[x].get(wrapperObject));
+                } else {
+                    //placeholder
+                    ret.add(null);
+                }
+            }
+            
+            return ret;
+        } catch (Exception ex) {
+            throw new Fault(ex.getCause());
+        }
+    }
+    
+   
+}
+
+

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/AbstractWrapperHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java?rev=755153&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java Tue Mar 17 08:47:06 2009
@@ -0,0 +1,33 @@
+/**
+ * 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.databinding;
+
+import java.util.List;
+
+/**
+ *  To create the WrapperHelper instance for the wrapper capable data binding
+ */
+public interface WrapperCapableDatabinding {
+        
+    WrapperHelper createWrapperHelper(Class<?> wrapperType,
+                                      List<String> partNames,
+                                      List<String> elTypeNames,
+                                      List<Class<?>> partClasses);
+
+}

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperCapableDatabinding.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java?rev=755153&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java Tue Mar 17 08:47:06 2009
@@ -0,0 +1,39 @@
+/**
+ * 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.databinding;
+
+import java.util.List;
+
+import org.apache.cxf.interceptor.Fault;
+
+/**
+ *  This wrapper helper will help to create a wrapper object with part elements or 
+ *  get a list of part elements from a wrapper object.
+ */
+public interface WrapperHelper {    
+    
+    Object createWrapperObject(List<?> lst) throws Fault;
+    
+    List<Object> getWrapperParts(Object o) throws Fault;
+
+    String getSignature();
+    
+
+}

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/databinding/WrapperHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=755153&r1=755152&r2=755153&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java Tue Mar 17 08:47:06 2009
@@ -25,6 +25,7 @@
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.lang.ref.WeakReference;
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -41,11 +42,13 @@
 import java.util.regex.Pattern;
 
 import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.SchemaOutputResolver;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.ValidationEventHandler;
+import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlElementDecl;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLEventWriter;
@@ -65,8 +68,11 @@
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.databinding.AbstractDataBinding;
+import org.apache.cxf.databinding.AbstractWrapperHelper;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.databinding.WrapperCapableDatabinding;
+import org.apache.cxf.databinding.WrapperHelper;
 import org.apache.cxf.jaxb.io.DataReaderImpl;
 import org.apache.cxf.jaxb.io.DataWriterImpl;
 import org.apache.cxf.service.Service;
@@ -74,7 +80,7 @@
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.ws.addressing.ObjectFactory;
 
-public class JAXBDataBinding extends AbstractDataBinding {
+public class JAXBDataBinding extends AbstractDataBinding  implements WrapperCapableDatabinding {
     public static final String SCHEMA_RESOURCE = "SCHEMRESOURCE";
     public static final String MTOM_THRESHOLD = "org.apache.cxf.jaxb.mtomThreshold";
 
@@ -718,4 +724,187 @@
         }
     }
 
+    public WrapperHelper createWrapperHelper(Class<?> wrapperType, List<String> partNames,
+                                             List<String> elTypeNames, List<Class<?>> partClasses) {
+        List<Method> getMethods = new ArrayList<Method>(partNames.size());
+        List<Method> setMethods = new ArrayList<Method>(partNames.size());
+        List<Method> jaxbMethods = new ArrayList<Method>(partNames.size());
+        List<Field> fields = new ArrayList<Field>(partNames.size());
+        
+        Method allMethods[] = wrapperType.getMethods();
+        String packageName = PackageUtils.getPackageName(wrapperType);
+        
+        //if wrappertype class is generated by ASM,getPackage() always return null
+        if (wrapperType.getPackage() != null) {
+            packageName = wrapperType.getPackage().getName();
+        }
+        
+        String objectFactoryClassName = packageName + ".ObjectFactory";
+
+        Object objectFactory = null;
+        try {
+            objectFactory = wrapperType.getClassLoader().loadClass(objectFactoryClassName).newInstance();
+        } catch (Exception e) {
+            //ignore, probably won't need it
+        }
+        Method allOFMethods[];
+        if (objectFactory != null) {
+            allOFMethods = objectFactory.getClass().getMethods(); 
+        } else {
+            allOFMethods = new Method[0];
+        }
+        
+        for (int x = 0; x < partNames.size(); x++) {
+            String partName = partNames.get(x);            
+            if (partName == null) {
+                getMethods.add(null);
+                setMethods.add(null);
+                fields.add(null);
+                jaxbMethods.add(null);
+                continue;
+            }
+            
+            String elementType = elTypeNames.get(x);
+            
+            String getAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.GETTER);
+            String setAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.SETTER);
+            Method getMethod = null;
+            Method setMethod = null;
+            Class<?> valueClass = wrapperType;
+            
+            try {               
+                getMethod = valueClass.getMethod(getAccessor, AbstractWrapperHelper.NO_CLASSES); 
+            } catch (NoSuchMethodException ex) {
+                //ignore for now
+            }
+            
+            Field elField = getElField(partName, valueClass);
+            if (getMethod == null
+                && elementType != null
+                && "boolean".equals(elementType.toLowerCase())
+                && (elField == null
+                    || (!Collection.class.isAssignableFrom(elField.getType())
+                    && !elField.getType().isArray()))) {
+        
+                try {
+                    String newAcc = getAccessor.replaceFirst("get", "is");
+                    getMethod = wrapperType.getMethod(newAcc, AbstractWrapperHelper.NO_CLASSES); 
+                } catch (NoSuchMethodException ex) {
+                    //ignore for now
+                }            
+            }                        
+            if (getMethod == null 
+                && "return".equals(partName)) {
+                //RI generated code uses this
+                try {
+                    getMethod = valueClass.getMethod("get_return", AbstractWrapperHelper.NO_CLASSES);
+                } catch (NoSuchMethodException ex) {
+                    try {
+                        getMethod = valueClass.getMethod("is_return",
+                                                          new Class[0]);
+                    } catch (NoSuchMethodException ex2) {
+                        //ignore for now
+                    } 
+                }                
+            }
+            String setAccessor2 = setAccessor;
+            if ("return".equals(partName)) {
+                //some versions of jaxb map "return" to "set_return" instead of "setReturn"
+                setAccessor2 = "set_return";
+            }
+
+            for (Method method : allMethods) {
+                if (method.getParameterTypes() != null && method.getParameterTypes().length == 1
+                    && (setAccessor.equals(method.getName())
+                        || setAccessor2.equals(method.getName()))) {
+                    setMethod = method;
+                    break;
+                }
+            }
+            
+            getMethods.add(getMethod);
+            setMethods.add(setMethod);
+            if (setMethod != null
+                && JAXBElement.class.isAssignableFrom(setMethod.getParameterTypes()[0])) {
+                
+                String methodName = "create" + wrapperType.getSimpleName()
+                    + setMethod.getName().substring(3);
+
+                for (Method m : allOFMethods) {
+                    if (m.getName().equals(methodName)) {
+                        jaxbMethods.add(m);
+                    }
+                }
+            } else {
+                jaxbMethods.add(null);
+            }
+            
+            if (elField != null) {
+                // JAXB Type get XmlElement Annotation
+                XmlElement el = elField.getAnnotation(XmlElement.class);
+                if (el != null
+                    && partName.equals(el.name())) {
+                    elField.setAccessible(true);
+                    fields.add(elField);
+                } else {
+                    fields.add(null);
+                } 
+            } else {
+                fields.add(null);
+            }
+            
+        }
+        
+        return createWrapperHelper(wrapperType,
+                                 setMethods.toArray(new Method[setMethods.size()]),
+                                 getMethods.toArray(new Method[getMethods.size()]),
+                                 jaxbMethods.toArray(new Method[jaxbMethods.size()]),
+                                 fields.toArray(new Field[fields.size()]),
+                                 objectFactory);
+    }
+    
+    private static Field getElField(String partName, Class<?> wrapperType) {
+        String fieldName = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.VARIABLE);
+        for (Field field : wrapperType.getDeclaredFields()) {
+            XmlElement el = field.getAnnotation(XmlElement.class);
+            if (el != null
+                && partName.equals(el.name())) {
+                return field;
+            }
+            if (field.getName().equals(fieldName)) {
+                return field;
+            }
+        }        
+        return null;
+    }
+
+    
+    private static WrapperHelper createWrapperHelper(Class<?> wrapperType, Method setMethods[],
+                                                     Method getMethods[], Method jaxbMethods[],
+                                                     Field fields[], Object objectFactory) {
+
+        WrapperHelper wh = compileWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
+                                                objectFactory);
+
+        if (wh == null) {
+            wh = new JAXBWrapperHelper(wrapperType, setMethods, getMethods, jaxbMethods, fields,
+                                       objectFactory);
+        }
+        return wh;
+    }
+
+    private static WrapperHelper compileWrapperHelper(Class<?> wrapperType, Method setMethods[],
+                                                      Method getMethods[], Method jaxbMethods[],
+                                                      Field fields[], Object objectFactory) {
+        try {
+            Class.forName("org.objectweb.asm.ClassWriter");
+            return WrapperHelperCompiler.compileWrapperHelper(wrapperType, setMethods, getMethods,
+                                                              jaxbMethods, fields, objectFactory);
+        } catch (ClassNotFoundException e) {
+            // ASM not found, just use reflection based stuff
+            e.printStackTrace();
+        }
+        return null;
+    }   
+
 }

Added: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java?rev=755153&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java (added)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java Tue Mar 17 08:47:06 2009
@@ -0,0 +1,73 @@
+/**
+ * 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.jaxb;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.cxf.databinding.AbstractWrapperHelper;
+
+/**
+ * 
+ */
+public class JAXBWrapperHelper extends AbstractWrapperHelper {
+    protected final Method jaxbObjectMethods[];    
+    protected final Object objectFactory;
+
+    protected JAXBWrapperHelper(Class<?> wt, Method[] sets, Method[] gets,
+                                Method jaxbs[], Field[] f, Object of) {
+        super(wt, sets, gets, f);
+        jaxbObjectMethods = jaxbs;
+        objectFactory = of;        
+    }
+
+    @Override
+    protected Object createWrapperObject(Class typeClass) throws Exception {       
+        return typeClass.newInstance();
+    }
+    
+    @Override
+    protected Object getWrapperObject(Object object) {
+        return object;
+    }
+    
+    @Override
+    protected Object getValue(Method method, Object in) throws IllegalAccessException,
+    InvocationTargetException {
+        if ("javax.xml.bind.JAXBElement".equals(method.getReturnType().getCanonicalName())) {
+            JAXBElement je = (JAXBElement)method.invoke(in);
+            return je == null ? je : je.getValue();
+        } else {            
+            return method.invoke(in);    
+        }
+    }
+    
+    @Override
+    protected Object getPartObject(int index, Object object) throws Exception {
+        Object result = object;
+        if (jaxbObjectMethods[index] != null) {
+            result = jaxbObjectMethods[index].invoke(objectFactory, object);
+        }
+        return result;
+    }
+}

Propchange: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBWrapperHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java (from r755069, cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java?p2=cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java&p1=cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java&r1=755069&r2=755153&rev=755153&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java Tue Mar 17 08:47:06 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cxf.jaxws.interceptors;
+package org.apache.cxf.jaxb;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -25,6 +25,7 @@
 import javax.xml.bind.JAXBElement;
 
 import org.apache.cxf.common.util.ASMHelper;
+import org.apache.cxf.databinding.WrapperHelper;
 import org.objectweb.asm.ClassWriter;
 import org.objectweb.asm.FieldVisitor;
 import org.objectweb.asm.Label;

Propchange: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java (from r755069, cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperHelperTest.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java?p2=cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java&p1=cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperHelperTest.java&r1=755069&r2=755153&rev=755153&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperHelperTest.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java Tue Mar 17 08:47:06 2009
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.cxf.jaxws;
+package org.apache.cxf.jaxb;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -28,11 +28,11 @@
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
-import org.apache.cxf.jaxws.interceptors.WrapperHelper;
+import org.apache.cxf.databinding.WrapperHelper;
 import org.junit.Assert;
 import org.junit.Test;
 
-public class WrapperHelperTest extends Assert {
+public class JAXBWrapperHelperTest extends Assert {
 
 
     @Test
@@ -63,7 +63,7 @@
             List.class,
         });
         
-        WrapperHelper wh = WrapperHelper.createWrapperHelper(SetIsOK.class,
+        WrapperHelper wh = new JAXBDataBinding().createWrapperHelper(SetIsOK.class,
                                           partNames,
                                           elTypeNames,
                                           partClasses);

Propchange: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/JAXBWrapperHelperTest.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java?rev=755153&r1=755152&r2=755153&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java (original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansDataBinding.java Tue Mar 17 08:47:06 2009
@@ -19,6 +19,10 @@
 
 package org.apache.cxf.xmlbeans;
 
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -28,20 +32,25 @@
 
 import org.w3c.dom.Node;
 
-
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.databinding.AbstractDataBinding;
+import org.apache.cxf.databinding.AbstractWrapperHelper;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataWriter;
+import org.apache.cxf.databinding.WrapperCapableDatabinding;
+import org.apache.cxf.databinding.WrapperHelper;
+import org.apache.cxf.jaxb.JAXBUtils;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.ServiceInfo;
 
 
+
+
 /**
  * 
  */
-public class XmlBeansDataBinding extends AbstractDataBinding {
+public class XmlBeansDataBinding extends AbstractDataBinding implements WrapperCapableDatabinding {
     private static final Logger LOG = LogUtils.getLogger(XmlBeansDataBinding.class);
 
     private static final Class<?> SUPPORTED_READER_FORMATS[] = new Class<?>[] {XMLStreamReader.class};
@@ -103,4 +112,56 @@
         }
     }
 
+    public WrapperHelper createWrapperHelper(Class<?> wrapperType, List<String> partNames,
+                                             List<String> elTypeNames, List<Class<?>> partClasses) {
+        
+        List<Method> getMethods = new ArrayList<Method>(partNames.size());
+        List<Method> setMethods = new ArrayList<Method>(partNames.size());        
+        List<Field> fields = new ArrayList<Field>(partNames.size());
+        
+        Method allMethods[] = wrapperType.getMethods();
+                        
+        for (int x = 0; x < partNames.size(); x++) {
+            String partName = partNames.get(x);            
+            if (partName == null) {
+                getMethods.add(null);
+                setMethods.add(null);
+                fields.add(null);
+                continue;
+            }
+                                   
+            String getAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.GETTER);
+            String setAccessor = JAXBUtils.nameToIdentifier(partName, JAXBUtils.IdentifierType.SETTER);
+            Method getMethod = null;
+            Method setMethod = null;
+            Class<?> valueClass = XmlBeansWrapperHelper.getXMLBeansValueType(wrapperType);
+            allMethods = valueClass.getMethods();
+            
+            try {
+                getMethod = valueClass.getMethod(getAccessor, AbstractWrapperHelper.NO_CLASSES);
+            } catch (NoSuchMethodException ex) {
+                //ignore for now
+            }
+                        
+            for (Method method : allMethods) {
+                if (method.getParameterTypes() != null && method.getParameterTypes().length == 1
+                    && (setAccessor.equals(method.getName()))) {                        
+                    setMethod = method;
+                    break;
+                }
+            }
+            
+            getMethods.add(getMethod);
+            setMethods.add(setMethod);
+            // There is no filed in the XMLBeans type class
+            fields.add(null);
+            
+        }
+        
+        return new XmlBeansWrapperHelper(wrapperType,
+                                 setMethods.toArray(new Method[setMethods.size()]),
+                                 getMethods.toArray(new Method[getMethods.size()]),
+                                 fields.toArray(new Field[fields.size()]));
+    }
+
 }

Added: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java?rev=755153&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java (added)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java Tue Mar 17 08:47:06 2009
@@ -0,0 +1,98 @@
+/**
+ * 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.xmlbeans;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.apache.cxf.databinding.AbstractWrapperHelper;
+import org.apache.xmlbeans.XmlOptions;
+
+
+public class XmlBeansWrapperHelper extends AbstractWrapperHelper {
+    
+    private boolean validate;
+            
+    public XmlBeansWrapperHelper(Class<?> wt, Method[] sets, Method[] gets, Field[] f) {
+        super(wt, sets, gets, f);
+       
+    }
+    
+    public void setValidate(boolean v) {
+        validate = v;
+    }
+    
+    public boolean getValidate() {
+        return validate;
+    }
+
+    @Override
+    protected Object createWrapperObject(Class typeClass) throws Exception {
+        Class<?> cls[] = typeClass.getDeclaredClasses();
+        Method newType = null;
+        for (Method method : typeClass.getMethods()) {
+            if (method.getName().startsWith("addNew")) {
+                newType = method;
+                break;
+            }
+        }                     
+        Object obj = null;
+        for (Class<?> c : cls) {                        
+            if ("Factory".equals(c.getSimpleName())) {
+                if (validate) {
+                    // set the validation option here
+                    Method method = c.getMethod("newInstance", XmlOptions.class); 
+                    XmlOptions options = new XmlOptions();                    
+                    options.setValidateOnSet();                    
+                    obj = method.invoke(null, options);
+                } else {
+                    Method method = c.getMethod("newInstance", NO_CLASSES);
+                    obj = method.invoke(null, NO_PARAMS);                    
+                }
+                // create the value object
+                obj = newType.invoke(obj, NO_PARAMS);
+                break;
+            }
+        }
+        
+        return obj;
+    }
+
+    @Override
+    protected Object getWrapperObject(Object object) throws Exception {                            
+        Class<?> valueClass = getXMLBeansValueType(wrapperType);
+        // we need get the real Object first
+        Method method = wrapperType.getMethod("get" + valueClass.getSimpleName(), NO_CLASSES);
+        return method.invoke(object, NO_PARAMS);
+        
+    }
+    
+    public static Class<?> getXMLBeansValueType(Class<?> wrapperType)  {
+        Class<?> result = wrapperType;
+        for (Method method : wrapperType.getMethods()) {
+            if (method.getName().startsWith("addNew")) {                
+                result = method.getReturnType();
+                break;
+            }
+        }
+        return result;
+    }
+
+}

Propchange: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansWrapperHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?rev=755153&r1=755152&r2=755153&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java Tue Mar 17 08:47:06 2009
@@ -26,18 +26,23 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.databinding.WrapperCapableDatabinding;
+import org.apache.cxf.databinding.WrapperHelper;
 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.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingMessageInfo;
 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.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceModelUtil;
 
 public class WrapperClassInInterceptor extends AbstractPhaseInterceptor<Message> {
 
@@ -113,8 +118,15 @@
             
             WrapperHelper helper = wrapperPart.getProperty("WRAPPER_CLASS", WrapperHelper.class);
             if (helper == null) {
-                helper = createWrapperHelper(messageInfo, wrappedMessageInfo, wrapperClass);
-                wrapperPart.setProperty("WRAPPER_CLASS", helper);
+                Service service = ServiceModelUtil.getService(message.getExchange());
+                DataBinding dataBinding = service.getDataBinding();
+                if (dataBinding instanceof WrapperCapableDatabinding) {
+                    helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
+                                                 messageInfo, wrappedMessageInfo, wrapperClass);
+                    wrapperPart.setProperty("WRAPPER_CLASS", helper);
+                } else {
+                    return;
+                }                
             }            
             
             MessageContentsList newParams;
@@ -150,7 +162,8 @@
         }
     }
     
-    private WrapperHelper createWrapperHelper(MessageInfo messageInfo,
+    private WrapperHelper createWrapperHelper(WrapperCapableDatabinding dataBinding, 
+                                              MessageInfo messageInfo,
                                               MessageInfo wrappedMessageInfo,
                                               Class<?> wrapperClass) {
         List<String> partNames = new ArrayList<String>();
@@ -184,7 +197,7 @@
                 partNames.set(idx, p.getName().getLocalPart());
             }
         }
-        return WrapperHelper.createWrapperHelper(wrapperClass,
+        return dataBinding.createWrapperHelper(wrapperClass,
                                                   partNames,
                                                   elTypeNames,
                                                   partClasses);

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java?rev=755153&r1=755152&r2=755153&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java Tue Mar 17 08:47:06 2009
@@ -19,21 +19,27 @@
 
 package org.apache.cxf.jaxws.interceptors;
 
+import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.cxf.databinding.DataBinding;
+import org.apache.cxf.databinding.WrapperCapableDatabinding;
+import org.apache.cxf.databinding.WrapperHelper;
 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.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.BindingMessageInfo;
 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.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceModelUtil;
 
 public class WrapperClassOutInterceptor extends AbstractPhaseInterceptor<Message> {
     public WrapperClassOutInterceptor() {
@@ -68,37 +74,32 @@
 
             WrapperHelper helper = parts.get(0).getProperty("WRAPPER_CLASS", WrapperHelper.class);
             if (helper == null) {
-                List<String> partNames = new ArrayList<String>();
-                List<String> elTypeNames = new ArrayList<String>();
-                List<Class<?>> partClasses = new ArrayList<Class<?>>();
-                
-                for (MessagePartInfo p : messageInfo.getMessageParts()) {
-                    ensureSize(partNames, p.getIndex());
-                    ensureSize(elTypeNames, p.getIndex());
-                    ensureSize(partClasses, p.getIndex());
-                    
-                    partNames.set(p.getIndex(), p.getName().getLocalPart());
-                    
-                    String elementType = null;
-                    if (p.getTypeQName() == null) {
-                        // handling anonymous complex type
-                        elementType = null;
-                    } else {
-                        elementType = p.getTypeQName().getLocalPart();
-                    }
-                    
-                    elTypeNames.set(p.getIndex(), elementType);
-                    partClasses.set(p.getIndex(), p.getTypeClass());
+                Service service = ServiceModelUtil.getService(message.getExchange());
+                DataBinding dataBinding = service.getDataBinding();
+                if (dataBinding instanceof WrapperCapableDatabinding) {
+                    helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding,
+                                                 messageInfo, wrappedMsgInfo, wrapped);
+                    parts.get(0).setProperty("WRAPPER_CLASS", helper);
+                } else {
+                    return;
                 }
-                helper = WrapperHelper.createWrapperHelper(wrapped,
-                                                           partNames,
-                                                           elTypeNames,
-                                                           partClasses);
-
-                parts.get(0).setProperty("WRAPPER_CLASS", helper);
             }
             try {
-                MessageContentsList newObjs = new MessageContentsList(); 
+                MessageContentsList newObjs = new MessageContentsList();
+                Object en = message.getContextualProperty(Message.SCHEMA_VALIDATION_ENABLED);
+                // set the validate option for XMLBeans Wrapper Helper
+                if (Boolean.TRUE.equals(en) || "true".equals(en)) {
+                    try {                        
+                        Class xmlBeanWrapperHelperClass = 
+                            Class.forName("org.apache.cxf.xmlbeans.XmlBeansWrapperHelper");
+                        if (xmlBeanWrapperHelperClass.isInstance(helper)) {
+                            Method method = xmlBeanWrapperHelperClass.getMethod("setValidate", boolean.class);
+                            method.invoke(helper, true);
+                        }
+                    } catch (Exception exception) {
+                        // do nothing there
+                    }
+                }
                 Object o2 = helper.createWrapperObject(objs);
                 newObjs.put(parts.get(0), o2);
                 
@@ -113,6 +114,7 @@
 
                 message.setContent(List.class, newObjs);
             } catch (Exception e) {
+                e.printStackTrace();
                 throw new Fault(e);
             }
             
@@ -136,4 +138,36 @@
             lst.add(null);
         }
     }
+    
+    private WrapperHelper createWrapperHelper(WrapperCapableDatabinding dataBinding, 
+                                              MessageInfo messageInfo,
+                                              MessageInfo wrappedMessageInfo,
+                                              Class<?> wrapperClass) {
+        List<String> partNames = new ArrayList<String>();
+        List<String> elTypeNames = new ArrayList<String>();
+        List<Class<?>> partClasses = new ArrayList<Class<?>>();
+        
+        for (MessagePartInfo p : messageInfo.getMessageParts()) {
+            ensureSize(partNames, p.getIndex());
+            ensureSize(elTypeNames, p.getIndex());
+            ensureSize(partClasses, p.getIndex());
+            
+            partNames.set(p.getIndex(), p.getName().getLocalPart());
+            
+            String elementType = null;
+            if (p.getTypeQName() == null) {
+                // handling anonymous complex type
+                elementType = null;
+            } else {
+                elementType = p.getTypeQName().getLocalPart();
+            }
+            
+            elTypeNames.set(p.getIndex(), elementType);
+            partClasses.set(p.getIndex(), p.getTypeClass());
+        }
+        return dataBinding.createWrapperHelper(wrapperClass,
+                                                 partNames,
+                                                 elTypeNames,
+                                                 partClasses);
+    }
 }

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java?rev=755153&r1=755152&r2=755153&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/WrapperClassGeneratorTest.java Tue Mar 17 08:47:06 2009
@@ -27,7 +27,8 @@
 import javax.xml.bind.Marshaller;
 
 import org.apache.cxf.BusFactory;
-import org.apache.cxf.jaxws.interceptors.WrapperHelper;
+import org.apache.cxf.databinding.WrapperHelper;
+import org.apache.cxf.jaxb.JAXBDataBinding;
 import org.apache.cxf.jaxws.service.AddNumbersImpl;
 import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
@@ -69,7 +70,7 @@
         String className = requestClass.getName();
         className = className.substring(0, className.lastIndexOf(".") + 1);
         
-        WrapperHelper wh = WrapperHelper.createWrapperHelper(requestClass,
+        WrapperHelper wh = new JAXBDataBinding().createWrapperHelper(requestClass,
                                                              partNames, elTypeNames, partClasses);        
         
         List<Object> paraList = new ArrayList<Object>();
@@ -88,7 +89,7 @@
         className = responseClass.getName();
         className = className.substring(0, className.lastIndexOf(".") + 1);
         
-        wh = WrapperHelper.createWrapperHelper(responseClass,
+        wh = new JAXBDataBinding().createWrapperHelper(responseClass,
                                                              partNames, elTypeNames, partClasses);        
         List<Object> resPara = new ArrayList<Object>();
         List<Integer> intValueList = new ArrayList<Integer>();



Mime
View raw message