cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1492933 - in /cxf/branches/2.7.x-fixes: rt/core/src/main/java/org/apache/cxf/service/factory/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ systests/jaxws/src/test/java/or...
Date Fri, 14 Jun 2013 02:44:33 GMT
Author: dkulp
Date: Fri Jun 14 02:44:32 2013
New Revision: 1492933

URL: http://svn.apache.org/r1492933
Log:
Merged revisions 1492929 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1492929 | dkulp | 2013-06-13 22:12:45 -0400 (Thu, 13 Jun 2013) | 2 lines

  [CXF-5064] XmlJavaTypeAdapter's on soap header params aren't taken into account

........

Added:
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObj.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObjTypeAdapter.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderSEI.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderServiceImpl.java
Modified:
    cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
    cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java

Modified: cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1492933&r1=1492932&r2=1492933&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Fri Jun 14 02:44:32 2013
@@ -147,6 +147,9 @@ public class ReflectionServiceFactoryBea
     public static final String METHOD_ANNOTATIONS = "method.return.annotations";
     public static final String PARAM_ANNOTATION = "parameter.annotations";
     private static final Logger LOG = LogUtils.getL7dLogger(ReflectionServiceFactoryBean.class);
+    private static final boolean DO_VALIDATE = SystemPropertyAction.getProperty("cxf.validateServiceSchemas",
"false")
+            .equals("true");
+
     private static Class<? extends DataBinding> defaultDatabindingClass;
 
     protected String wsdlURL;
@@ -182,17 +185,16 @@ public class ReflectionServiceFactoryBea
 
     public ReflectionServiceFactoryBean() {
         getServiceConfigurations().add(0, new DefaultServiceConfiguration());
-
-        ignoredClasses.add("java.lang.Object");
-        ignoredClasses.add("java.lang.Throwable");
-        ignoredClasses.add("org.omg.CORBA_2_3.portable.ObjectImpl");
-        ignoredClasses.add("org.omg.CORBA.portable.ObjectImpl");
-        ignoredClasses.add("javax.ejb.EJBObject");
-        ignoredClasses.add("javax.rmi.CORBA.Stub");
+        ignoredClasses.addAll(Arrays.asList(new String[] {
+            "java.lang.Object",
+            "java.lang.Throwable",
+            "org.omg.CORBA_2_3.portable.ObjectImpl",
+            "org.omg.CORBA.portable.ObjectImpl",
+            "javax.ejb.EJBObject",
+            "javax.rmi.CORBA.Stub"
+        }));
     }
 
-
-
     protected DataBinding createDefaultDataBinding() {
         Object obj = null;
         Class<? extends DataBinding> cls = null;
@@ -837,6 +839,9 @@ public class ReflectionServiceFactoryBea
                     inf.setElementQName(part.getElementQName());
                     inf.setConcreteName(part.getConcreteName());
                     inf.setXmlSchema(part.getXmlSchema());
+                    if (paraAnnos != null) {
+                        part.setProperty(PARAM_ANNOTATION, paraAnnos);
+                    }
                     part = inf;
                     inf.setProperty(HEADER, Boolean.TRUE);
                 }
