Axis2 java2wsdl maven plugin

I demonstrated the usage of Maven2 WSDL2Code plugin in a previous post. Apache Axis2 provides with a Java2WSDL maven2 plugin as well. Maven2 Java2Wsdl plugin can be used to generate WSDL from a java class. The following steps will help you to create a wsdl from a java class using Axis2 java2wsdl maven plugin.

Step 1
Create a mavan project (See step 1 of ).
Create a java class in the source directory of your maven project. (i.e:- Create class at \src\main\java\com\test directory)

Step 2

Update the pom.xml of your maven project as follows.

<project xmlns="" xmlns:xsi=""


Note the highlighted elements in the above pom. First we added a new <plugin> to use java2wsdl goal. This goal accepts a set of parameters as explained in Axis2 online documentation.
In this example we used the simplest configuration parameter, <className>, which defines the fully qualified name of class from which the WSDL is generated.

Also, make sure to add a dependency to Axis2 jars in your pom.xml.

Step 3

Go to the root directory of your project structure and run the following command.

mvn clean axis2-java2wsdl:java2wsdl

You could find the generated wsdl at target\generated-resources\java2wsdl\ directory.


joefitz said…
This comment has been removed by the author.
Carlo.LF said…
Hi Charita,

I tried the tool with my own class and ran into an IO error complaining about an invalid syntax for file creation. This is the output when running maven with the -X flag:


These will use the artifact files already in the core ClassRealm instead, to all
ow them to be included in PluginDescriptor.getArtifacts().

[DEBUG] Configuring mojo 'org.apache.axis2.maven2:axis2-java2wsdl-maven-plugin:1
.1:java2wsdl' -->
[DEBUG] (f) className =
[DEBUG] (f) outputFileName = D:\Java\Projekte\lhw-favorit\LHW\trunk\FAV LHW ws
[DEBUG] (f) project = MavenProject: favlhw:favlhwws-service:0.2 @ D:\Java\Proj
ekte\lhw-favorit\LHW\trunk\FAV LHW ws services\pom.xml
[DEBUG] -- end configuration --
[INFO] [axis2-java2wsdl:java2wsdl]
java.lang.Exception: Die Syntax f³r den Dateinamen, Verzeic
hnisnamen oder die Datentrõgerbezeichnung ist falsch

As I can see, the path of the file to be created is not a valid Windows path (D:\Java\Proj
ekte\lhw-favorit\LHW\trunk\FAV LHW ws services\pom.xml)

What can I do to change this?
Anonymous said…
Perfect!!You are a outstanding person!Have you ever wore chaussures puma,Here are the most popular puma CAT,Puma shoes store gives some preview of puma speed cat,and casual but no sweat puma basket.
Anonymous said…
There are ed hardy shirts
,pretty ed hardy shirt for men,

ed hardy womens in the ed hardy online store

designed by ed hardy ,
many cheap ed hardy shirt ,glasses,caps,trouers ed hardy shirts on sale ,

You can go to to have a look ,you may find one of ed hardy clothing fit for you
Top qualitymen's jacket,
These cheap jacket are on sale now,you can find
north face jackets inmage on our web
Ralph Lauren Polo Shirtsbuberry polo shirts

Do you wannaghd hair straighteners for you own , we have many
cheap ghd hair straightenersin style and great,you can choose one from these
hair straighteners
Authentic chaussure puma
chaussure sport
And chaussure nike shoes
Dawei Jin said…
Thanks man it worked, but only after I changed version number to 1.3

Popular posts from this blog

Common mistakes to avoid in WSO2 ESB - 1 - "org.apache.axis2.AxisFault: The system cannot infer the transport information from the URL"

Working with HTTP multipart requests in soapUI

WS-Reliable messaging with WSO2 WSAS -1