You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mauro Molinari <ma...@cardinis.com> on 2007/11/22 16:51:05 UTC
Help with some WSDL2Java parameters
Hello all,
still waiting for an explanation of -em option of Axis2 WSDL2Java
parameter, I was wondering how other options actually work, how they
have to be specified and what are they useful for. I did a lot of
searches on the net to find the answer, but the only result I could find
was another guy asking pretty much the same questions...
So:
- what is -em ("specify an external mapping file") option useful for?
What would an "external mapping file" look like?
- 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?
- what is -r ("specify a repository against which code is generated")
useful for? What do you mean by "repository"?
- is -g ("generate all classes") equivalent to a server-side generation
followed by a client-side generation? Or does it generate even more classes?
- at the end, is there a way to switch on the "Helper mode" explained at
http://ws.apache.org/axis2/1_3/adb/adb-advanced.html in WSDL2Java?
Is there any complete documentation available for this?
Thanks in advance!
--
Mauro Molinari
Software Developer
mauro.molinari@cardinis.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Help with some WSDL2Java parameters
Posted by Mauro Molinari <ma...@cardinis.com>.
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
mauro.molinari@cardinis.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org