@@ -2457,7 +2462,7 @@ public class ReflectionServiceFactoryBea
     }
 
     public void setWsdlURL(URL wsdlURL) {
-        this.wsdlURL = wsdlURL.toString();
+        setWsdlURL(wsdlURL.toString());
     }
 
     public List<AbstractServiceConfiguration> getServiceConfigurations() {
@@ -2581,8 +2586,7 @@ public class ReflectionServiceFactoryBea
     }
 
     private boolean isValidate() {
-        return validate 
-            || SystemPropertyAction.getProperty("cxf.validateServiceSchemas", "false").equals("true");
+        return validate || DO_VALIDATE;
     }
 
     /**

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=1492933&r1=1492932&r2=1492933&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Fri Jun 14 02:44:32 2013
@@ -21,6 +21,7 @@ package org.apache.cxf.jaxb;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
@@ -46,6 +47,7 @@ import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.ValidationEventHandler;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLEventWriter;
@@ -60,13 +62,16 @@ import org.w3c.dom.Node;
 import org.xml.sax.InputSource;
 
 import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.common.jaxb.JAXBBeanInfo;
 import org.apache.cxf.common.jaxb.JAXBContextCache;
 import org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas;
+import org.apache.cxf.common.jaxb.JAXBContextProxy;
 import org.apache.cxf.common.jaxb.JAXBUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.PropertyUtils;
+import org.apache.cxf.common.util.ReflectionInvokationHandler;
 import org.apache.cxf.common.util.ReflectionUtil;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
 import org.apache.cxf.databinding.AbstractDataBinding;
@@ -85,6 +90,8 @@ import org.apache.cxf.resource.URIResolv
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
+import org.apache.cxf.service.model.MessageInfo;
+import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.ws.addressing.ObjectFactory;
@@ -342,6 +349,7 @@ public class JAXBDataBinding extends Abs
 
             if (col.getXmlSchemas().length > 1) {
                 // someone has already filled in the types
+                justCheckForJAXBAnnotations(serviceInfo);
                 continue;
             }
 
@@ -413,6 +421,28 @@ public class JAXBDataBinding extends Abs
         }
     }
 
+    private void justCheckForJAXBAnnotations(ServiceInfo serviceInfo) {
+        for (MessageInfo mi: serviceInfo.getMessages().values()) {
+            for (MessagePartInfo mpi : mi.getMessageParts()) {
+                checkForJAXBAnnotations(mpi);
+            }
+        }
+    }
+    private void checkForJAXBAnnotations(MessagePartInfo mpi) {
+        Annotation[] anns = (Annotation[])mpi.getProperty("parameter.annotations");
+        JAXBContextProxy ctx = ReflectionInvokationHandler.createProxyWrapper(context, JAXBContextProxy.class);
+        XmlJavaTypeAdapter jta = JAXBSchemaInitializer.findFromTypeAdapter(ctx, mpi.getTypeClass(),
anns);
+        JAXBBeanInfo jtaBeanInfo = null;
+        if (jta != null) {
+            jtaBeanInfo = JAXBSchemaInitializer.findFromTypeAdapter(ctx, jta.value());
+        }
+        JAXBBeanInfo beanInfo = JAXBSchemaInitializer.getBeanInfo(ctx, mpi.getTypeClass());
+        if (jtaBeanInfo != beanInfo && jta != null) {
+            mpi.setProperty("parameter.annotations", anns);
+            mpi.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+        }
+    }
+
     private String getNamespaceToUse(Service service) {
         if ("true".equals(service.get("org.apache.cxf.databinding.namespace"))) {
             return null;

Modified: cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java?rev=1492933&r1=1492932&r2=1492933&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
Fri Jun 14 02:44:32 2013
@@ -170,31 +170,33 @@ class JAXBSchemaInitializer extends Serv
             }
         }
 
+        Annotation[] anns = (Annotation[])part.getProperty("parameter.annotations");
+        XmlJavaTypeAdapter jta = findFromTypeAdapter(context, clazz, anns);
+        JAXBBeanInfo jtaBeanInfo = null;
+        if (jta != null) {
+            jtaBeanInfo = findFromTypeAdapter(context, jta.value());
+        }
         JAXBBeanInfo beanInfo = getBeanInfo(clazz);
-        if (beanInfo == null) {
-            Annotation[] anns = (Annotation[])part.getProperty("parameter.annotations");
-            XmlJavaTypeAdapter jta = findFromTypeAdapter(clazz, anns);
-            if (jta != null) {
-                beanInfo = findFromTypeAdapter(jta.value());
-                if (anns == null) {
-                    anns = new Annotation[] {jta};
-                } else {
-                    boolean found = false;
-                    for (Annotation t : anns) {
-                        if (t == jta) {
-                            found = true;
-                        }
-                    }
-                    if (!found) {
-                        Annotation tmp[] = new Annotation[anns.length + 1];
-                        System.arraycopy(anns, 0, tmp, 0, anns.length);
-                        tmp[anns.length] = jta;
-                        anns = tmp;
+        if (jtaBeanInfo != beanInfo && jta != null) {
+            beanInfo = jtaBeanInfo;
+            if (anns == null) {
+                anns = new Annotation[] {jta};
+            } else {
+                boolean found = false;
+                for (Annotation t : anns) {
+                    if (t == jta) {
+                        found = true;
                     }
                 }
-                part.setProperty("parameter.annotations", anns);
-                part.setProperty("honor.jaxb.annotations", Boolean.TRUE);
+                if (!found) {
+                    Annotation tmp[] = new Annotation[anns.length + 1];
+                    System.arraycopy(anns, 0, tmp, 0, anns.length);
+                    tmp[anns.length] = jta;
+                    anns = tmp;
+                }
             }
+            part.setProperty("parameter.annotations", anns);
+            part.setProperty("honor.jaxb.annotations", Boolean.TRUE);
         }
         if (beanInfo == null) {
             if (Exception.class.isAssignableFrom(clazz)) {
@@ -249,29 +251,32 @@ class JAXBSchemaInitializer extends Serv
         }
     }
 
-    private XmlJavaTypeAdapter findFromTypeAdapter(Class<?> clazz, Annotation[] anns)
{
+    static XmlJavaTypeAdapter findFromTypeAdapter(JAXBContextProxy context, Class<?>
clazz, Annotation[] anns) {
         JAXBBeanInfo ret = null;
         if (anns != null) {
             for (Annotation a : anns) {
                 if (XmlJavaTypeAdapter.class.isAssignableFrom(a.annotationType())) {
-                    ret = findFromTypeAdapter(((XmlJavaTypeAdapter)a).value());
+                    ret = findFromTypeAdapter(context, ((XmlJavaTypeAdapter)a).value());
                     if (ret != null) {
                         return (XmlJavaTypeAdapter)a;
                     }
                 }
             }
         }
-        XmlJavaTypeAdapter xjta = clazz.getAnnotation(XmlJavaTypeAdapter.class);
-        if (xjta != null) {
-            ret = findFromTypeAdapter(xjta.value());
-            if (ret != null) {
-                return xjta;
+        if (clazz != null) {
+            XmlJavaTypeAdapter xjta = clazz.getAnnotation(XmlJavaTypeAdapter.class);
+            if (xjta != null) {
+                ret = findFromTypeAdapter(context, xjta.value());
+                if (ret != null) {
+                    return xjta;
+                }
             }
         }
         return null;
     }
 
-    private JAXBBeanInfo findFromTypeAdapter(@SuppressWarnings("rawtypes") 
+    static JAXBBeanInfo findFromTypeAdapter(JAXBContextProxy context,
+                                            @SuppressWarnings("rawtypes") 
                                              Class<? extends XmlAdapter> aclass) {
         Class<?> c2 = aclass;
         Type sp = c2.getGenericSuperclass();
@@ -282,7 +287,7 @@ class JAXBSchemaInitializer extends Serv
         if (sp instanceof ParameterizedType) {
             Type tp = ((ParameterizedType)sp).getActualTypeArguments()[0];
             if (tp instanceof Class) {
-                return getBeanInfo((Class<?>)tp);
+                return getBeanInfo(context, (Class<?>)tp);
             }
         }
         return null;

Modified: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=1492933&r1=1492932&r2=1492933&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Fri Jun 14 02:44:32 2013
@@ -19,7 +19,9 @@
 
 package org.apache.cxf.systest.jaxws;
 
+import java.io.BufferedReader;
 import java.io.InputStream;
+import java.io.StringReader;
 import java.lang.reflect.Field;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.math.BigInteger;
@@ -72,6 +74,8 @@ import org.apache.cxf.systest.jaxws.DocL
 import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.CXF2411Result;
 import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.CXF2411SubClass;
 import org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService.Foo;
+import org.apache.cxf.systest.jaxws.cxf5064.HeaderObj;
+import org.apache.cxf.systest.jaxws.cxf5064.SOAPHeaderSEI;
 import org.apache.cxf.tests.inherit.Inherit;
 import org.apache.cxf.tests.inherit.InheritService;
 import org.apache.cxf.tests.inherit.objects.SubTypeA;
@@ -878,4 +882,36 @@ public class ClientServerMiscTest extend
         }
        
     }
+    
+    
+    @Test
+    public void testCXF5064() throws Exception {
+        URL url = new URL(ServerMisc.CXF_5064_URL + "?wsdl");
+        HttpURLConnection con = (HttpURLConnection)url.openConnection();
+        con.getResponseCode();
+        String str = IOUtils.readStringFromStream(con.getInputStream());
+        
+        //Check to make sure SESSIONID is a string
+        BufferedReader reader = new BufferedReader(new StringReader(str)); 
+        String s = reader.readLine();
+        while (s != null) {
+            if (s.contains("SESSIONID") && s.contains("element ")) {
+                assertTrue(s.contains("string"));
+                assertFalse(s.contains("headerObj"));
+            }
+            s = reader.readLine();   
+        }
+        //wsdl is correct, now make sure we can actually invoke it 
+        QName name = new QName("http://cxf.apache.org/cxf5064", 
+            "SOAPHeaderServiceImplService");
+        Service service = Service.create(name);
+        service.addPort(name, SOAPBinding.SOAP11HTTP_BINDING, ServerMisc.CXF_5064_URL);
+        SOAPHeaderSEI port = service.getPort(name, SOAPHeaderSEI.class);
+        assertEquals("a-b", port.test(new HeaderObj("a-b")));
+        
+        
+        service = Service.create(url, name);
+        port = service.getPort(SOAPHeaderSEI.class);
+        assertEquals("a-b", port.test(new HeaderObj("a-b")));
+    }
 }

Modified: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java?rev=1492933&r1=1492932&r2=1492933&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java
Fri Jun 14 02:44:32 2013
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.systest.jaxws;
 
+import java.util.LinkedList;
+import java.util.List;
+
 import javax.xml.ws.Endpoint;
 
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeImpl;
@@ -34,6 +37,7 @@ import org.apache.cxf.service.invoker.Fa
 import org.apache.cxf.service.invoker.PerRequestFactory;
 import org.apache.cxf.service.invoker.PooledFactory;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.systest.jaxws.cxf5064.SOAPHeaderServiceImpl;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 
@@ -51,6 +55,25 @@ public class ServerMisc extends Abstract
         "http://localhost:" + PORT + "/DocLitBareCodeFirstService/";
     public static final String DOCLIT_CODEFIRST_SETTINGS_URL = 
         "http://localhost:" + PORT + "/DocLitWrappedCodeFirstServiceSettings/";
+    public static final String CXF_5064_URL = 
+        "http://localhost:" + PORT + "/CXF5064/";
+    
+    
+    List<org.apache.cxf.endpoint.Server> servers = new LinkedList<org.apache.cxf.endpoint.Server>();
+    List<Endpoint> endpoints = new LinkedList<Endpoint>();
+    public void tearDown() throws Exception {
+        for (org.apache.cxf.endpoint.Server s : servers) {
+            s.stop();
+            s.destroy();
+        }
+        servers.clear();
+        
+        for (Endpoint ep : endpoints) {
+            ep.stop();
+        }
+        endpoints.clear();
+    }
+    
     
     @SuppressWarnings("deprecation")
     protected void run() {
@@ -65,7 +88,7 @@ public class ServerMisc extends Abstract
         factoryBean.setAddress(DOCLIT_CODEFIRST_URL);
         factoryBean.setServiceClass(DocLitWrappedCodeFirstServiceImpl.class);
         factoryBean.setInvoker(invoker);
-        factoryBean.create();
+        servers.add(factoryBean.create());
         
         factoryBean = new JaxWsServerFactoryBean();
         factoryBean.setAddress(DOCLIT_CODEFIRST_SETTINGS_URL);
@@ -80,41 +103,43 @@ public class ServerMisc extends Abstract
                 return Long.valueOf(1L);
             }
         });
-        factoryBean.create();
+        servers.add(factoryBean.create());
          
         //Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
-        //Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
+        //endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4));
         
         Object implementor7 = new DocLitBareCodeFirstServiceImpl();
         EndpointImpl ep = (EndpointImpl)Endpoint.publish(DOCLITBARE_CODEFIRST_URL, implementor7);
         ep.getServer().getEndpoint().getInInterceptors().add(new SAAJInInterceptor());
         ep.getServer().getEndpoint().getInInterceptors().add(new URIMappingInterceptor());
+        endpoints.add(ep);
 
         
         Object implementor6 = new InterfaceInheritTestImpl();
-        Endpoint.publish(DOCLIT_CODEFIRST_BASE_URL, implementor6);
+        endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_BASE_URL, implementor6));
         
         Object implementor1 = new AnonymousComplexTypeImpl();
         String address = "http://localhost:" + PORT + "/anonymous_complex_typeSOAP";
-        Endpoint.publish(address, implementor1);
+        endpoints.add(Endpoint.publish(address, implementor1));
 
         Object implementor2 = new JaxbElementTestImpl();
         address = "http://localhost:" + PORT + "/jaxb_element_test";
-        Endpoint.publish(address, implementor2);
+        endpoints.add(Endpoint.publish(address, implementor2));
 
         Object implementor3 = new OrderedParamHolderImpl();
         address = "http://localhost:" + PORT + "/ordered_param_holder/";
-        Endpoint.publish(address, implementor3);
+        endpoints.add(Endpoint.publish(address, implementor3));
         
         //Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
-        //Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
+        //endpoints.add(Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4));
         
         Object implementor5 = new RpcLitCodeFirstServiceImpl();
-        Endpoint.publish(RPCLIT_CODEFIRST_URL, implementor5);
+        endpoints.add(Endpoint.publish(RPCLIT_CODEFIRST_URL, implementor5));
         
-        Endpoint.publish("http://localhost:" + PORT + "/InheritContext/InheritPort",
-                         new InheritImpl());
-
+        endpoints.add(Endpoint.publish("http://localhost:" + PORT + "/InheritContext/InheritPort",
+                         new InheritImpl()));
+        
+        endpoints.add(Endpoint.publish(CXF_5064_URL, new SOAPHeaderServiceImpl()));
     }
 
     public static void main(String[] args) {

Added: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObj.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObj.java?rev=1492933&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObj.java
(added)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObj.java
Fri Jun 14 02:44:32 2013
@@ -0,0 +1,62 @@
+/**
+ * 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.cxf5064;
+
+/**
+ * 
+ */
+public class HeaderObj {
+    String field1;
+    String field2;
+
+    public HeaderObj() {
+    }
+
+    public HeaderObj(String value) {
+        if (value != null && !value.trim().isEmpty()) {
+            String fields[] = value.split("-");
+            if (fields.length == 2) {
+                field1 = fields[0];
+                field2 = fields[1];
+            }
+        }
+    }
+
+    public String getField1() {
+        return field1;
+    }
+
+    public void setField1(String field1) {
+        this.field1 = field1;
+    }
+
+    public String getField2() {
+        return field2;
+    }
+
+    public void setField2(String field2) {
+        this.field2 = field2;
+    }
+
+    @Override
+    public String toString() {
+        return field1 + "-" + field2;
+    }
+}

