Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 70405 invoked from network); 7 Sep 2010 13:31:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Sep 2010 13:31:00 -0000 Received: (qmail 29338 invoked by uid 500); 7 Sep 2010 13:31:00 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 29215 invoked by uid 500); 7 Sep 2010 13:30:57 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 29207 invoked by uid 99); 7 Sep 2010 13:30:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 13:30:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Sep 2010 13:30:55 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o87DUZhb016425 for ; Tue, 7 Sep 2010 13:30:35 GMT Message-ID: <1735941.52981283866235058.JavaMail.jira@thor> Date: Tue, 7 Sep 2010 09:30:35 -0400 (EDT) From: "Staffan (JIRA)" To: issues@cxf.apache.org Subject: [jira] Created: (CXF-2978) CLONE -Return Type List gets null on client if an empty list is returned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 CLONE -Return Type List gets null on client if an empty list is returned ------------------------------------------------------------------------ Key: CXF-2978 URL: https://issues.apache.org/jira/browse/CXF-2978 Project: CXF Issue Type: Bug Components: JAXB Databinding Affects Versions: 2.1.8 Environment: JSE 1.5 on Win XP Reporter: Staffan Assignee: Daniel Kulp Priority: Critical Fix For: 2.2.7 If you have a function that returns an empty list the result will be null on client. Even If add a Responsewrapper to the interface it doesn't work. If have attached a little test project / program: Interface: @WebService(targetNamespace = "http://cxf.apache.org/demo/CustomerService/1/", name = "CustomerService") @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL) public interface CustomerService { @WebMethod(action = "findCustomer", operationName = "findCustomer") public @WebResult(name = "customerList") List findCustomer(); @WebMethod(action = "findCustomer2", operationName = "findCustomer2") @ResponseWrapper(className="demo.service.CustomerListResponse") public @WebResult(name = "customerList") List findCustomer2(); } The Implementation: @WebService(name = "CustomerService", serviceName = "CustomerService", targetNamespace = "http://cxf.apache.org/demo/CustomerService/1/", endpointInterface = "demo.service.CustomerService") public class CustomerServiceImpl implements CustomerService { public List findCustomer() { // very stupid method return new ArrayList(); } public List findCustomer2() { // another very stupid method return new ArrayList(); } } And this is the main programm: public static void main(String args[]) throws Exception { new Server(); System.out.println("Server ready..."); // Now Call the Service JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.getInInterceptors().add(new LoggingInInterceptor()); factory.getOutInterceptors().add(new LoggingOutInterceptor()); factory.setServiceClass(CustomerService.class); factory.setAddress("http://localhost:9000/CustomerService"); CustomerService client = (CustomerService) factory.create(); System.out.println("call findCustomer()"); List result = client.findCustomer(); if (result != null) System.out.println("Listsize: " + result.size()); else System.out.println("List is null: " + result); System.out.println("call findCustomer2()"); result = client.findCustomer2(); if (result != null) System.out.println("Listsize: " + result.size()); else System.out.println("List is null: " + result); System.out.println("Server exiting"); System.exit(0); } This will print the following output: Server ready... call findCustomer() 20.01.2010 07:49:45 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose INFO: Outbound Message --------------------------- ID: 1 Address: http://localhost:9000/CustomerService Encoding: UTF-8 Content-Type: text/xml Headers: {SOAPAction=["findCustomer"], Accept=[*/*]} Payload: -------------------------------------- 20.01.2010 07:49:45 org.apache.cxf.interceptor.LoggingInInterceptor logging INFO: Inbound Message ---------------------------- ID: 1 Encoding: UTF-8 Content-Type: text/xml; charset=utf-8 Headers: {Content-Length=[194], Server=[Jetty(6.1.21)], content-type=[text/xml; charset=utf-8]} Payload: -------------------------------------- List is null: null call findCustomer2() 20.01.2010 07:49:45 org.apache.cxf.interceptor.LoggingOutInterceptor$LoggingCallback onClose INFO: Outbound Message --------------------------- ID: 2 Address: http://localhost:9000/CustomerService Encoding: UTF-8 Content-Type: text/xml Headers: {SOAPAction=["findCustomer2"], Accept=[*/*]} Payload: -------------------------------------- 20.01.2010 07:49:45 org.apache.cxf.interceptor.LoggingInInterceptor logging INFO: Inbound Message ---------------------------- ID: 2 Encoding: UTF-8 Content-Type: text/xml; charset=utf-8 Headers: {Content-Length=[300], Server=[Jetty(6.1.21)], content-type=[text/xml; charset=utf-8]} Payload: -------------------------------------- List is null: null Server exiting -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.