cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r557406 - in /incubator/cxf/trunk: rt/core/src/main/java/org/apache/cxf/interceptor/ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ rt/frontend/simple/src/main/java/org/apache/cx...
Date Wed, 18 Jul 2007 21:50:03 GMT
Author: dkulp
Date: Wed Jul 18 14:50:02 2007
New Revision: 557406

URL: http://svn.apache.org/viewvc?view=rev&rev=557406
Log:
[CXF-655] Fix for lists/arrays when using wrapped/doc/lit without generating wrapper types

Added:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
  (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
  (with props)
Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ServerMisc.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?view=diff&rev=557406&r1=557405&r2=557406
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
Wed Jul 18 14:50:02 2007
@@ -207,10 +207,10 @@
                          List<Object> parameters,
                          Iterator<MessagePartInfo> itr) {
 
-        boolean isListPara = false;
         //List<Object> list = new ArrayList<Object>();
         MessagePartInfo part = null;
         while (StaxUtils.toNextElement(xmlReader)) { 
+            boolean isListPara = false;
             if (itr.hasNext()) {
                 part = itr.next();
                 if (part.getTypeClass().getName().startsWith("[L")) {
@@ -221,12 +221,7 @@
                     
                     if (genericType instanceof ParameterizedType) {
                         isListPara = true;
-                        //ParameterizedType pt = (ParameterizedType) genericType;
-                        //part.setTypeClass((Class<?>)pt.getActualTypeArguments()[0]);
-                    } /*else if (genericType instanceof GenericArrayType) {
-                        GenericArrayType gt = (GenericArrayType)genericType;
-                        part.setTypeClass((Class<?>)gt.getGenericComponentType());
-                    }*/
+                    }
                 } 
             } 
             if (part == null) {
@@ -244,14 +239,7 @@
             }
 
         }
-        
-        /*if (isListPara) {
-            parameters.add(list);
-        } else {
-            for (Object obj : list) {
-                parameters.add(obj);
-            }
-        }*/
+
     }
 
 

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?view=diff&rev=557406&r1=557405&r2=557406
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Wed Jul 18 14:50:02 2007
@@ -25,6 +25,7 @@
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
@@ -45,12 +46,14 @@
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.validation.Schema;
 
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaSimpleType;
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeList;
@@ -77,6 +80,7 @@
         return jm;
     }
 
+    @SuppressWarnings("unchecked")
     public static void marshall(JAXBContext context, 
                                 Schema schema, 
                                 Object elValue, 
@@ -108,44 +112,56 @@
                 // intentionally empty.
             }
             Object mObj = elValue;
-
             QName elName = null;
             if (part != null) {
                 elName = part.getConcreteName();
             }
-            
+            u.setSchema(schema);
+            if (am != null) {
+                u.setAttachmentMarshaller(am);
+            }
+
             if (null != elName
                 && !cls.isAnnotationPresent(XmlRootElement.class)) {
                 
-                if (mObj.getClass().isArray()
-                    && part != null
+                if (part != null
                     && part.getXmlSchema() instanceof XmlSchemaElement) {
+                
                     XmlSchemaElement el = (XmlSchemaElement)part.getXmlSchema();
-                    if (el.getSchemaType() instanceof XmlSchemaSimpleType
+                    
+                    if (mObj.getClass().isArray()
+                        && el.getSchemaType() instanceof XmlSchemaSimpleType
                         && ((XmlSchemaSimpleType)el.getSchemaType()).getContent()
-                            instanceof XmlSchemaSimpleTypeList) {
+                                instanceof XmlSchemaSimpleTypeList) {
                         mObj = Arrays.asList((Object[])mObj);
+                    } else if (part.getMessageInfo().getOperation().isUnwrapped()
+                        && (mObj.getClass().isArray() || mObj instanceof List)
+                        && el.getMaxOccurs() != 1) {
+                        //Have to handle this ourselves....  which really sucks.... but what
can we do?
+                        Object objArray[];
+                        if (mObj instanceof List) {
+                            List l = (List)mObj;
+                            objArray = l.toArray(new Object[l.size()]);
+                            cls = null;
+                        } else {
+                            objArray = (Object[])mObj;
+                            cls = cls.getComponentType();
+                        }
+                        for (Object o : objArray) {
+                            writeObject(u, source, 
+                                        new JAXBElement(elName, cls == null ? o.getClass()
: cls , o));
+                        }
+                    } else {
+                        writeObject(u, source, new JAXBElement(elName, cls, mObj));
                     }
+                } else {
+                    writeObject(u, source, new JAXBElement(elName, cls, mObj));
                 }
-                mObj = JAXBElement.class.getConstructor(new Class[] {QName.class, Class.class,
Object.class})
-                    .newInstance(elName, cls, mObj);
-            }
-            
-            u.setSchema(schema);
-            if (am != null) {
-                u.setAttachmentMarshaller(am);
-            }
-            if (source instanceof XMLStreamWriter) {
-                u.marshal(mObj, (XMLStreamWriter)source);
-            } else if (source instanceof OutputStream) {
-                u.marshal(mObj, (OutputStream)source);
-            } else if (source instanceof Node) {
-                u.marshal(mObj, (Node)source);
-            } else if (source instanceof XMLEventWriter) {
-                u.marshal(mObj, (XMLEventWriter)source);
             } else {
-                throw new Fault(new Message("UNKNOWN_SOURCE", BUNDLE, source.getClass().getName()));
+                writeObject(u, source, mObj);
             }
+        } catch (Fault ex) {
+            throw (Fault)ex.fillInStackTrace();
         } catch (Exception ex) {
             if (ex instanceof javax.xml.bind.MarshalException) {
                 javax.xml.bind.MarshalException marshalEx = (javax.xml.bind.MarshalException)ex;
@@ -157,6 +173,20 @@
             }                       
         }
     }