Added: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObjTypeAdapter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObjTypeAdapter.java?rev=1492933&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObjTypeAdapter.java
(added)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/HeaderObjTypeAdapter.java
Fri Jun 14 02:44:32 2013
@@ -0,0 +1,37 @@
+/**
+ * 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.cxf5064;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+public class HeaderObjTypeAdapter extends XmlAdapter<String, HeaderObj> {
+    @Override
+    public String marshal(HeaderObj v) throws Exception {
+        if (v == null) {
+            return null;
+        }
+        return v.toString();
+    }
+
+    @Override
+    public HeaderObj unmarshal(String v) throws Exception {
+        return new HeaderObj(v);
+    }
+}

Added: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderSEI.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderSEI.java?rev=1492933&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderSEI.java
(added)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderSEI.java
Fri Jun 14 02:44:32 2013
@@ -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.systest.jaxws.cxf5064;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebParam.Mode;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+@WebService(targetNamespace = "http://cxf.apache.org/cxf5064")
+public interface SOAPHeaderSEI {
+    @WebMethod(operationName = "test")
+    String test(@WebParam(header = true, mode = Mode.IN, name = "SESSIONID") 
+        @XmlJavaTypeAdapter(HeaderObjTypeAdapter.class) HeaderObj headerObj);
+}

Added: cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderServiceImpl.java?rev=1492933&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderServiceImpl.java
(added)
+++ cxf/branches/2.7.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/cxf5064/SOAPHeaderServiceImpl.java
Fri Jun 14 02:44:32 2013
@@ -0,0 +1,38 @@
+/**
+ * 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.cxf5064;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://cxf.apache.org/cxf5064")
+public class SOAPHeaderServiceImpl implements SOAPHeaderSEI {
+
+    /**
+     * 
+     */
+    public SOAPHeaderServiceImpl() {
+        // TODO Auto-generated constructor stub
+    }
+
+    public String test(HeaderObj headerObj) {
+        return headerObj.toString();
+    }
+
+}



Mime
View raw message