I did some further experiments looking at the source code of Axis2... so
I thought of sharing the results with the mailing list...
Mauro Molinari ha scritto:
- what does -u ("unpack all classes") option actually do? I did some
quick tests and it seems to me that it does nothing... what am I missing?
This has effect only when you generate clients: with "unpack" switched
on, the ADBBeans are not generated as inner classes, but rather as
independent classes much like the server-side generated code.
> - what is -r ("specify a repository against which code is generated")
> useful for? What do you mean by "repository"?
Based on what I understood analyzing the source code, -r permits to
specify an alternative path where the Axis2 configuration file is
located. The default is in org.apache.axis2.deployment.axis2_default.xml
(in kernel module). It is still unclear to me what this configuration
file is useful for when using WSDL2Java tool...
- what is -em ("specify an external mapping file") option useful for?
What would an "external mapping file" look like?
Again, looking at the source code, I found:
org.apache.axis2.wsdl.codegen.extension.TypeMapperExtension
(in codegen module)
here the Javadoc says how a mapping file should look like (it's an XML
file; by the way, I found the corresponding MappingFile.xsd schema in
the "other" folder of codgen module source). Moreover, comments in
org.apache.axis2.wsdl.codegen.extension.TypeMapperExtension.engage(CodeGenConfiguration)
seem to explain that if a type mapping is defined in this external
mapping file, they should take precedence over the default mapping
defined in the extension of
org.apache.axis2.wsdl.databinding.DefaultTypeMapper in use. It is not
clear to me if there is a correlation between this class (in codegen
module) and org.apache.axis2.schema.typemap.TypeMap interface (in
adb-codegen module).
Actually, I would need to supply an implementation of the latter class
to WSDL2Java, because I want to change the mapping of xsd:int from int
to java.lang.Integer. Instead of implementing a complete new class, I
thought I could use the external mapping file mechanism to do this task.
The problem is that even if I create a file like this:
<?xml version="1.0" encoding="UTF-8"?>
<mappings dbf="adb"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MappingFile.xsd">
<mapping>
<qname namespace="http://www.w3.org/2001/XMLSchema">int</qname>
<value>java.lang.Integer</value>
</mapping>
</mappings>
and I pass it to WSDL2Java through the -em parameter, I don't get the
expected result: actually, I can't see any difference in the generated
code and xsd:int is still mapped to int, not java.lang.Integer.
Anyone can help?
--
Mauro Molinari
Software Developer
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]