+    
+    private static void writeObject(Marshaller u, Object source, Object mObj) throws Fault,
JAXBException { 
+        if (source instanceof XMLStreamWriter) {
+            u.marshal(mObj, (XMLStreamWriter)source);
+        } else if (source instanceof OutputStream) {
+            u.marshal(mObj, (OutputStream)source);
+        } else if (source instanceof Node) {
+            u.marshal(mObj, (Node)source);
+        } else if (source instanceof XMLEventWriter) {
+            u.marshal(mObj, (XMLEventWriter)source);
+        } else {
+            throw new Fault(new Message("UNKNOWN_SOURCE", BUNDLE, source.getClass().getName()));
+        }
+    }
 
     public static void marshall(JAXBContext context, Schema schema, Object elValue, Object
source) {
         marshall(context, schema, elValue, null, source, null);
@@ -201,9 +231,10 @@
             && part != null 
             && part.getXmlSchema() instanceof XmlSchemaElement) {
             XmlSchemaElement el = (XmlSchemaElement)part.getXmlSchema();
+            
             if (el.getSchemaType() instanceof XmlSchemaSimpleType
                 && ((XmlSchemaSimpleType)el.getSchemaType()).getContent()
-                    instanceof XmlSchemaSimpleTypeList) {
+                instanceof XmlSchemaSimpleTypeList) {
                 
                 Object obj = unmarshall(context, schema, source, elName, null, au, unwrap);
                 if (clazz.isArray()
@@ -212,8 +243,14 @@
                                                                  ((List)obj).size()));
                 }
                     
-                
                 return obj;
+            } else if (part.getMessageInfo().getOperation().isUnwrapped()
+                        && el.getMaxOccurs() != 1) {
+                //must read ourselves....
+                List<Object> ret = unmarshallArray(context, schema, source,
+                                                   elName, clazz.getComponentType(), au);
+                return ret.toArray((Object[])java.lang.reflect.Array.newInstance(clazz.getComponentType(),
+                                                                       ret.size()));
             }
         }
 
@@ -260,6 +297,9 @@
             } else {
                 throw new Fault(new Message("UNKNOWN_SOURCE", BUNDLE, source.getClass().getName()));
             }
