Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 104D1EA8D for ; Mon, 28 Jan 2013 18:15:13 +0000 (UTC) Received: (qmail 35282 invoked by uid 500); 28 Jan 2013 18:15:13 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 35223 invoked by uid 500); 28 Jan 2013 18:15:12 -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 35214 invoked by uid 99); 28 Jan 2013 18:15:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jan 2013 18:15:12 +0000 Date: Mon, 28 Jan 2013 18:15:12 +0000 (UTC) From: "Daniel Kulp (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CXF-4750) Wrong return type for enumeration in generated service interface using xmlbeans MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp resolved CXF-4750. ------------------------------ Resolution: Fixed OK. This now works. If you have a type that extends an enumeration, XmlSchemas doesn't map those to an enumeration. I've updated the code generator to use the same type mapping in this case. For example, in the SampleMethodDocument.java, the getSampleValue() call returns an ESample and not an Enum. Thus, we need to make sure we use that ESample type instead. > Wrong return type for enumeration in generated service interface using xmlbeans > ------------------------------------------------------------------------------- > > Key: CXF-4750 > URL: https://issues.apache.org/jira/browse/CXF-4750 > Project: CXF > Issue Type: Bug > Components: OtherDatabindings, Tooling > Affects Versions: 2.3.11, 2.7.2 > Reporter: Roland Mueller > Assignee: Daniel Kulp > Fix For: 2.5.9, 2.6.6, 2.7.3 > > Attachments: enumtest-2.7.2.zip, enumtest-2.7.3-SNAPSHOT.zip, enumtest.zip > > > I have a WSDL which has an enumeration as the response type for a SOAP operation. From that, I am generating Java classes using the cxf-codegen-plugin with xmlbeans. > The generated service interface has a String as response type. If my implementation returns a String containing one of the specified enum values, I get an Exception (using CXF 2.3.11): > org.apache.cxf.interceptor.Fault > at org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelper.java:107) > at org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) > at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) > at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) > at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:102) > at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:464) > at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:188) > at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148) > at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) > at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:751) > at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) > If I manually change the return type of the generated interface and my implementation from String to "org.apache.test.ETestResponseType.Enum", everything works well. > I could only test the wsdl2java generation with a newer CXF version, but 2.7.2 also generates a String as the response type. > I will attach a sample project. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira