Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 94EF8200B9A for ; Fri, 23 Sep 2016 07:20:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 93895160AAD; Fri, 23 Sep 2016 05:20:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B950F160AE0 for ; Fri, 23 Sep 2016 07:20:21 +0200 (CEST) Received: (qmail 77123 invoked by uid 500); 23 Sep 2016 05:20:20 -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 77034 invoked by uid 99); 23 Sep 2016 05:20:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Sep 2016 05:20:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A9B392C2A5E for ; Fri, 23 Sep 2016 05:20:20 +0000 (UTC) Date: Fri, 23 Sep 2016 05:20:20 +0000 (UTC) From: "Randy Leonard (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: =?utf-8?Q?[jira]_[Reopened]_(CXF-7062)_wsdl2java_gen?= =?utf-8?Q?erates_incorrect_@Xml?= =?utf-8?Q?Element(namespace=3D=E2=80=9C=E2=80=A6=E2=80=9D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 23 Sep 2016 05:20:22 -0000 [ https://issues.apache.org/jira/browse/CXF-7062?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Randy Leonard reopened CXF-7062: -------------------------------- See latest comment > wsdl2java generates incorrect @XmlElement(namespace=3D=E2=80=9C=E2=80=A6= =E2=80=9D) > -------------------------------------------------------- > > Key: CXF-7062 > URL: https://issues.apache.org/jira/browse/CXF-7062 > Project: CXF > Issue Type: Bug > Components: Soap Binding > Affects Versions: 3.1.7 > Environment: MacOSX 10.11, Java v1.8 > Reporter: Randy Leonard > Assignee: Daniel Kulp > Priority: Blocker > Fix For: Invalid > > > I am using Apache CXF 3.1.7, and the wsdl2java command is generating code= with missing/incorrect namespace attributes on the @XMLEment annotation. > Note I generally use four distinct namespaces within each WSDL document, = which are as follows: > =09=E2=80=A2 Shared data types across many WSDL documents (http://v1_0_0.= datatypes.provider.soap.foundation.rps.com) > =09=E2=80=A2 Domain-specific data types (http://v1_0_0.datatypes.provider= .soap.common.masterdata.rps.com) > =09=E2=80=A2 Parameter types (http://v1_0_0.parameters.provider.soap.comm= on.masterdata.rps.com) > =09=E2=80=A2 Service types (http://v1_0_0.provider.soap.common.masterdata= .rps.com) > This gives a nice separation of data types, and has worked quite well for= me with Axis2. I am having issues, however, when applying this approach to= CXF. Below is an example WSDL document with the namespaces defined above: > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > > xmlns:foundationTypes=3D"http://v1_0_0.datatypes.provider.soap.foundation= .rps.com" > =09xmlns:masterdataCommonTypes=3D"http://v1_0_0.datatypes.provider.soap.c= ommon.masterdata.rps.com" > xmlns:parameter=3D"http://v1_0_0.parameters.provider.soap.common.masterda= ta.rps.com" xmlns:soapenc=3D"http://schemas.xmlsoap.org/soap/encoding/" > =09xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:tns=3D"http://v1= _0_0.provider.soap.common.masterdata.rps.com" > xmlns:http=3D"http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs=3D"http://w= ww.w3.org/2001/XMLSchema" > =09xmlns:wsoap12=3D"http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap= =3D"http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:mime=3D"http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi=3D"http://= www.w3.org/2001/XMLSchema-instance" > =09xmlns:soap12=3D"http://schemas.xmlsoap.org/wsdl/soap12/"> > =09 > =09=09 > > =09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09 > =09=09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09=09 maxOccurs=3D"unbounded" /> > =09=09=09=09=09 > =09=09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09 > =09=09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09 > =09=09=09=09=09 > =09=09=09=09=09=09 > =09=09=09=09=09 > =09=09=09=09 > =09=09=09 > =09=09 > =09 > =09 > =09=09 > =09 > =09 > =09=09 > =09 > =09 > =09=09 > =09 > =09 > =09=09 > =09 > =09 > =09=09 > =09=09=09 > =09=09=09 > =09=09 > =09=09 > =09=09=09 > =09=09=09 > =09=09 > =09 > =09 > =09=09 > =09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09 > =09=09 > =09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09 > =09=09=09 > =09=09=09=09 > =09=09=09 > =09=09 > =09 > =09 > =09=09 > =09=09=09 > =09=09 > =09 > > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > The following generated ConsumerChannelFetchResponse class contains no na= mespace attribute for @XmlElement annotations, unless I include '-xjc-npa' = in the wsdl2java command. When including '-xjc-npa', I then get the incorre= ct namespaces in the @XmlElement annotation. Both scenarios result in unmar= shaling errors on the client side: > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > /** > *

Java class for anonymous complex type. > *=20 > *

The following schema fragment specifies the expected content contai= ned within > this class. > *=20 > *

>  * <complexType>
>  *   <complexContent>
>  *     <restriction base=3D"{http://www.w3.org/2001/XMLSchema}anyType"=
>
>  *       <sequence>
>  *         <element name=3D"status" type=3D"{http://v1_0_0.datatypes.p=
rovider.soap.foundation.rps.com}Status"/>
>  *         <element name=3D"channels" type=3D"{http://v1_0_0.datatypes=
.provider.soap.common.masterdata.rps.com}ConsumerChannel"
> maxOccurs=3D"unbounded" minOccurs=3D"0"/>
>  *       </sequence>
>  *     </restriction>
>  *   </complexContent>
>  * </complexType>
>  * 
> *=20 > *=20 > */ > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name =3D "", propOrder =3D { > "status", > "channels" > }) > @XmlRootElement(name =3D "consumerChannelFetchResponse", namespace =3D "h= ttp://v1_0_0.parameters.provider.soap.common.masterdata.rps.com") > public class ConsumerChannelFetchResponse { > @XmlElement(namespace =3D "http://v1_0_0.parameters.provider.soap.com= mon.masterdata.rps.com", > required =3D true) > protected Status status; > @XmlElement(namespace =3D "http://v1_0_0.parameters.provider.soap.com= mon.masterdata.rps.com") > protected List channels; > =E2=80=A6=E2=80=A6=E2=80=A6. > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > Note the namespace in the 'Status' variable @XmlElement annotation for th= e above code should be: > =09=E2=80=A2 http://v1_0_0.datatypes.provider.soap.foundation.rps.com > But is the following instead: > =09=E2=80=A2 http://v1_0_0.parameters.provider.soap.common.masterdata.rps= .com > A close examination of the comment block prior to the ConsumerChannelFetc= hResponse class declaration indicates wsdl2java cleary understands the Stat= us type is from the correct class, but the namespace attribute in the @XmlE= lement does not reflect this. > I've tried generating this class using both the cxf-codegen-plugin plugin= , and executing wsdl2java directly from the command line. Both to no avail. -- This message was sent by Atlassian JIRA (v6.3.4#6332)