Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 34542 invoked from network); 11 Dec 2006 19:12:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Dec 2006 19:12:50 -0000 Received: (qmail 32097 invoked by uid 500); 11 Dec 2006 19:12:54 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 32052 invoked by uid 500); 11 Dec 2006 19:12:54 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 32041 invoked by uid 99); 11 Dec 2006 19:12:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 11:12:54 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Dec 2006 11:12:45 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 583DB71413D for ; Mon, 11 Dec 2006 11:12:25 -0800 (PST) Message-ID: <20180606.1165864345358.JavaMail.jira@brutus> Date: Mon, 11 Dec 2006 11:12:25 -0800 (PST) From: "Craig S. Bosma (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Commented: (AXIS2-1609) namespace to package (ns2p) code gen option does not work in Axis2 1.1 RC2 In-Reply-To: <32315413.1162790797147.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/AXIS2-1609?page=3Dcomments#actio= n_12457444 ]=20 =20 Craig S. Bosma commented on AXIS2-1609: --------------------------------------- >From what I've found so far, there appear to be at least two issues at stak= e here. The first, and simplest, is that only the first namespace-to-packag= e mapping is respected when specified on the command line in -ns2p ns1=3Dpk= g1,ns2=3Dpkg2,...,nsN=3DpkgN format. If however, if a property file name co= ntaining the mappings is given as an argument to the -ns2p option, all of t= he mappings will be respected (NOTE: this usage does not seem to be well do= cumented). The culprit seems to be in CodegenConfigLoader.loadConfig(CodeGe= nConfiguration config, Map optionMap). At line 141 (release 1.1) the value = assigned to 'value' is a string representing only the first namespace name-= value pair. Subsequently then, when 'value' is tokenized, only one mapping = emerges. I cobbled together an alternative: ... List values =3D commandLineOption.getOptionValues(); if (values !=3D null && values.size() > 0) { // Try treating the values as a name=3Dvalue pair separated= by comma's String value =3D (String) values.get(0); if (value.indexOf('=3D') !=3D -1) { HashMap map =3D new HashMap(values.size()); for (Iterator iterator =3D values.iterator(); iterator.= hasNext();) { value =3D (String) iterator.next(); String valuepair[] =3D value.split("=3D"); if (valuepair.length =3D=3D 2) { map.put(valuepair[0], valuepair[1]); } } config.setUri2PackageNameMap(map); } else { // Try loading the properties from the file specified ... Now that's just off the top of my head and untested, but you see the intent= . The second issue appears when the -u (unpack) option is enabled. Even when = the namespaces are explictly mapped to packages (i.e. by the property file = mentioned above), code generation still fails with a FileNotFoundException = for '.\src\web\soap\v3\analytics\siebel\com\ExtensionMapper.java'. By runni= ng this through a debugger, I've observed that all the databinding classes = generated from the schema are correctly mapped to the specified packages an= d written to disk; however, the ExtensionMapper class is not, because its p= ackage name comes from the 'mappingClassPackage' field which is registered = by a call to registerExtensionMapperPackageName(String) in SchemaCompiler:2= 44. It appears that the namespace from the schema is run through URLProcess= or.makePackageName(String) and registered as the extension mapper package n= ame without looking at any of the namespace mapping options given by the us= er. I don't think this would normally cause the whole process to fail (thou= gh the ExtensionMapper might wind up in a different package than expected),= except that the URL Processor doesn't handle namespaces of the form com.ex= ample.foo/path/to/bar well; they end up with residual '/' characters which = the file writer then chokes on. I'd be happy to help implement any fixes; unfortunately I can't help out mu= ch more until I get home to my working copy. Any input from someone more fa= miliar with the codebase than I would be welcome. > namespace to package (ns2p) code gen option does not work in Axis2 1.1 RC= 2 > -------------------------------------------------------------------------= - > > Key: AXIS2-1609 > URL: http://issues.apache.org/jira/browse/AXIS2-1609 > Project: Apache Axis 2.0 (Axis2) > Issue Type: Bug > Components: codegen > Affects Versions: 1.1 > Environment: Win XP, JDK 1.5 > Reporter: Charitha Kankanamge > Priority: Critical > Attachments: expression.xsd, FehlerWsdl2Java.zip, KeinFehlerWsdl2= Java.zip, MathsService.wsdl, saw-local.wsdl, SAWServices.xsd > > > ns2p code gen option does not work in Axis2 1.1 RC2. > I provided the following code gen option. > C:\Axis\axis-rc\axis2-1.1\bin>wsdl2java -uri "C:\Documents and Settings\C= haritha\workspace2\servicetest\temp2\MathsService.wsdl" -ns2p http://test.c= om=3Dmy.new > -o "C:\Documents and Settings\Charitha\workspace2\servicetest\temp2\packa= getest" > The generated stub was not included in the given package (my.new). Instea= d, it was included inside the original package (com.test) > The wsdl file is attached here with. --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org