Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 92818 invoked from network); 31 Mar 2009 07:49:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2009 07:49:12 -0000 Received: (qmail 76441 invoked by uid 500); 31 Mar 2009 07:49:11 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 76332 invoked by uid 500); 31 Mar 2009 07:49:11 -0000 Mailing-List: contact dev-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 dev@cxf.apache.org Received: (qmail 76322 invoked by uid 99); 31 Mar 2009 07:49:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 07:49:11 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.79.199.57] (HELO server.dankulp.com) (64.79.199.57) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 07:49:02 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id E70CA197C068; Tue, 31 Mar 2009 03:48:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.5-gr0 (2008-06-10) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.3nqLZyzrCr Received: from dilbert.localnet (c-24-91-141-225.hsd1.ma.comcast.net [24.91.141.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTP id 23F38197C059; Tue, 31 Mar 2009 03:48:37 -0400 (EDT) From: Daniel Kulp To: dev@cxf.apache.org Subject: Re: wsdl2java -p option change Date: Tue, 31 Mar 2009 03:48:37 -0400 User-Agent: KMail/1.11.1 (Linux/2.6.28-gentoo-r3; KDE/4.2.1; x86_64; ; ) Cc: "Rao, Sameer V" References: <200903301010.39019.dkulp@apache.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903310348.37988.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.6 required=3.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.5-gr0 On Mon March 30 2009 6:26:35 pm Rao, Sameer V wrote: > Since XJC already supports using single package name for multiple > schemas with different namespace by means of passing the -p parameter, > why should this feature be disabled? I believe (at least at one point), that this was one of the parameters that could not be passed programmatically into jaxb. For example, the -npa flag isn't passable as well: https://issues.apache.org/jira/browse/CXF-1934 That said, it may have been fixed at one point. -npa is supposed to be fixed on the JAXB trunk to be part of jaxb 2.1.11. If you tested with the -xjc-p thing, then it probably does work now and we could switch to that. > If we pass -xjc-p, in the wsdl2java then XJC should (and > does pick) up the single package for all namespaces and builds 1 > ObjectFactory.java with createxxx() for all the types. It also generate > the package-info.java with the with namespace that is most frequently > used and in other JAXB classes it creates the XMLElement with the name > and namespace. Cool. Maybe eliminate the error and pass it that way. That would be perfect. > One thing I noticed is that JAXBDataBinding class is actually passing > the default packagename passed to the wsdl2java to XJC. Should it be > doing that? Instead it should just let the user pass JAXB package > through the -xjc argument. > > if (context.getPackageName() != null) { > > schemaCompiler.setDefaultPackageName(context.getPackageName()); > } > > The context.getPackageName is the -p parameter of wsdl2Java (i.e. the > default package for the service interface, fault-class etc. Should we be > really passing the same to databinding compiler - XJC? The purpose was to allow things to be easily specified in one place and the tooling could separate things out. Basically, allow a single -p blah to dump everything out in blah if that's possible. If we can map the -p into xjc's - p flag, that would accomplish that. Dan > > > Thanks, > Sam > > -----Original Message----- > From: Daniel Kulp [mailto:dkulp@apache.org] > Sent: Monday, March 30, 2009 9:11 AM > To: dev@cxf.apache.org > Cc: Eamonn Dwyer > Subject: Re: wsdl2java -p option change > > > Eamonn, > > On Mon March 30 2009 9:25:23 am Eamonn Dwyer wrote: > > It looks like the use of the -p flag with wsdl2java has changed dor > > cxf > > > 2.2. Now it reports > > > > "-p option cannot be used when wsdl contains mutiple schemas" > > > > for my wsdl, even though the wsdl compiles with version 2.1.4. > > Hmm... I thought that message went in for 2.1.4 as well. I'm surprised > it > worked for 2.1.4. > > Actually, that error message should change a bit. -p CAN be used if > you > provide a unique package for each namespace: > > -p http://blah.com=com.blah -p http://foo.com=com.foo > > > The wsdl in question does import other schema, so I reckon that this > > is > > > causing the error to be reported. Is that correct? > > If there are schemas in multiple namespaces, then it should report that > issue. > > > If this is the case, is it really valid to say I cannot specify a > > package name now when I import a schema. I can understand it when the > > schema is a 3rd party one, but what if I just have simply factored out > > some schema from the wsdl file? > > Basically, if you have multiple schemas, you NEED to specify a unique > package > name for each schema so the package-info.java and ObjectFactory.java for > each > schema is put in a unique location instead of overwriting itself. -- Daniel Kulp dkulp@apache.org http://www.dankulp.com/blog