+        } catch (Fault ex) {
+            ex.fillInStackTrace();
+            throw ex;
         } catch (Exception ex) {                        
             if (ex instanceof javax.xml.bind.UnmarshalException) {                
                 javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
@@ -298,5 +338,48 @@
         // JAXB Code Generated.
         assert false;
         throw new IllegalArgumentException("Cannot get Class object from unknown Type");
+    }
+    
+    public static List<Object> unmarshallArray(JAXBContext context, 
+                                    Schema schema, 
+                                    Object source,
+                                    QName elName,
+                                    Class<?> clazz,
+                                    AttachmentUnmarshaller au) {
+        try {
+            Unmarshaller u = createUnmarshaller(context, clazz);
+            u.setSchema(schema);
+            if (au != null) {
+                u.setAttachmentUnmarshaller(au);
+            }
+            XMLStreamReader reader;
+            if (source instanceof XMLStreamReader) {
+                reader = (XMLStreamReader)source;
+            } else if (source instanceof Element) {
+                reader = StaxUtils.createXMLStreamReader((Element)source);
+            } else {
+                throw new Fault(new Message("UNKNOWN_SOURCE", BUNDLE, source.getClass().getName()));
+            }
+            List<Object> ret = new ArrayList<Object>();
+            while (reader.getName().equals(elName)) {
+                Object obj = u.unmarshal(reader, clazz);
+                if (obj instanceof JAXBElement) {
+                    obj = ((JAXBElement)obj).getValue();
+                }
+                ret.add(obj);
+            }
+            return ret;
+        } catch (Fault ex) {
+            ex.fillInStackTrace();
+            throw ex;
+        } catch (Exception ex) {                        
+            if (ex instanceof javax.xml.bind.UnmarshalException) {                
+                javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
+                throw new Fault(new Message("UNMARSHAL_ERROR", 
+                                            BUNDLE, unmarshalEx.getLinkedException().getMessage()),
ex); 
+            } else {
+                throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, ex.getMessage()),
ex);
+            }
+        } 
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=557406&r1=557405&r2=557406
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Wed Jul 18 14:50:02 2007
@@ -162,7 +162,8 @@
         assertNotNull(res);
         
         addNamespace("h", "http://service.jaxws.cxf.apache.org/");
-        assertValid("//s:Body/h:getGreetingsResponse/return/item", res);
+        assertValid("//s:Body/h:getGreetingsResponse/return[1]", res);
+        assertValid("//s:Body/h:getGreetingsResponse/return[2]", res);
     }
     
     @Test

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=557406&r1=557405&r2=557406
==============================================================================
--- 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
Wed Jul 18 14:50:02 2007
@@ -660,6 +660,9 @@
                 }
             }
             if (!Boolean.TRUE.equals(mpi.getProperty(HEADER))) {
+                if (!mpi.isElement()) {
+                    mpi.setXmlSchema(el);                    
+                }
                 if (mpi.getTypeClass() != null && mpi.getTypeClass().isArray()
                     && !Byte.TYPE.equals(mpi.getTypeClass().getComponentType()))
{
                     el.setMinOccurs(0);

Modified: incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java?view=diff&rev=557406&r1=557405&r2=557406
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/test/java/org/apache/cxf/service/stax/StaxDatabindingTest.java
Wed Jul 18 14:50:02 2007
@@ -29,7 +29,6 @@
 import org.apache.cxf.databinding.stax.StaxDataBindingFeature;
 import org.apache.cxf.databinding.stax.XMLStreamWriterCallback;
 import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.staxutils.FragmentStreamReader;
 import org.apache.cxf.test.AbstractCXFTest;
@@ -68,7 +67,7 @@
         
         Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID, "req.xml");
         
-        DOMUtils.writeXml(res, System.out);
+        //DOMUtils.writeXml(res, System.out);
         addNamespace("a", "http://stax.service.cxf.apache.org/");
         assertValid("//a:bleh", res);
     }

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=557406&r1=557405&r2=557406
==============================================================================
--- 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
Wed Jul 18 14:50:02 2007
@@ -20,9 +20,15 @@
 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;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
+import javax.xml.ws.Service;
 
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexType;
 import org.apache.cxf.anonymous_complex_type.AnonymousComplexTypeService;
@@ -41,12 +47,10 @@
 
 public class ClientServerMiscTest extends AbstractBusClientServerTestBase {
 
-    private final QName portName = new QName("http://cxf.apache.org/anonymous_complex_type/",
-            "anonymous_complex_typeSOAP");
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(ServerMisc.class));
+        assertTrue("server did not launch correctly", launchServer(ServerMisc.class, true));
     }
 
     @Test
@@ -54,6 +58,8 @@
 
         AnonymousComplexTypeService actService = new AnonymousComplexTypeService();
         assertNotNull(actService);
