axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <>
Subject [Axis2][Fwd: Some Improvements to Code Generation Tool]
Date Wed, 22 Nov 2006 16:33:29 GMT

-------- Original Message --------
Subject: 	Some Improvements to Code Generation Tool
Date: 	Wed, 22 Nov 2006 18:41:01 +0530
From: 	Milinda Pathirage <>
Reply-To: 	Apache AXIS C Developers List <>
To: 	Apache AXIS C Developers List <>

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.


struct axis2_echoContent_impl


axis2_echoContent_t echoContent;

axis2_qname_t* qname; attrib_arg_0_2;



* setter for arg_0_2


axis2_status_t AXIS2_CALL


axis2_echoContent_t* echoContent,

const axis2_env_t *env, param_arg_0_2);

I figured out that this error occur, because there are language specific 
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 = 

public String getDefaultClassName() {



public String getDefaultClassArrayName() {



public String getDefaultAttribClassName() {



public String getDefaultAttribArrayClassName() {



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.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message