Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 83904 invoked from network); 22 Nov 2006 13:40:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 13:40:58 -0000 Received: (qmail 62986 invoked by uid 500); 22 Nov 2006 13:41:05 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 62941 invoked by uid 500); 22 Nov 2006 13:41:04 -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 62930 invoked by uid 99); 22 Nov 2006 13:41:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:41:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of csethil@gmail.com designates 64.233.182.189 as permitted sender) Received: from [64.233.182.189] (HELO nf-out-0910.google.com) (64.233.182.189) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:40:52 -0800 Received: by nf-out-0910.google.com with SMTP id o63so492232nfa for ; Wed, 22 Nov 2006 05:40:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=depnqFRwt7odUDNQsqRxaNZg2UDl0pFKJTLBz802efg8vUW9dPNbqfZG2JGaOv5ROQZQQjSIcgvSLnDPx1TBAOxhFZWPGuiK2re6Hjg6NMlz1FXR6xl+PBXIZ2aBxFh4VbzrFbac1OCYiSxs8OuLaUR9gz/Y8AnhvpxALiDpf4c= Received: by 10.49.41.18 with SMTP id t18mr2376821nfj.1164202830844; Wed, 22 Nov 2006 05:40:30 -0800 (PST) Received: by 10.49.67.16 with HTTP; Wed, 22 Nov 2006 05:40:30 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2006 19:10:30 +0530 From: "Thilina Gunarathne" To: "Axis developer list" Subject: [Axis2]Fwd: Some Improvements to Code Generation Tool In-Reply-To: <22a059a60611220536k407a8491u7071c1e6aab56a99@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <22a059a60611220536k407a8491u7071c1e6aab56a99@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Forwarding with the correct prefix... ---------- Forwarded message ---------- From: Milinda Pathirage Date: Nov 22, 2006 7:06 PM Subject: Some Improvements to Code Generation Tool To: axis-dev@ws.apache.org When I use Axis2 Java Code Generation tool to generate server side code for DataHandlerService.wsdl (see the attachment) with data binding adb, it generates code that has Java Default Class name inside some C source and header file which cause some compilation errors. Example: struct axis2_echoContent_impl { axis2_echoContent_t echoContent; axis2_qname_t* qname; org.apache.axiom.om.OMElement attrib_arg_0_2; }; /** * setter for arg_0_2 */ axis2_status_t AXIS2_CALL axis2_echoContent_set_arg_0_2( axis2_echoContent_t* echoContent, const axis2_env_t *env, org.apache.axiom.om.OMElement param_arg_0_2); I figured out that this error occur, because there are language specific DEFAULT_CLASS_NAME, DEFAULT_CLASS_ARRAY_NAME, DEFAULT_ATTRIB_CLASS_NAME and DEFAULT_ATTRIB_ARRAY_CLASS_NAME final Strings are declared inside the org.apache.axis2.schema.SchemaCompiler. To avoid this error I propose to remove these language specific things from the SchemaCompiler and include them in the BeanWriter interface implementations. Also we have to introduce new methods to the BeanWriter interface to make sure that every implementation of BeanWriter interface have these default things. Extra methods to BeanWriter interface: public String getDefaultClassName(); public String getDefaultClassArrayName(); public String getDefaultAttribClassName(); public String getDefaultAttribArrayClassName(); Example implementations inside implementations: For C code generation (CStructWriter) public static final String DEFAULT_CLASS_NAME = "axiom_node_t*"; public static final String DEFAULT_CLASS_ARRAY_NAME = "axis2_array_list_t"; public static final String DEFAULT_ATTRIB_CLASS_NAME = "axiom_attribute_t*"; public static final String DEFAULT_ATTRIB_ARRAY_CLASS_NAME = "axis2_array_list_t"; public String getDefaultClassName() { return DEFAULT_CLASS_NAME; } public String getDefaultClassArrayName() { return DEFAULT_CLASS_ARRAY_NAME; } public String getDefaultAttribClassName() { return DEFAULT_ATTRIB_CLASS_NAME; } public String getDefaultAttribArrayClassName() { return DEFAULT_ATTRIB_ARRAY_CLASS_NAME; } And inside the SchemaCompiler we have to use writer.getDefaultClassName() instead SchemaCompiler. DEFAULT_CLASS_NAME (same for others). Also inside CstructWriter and JavaBeanWriter we have to replace SchemaCompiler. DEFAULT_CLASS_NAME with getDefaultClassName(). I tried these modifications and build successful with tests. Also the generated C code is compiled without any compilation errors. -- http://webservices.apache.org/~thilina/ http://thilinag.blogspot.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org