+        QName portName = new QName("http://cxf.apache.org/anonymous_complex_type/",
+            "anonymous_complex_typeSOAP");
         AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class);
 
         try {
@@ -71,6 +77,8 @@
 
         AnonymousComplexTypeService actService = new AnonymousComplexTypeService();
         assertNotNull(actService);
+        QName portName = new QName("http://cxf.apache.org/anonymous_complex_type/",
+            "anonymous_complex_typeSOAP");
         AnonymousComplexType act = actService.getPort(portName, AnonymousComplexType.class);
 
         try {
@@ -139,5 +147,45 @@
         } catch (UndeclaredThrowableException ex) {
             throw (Exception) ex.getCause();
         }
+    }
+    
+    @Test
+    public void testStringListOut() 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);
+        
+        String arrayOut[] = port.arrayOutput();
+        assertNotNull(arrayOut);
+        assertEquals(3, arrayOut.length);
+        for (int x = 0; x < 3; x++) {
+            assertEquals(DocLitWrappedCodeFirstServiceImpl.DATA[x], arrayOut[x]);
+        }
+        
+        List<String> listOut = port.listOutput();
+        assertNotNull(listOut);
+        assertEquals(3, listOut.size());
+        for (int x = 0; x < 3; x++) {
+            assertEquals(DocLitWrappedCodeFirstServiceImpl.DATA[x], listOut.get(x));
+        }
+        
+        String s = port.arrayInput(DocLitWrappedCodeFirstServiceImpl.DATA);
+        assertEquals("string1string2string3", s);
+        
+        s = port.listInput(java.util.Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA));
+        assertEquals("string1string2string3", s);
+        
+        List<String> rev = new ArrayList<String>(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA));
+        Collections.reverse(rev);
+        String s2 = port.multiListInput(Arrays.asList(DocLitWrappedCodeFirstServiceImpl.DATA),
+                                rev,
+                                "Hello", 24);
+        assertEquals("string1string2string3string3string2string1Hello24", s2);
     }
 }

Added: 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=auto&rev=557406
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Wed Jul 18 14:50:02 2007
@@ -0,0 +1,50 @@
+/**
+ * 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 javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+@WebService(name = "DocLitWrappedCodeFirstService",
+            targetNamespace = "http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
+             use = SOAPBinding.Use.LITERAL,
+             parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+public interface DocLitWrappedCodeFirstService {
+    @WebMethod
+    String[] arrayOutput();
+
+    @WebMethod
+    String arrayInput(
+            @WebParam(name = "input") String[] inputs);
+
+    @WebMethod
+    List<String> listOutput();
+    
+    @WebMethod
+    String listInput(List<String> inputs);
+
+    @WebMethod
+    String multiListInput(List<String> inputs1, List<String> inputs2, String
x, int y);
+}

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

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

Added: 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=auto&rev=557406
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Wed Jul 18 14:50:02 2007
@@ -0,0 +1,70 @@
+/**
+ * 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 javax.jws.WebService;
+
+@WebService(endpointInterface = "org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService",
+            serviceName = "DocLitWrappedCodeFirstService",
+            portName = "DocLitWrappedCodeFirstServicePort",
+            targetNamespace = "http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService")
+public class DocLitWrappedCodeFirstServiceImpl implements DocLitWrappedCodeFirstService {
+    public static final String DATA[] = new String[] {"string1", "string2", "string3"};
+    
+    public String[] arrayOutput() {
+        return DATA;
+    }
+
+    public List<String> listOutput() {
+        return 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();
+        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);
+        }
+        buf.append(x);
+        buf.append(Integer.toString(y));
+        return buf.toString();
+    }
+
+}

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

Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.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=557406&r1=557405&r2=557406
==============================================================================
--- 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
Wed Jul 18 14:50:02 2007
@@ -28,7 +28,10 @@
 
 
 public class ServerMisc extends AbstractBusTestServerBase {
-
+    public static final String DOCLIT_CODEFIRST_URL = 
+        "http://localhost:9003/DocLitWrappedCodeFirstService/";
+    
+    
     protected void run() {
         Object implementor1 = new AnonymousComplexTypeImpl();
         String address = "http://localhost:9000/anonymous_complex_typeSOAP";
@@ -41,7 +44,9 @@
         Object implementor3 = new OrderedParamHolderImpl();
         address = "http://localhost:9002/ordered_param_holder/";
         Endpoint.publish(address, implementor3);
-
+        
+        Object implementor4 = new DocLitWrappedCodeFirstServiceImpl();
+        Endpoint.publish(DOCLIT_CODEFIRST_URL, implementor4);
     }
 
     public static void main(String[] args) {



Mime
View raw message