views:

51

answers:

1

Hello, I'm trying to generate webservice client with axis2 and maven so i followed some tutorials and put some code lines in my pom.xml :

<plugin>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
    <version>1.5.1</version>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2code</goal>
            </goals>
            <configuration>
                <packageName>my.packageName</packageName>
                <wsdlFile>src/main/resources/wsdl/service.wsdl</wsdlFile>
                <databindingName>xmlbeans</databindingName>
                <generateAllClasses>true</generateAllClasses>
                <generateServerSide>true</generateServerSide>
                <generateServerSideInterface>true</generateServerSideInterface>
                <generateServicesXml>true</generateServicesXml>
                <serviceName>service</serviceName>
            </configuration>
        </execution>
    </executions>
</plugin>

I've added the dependencies :

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2</artifactId>
    <version>1.5.1</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-api</artifactId>
    <version>1.2.6</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-impl</artifactId>
    <version>1.2.6</version>
</dependency>
<dependency>
    <groupId>axis</groupId>
    <artifactId>axis-wsdl4j</artifactId>
    <version>1.5.1</version>
</dependency>
<dependency>
    <groupId>org.apache.xmlbeans</groupId>
    <artifactId>xmlbeans</artifactId>
    <version>2.3.0</version>
</dependency>

The fact is that when i compile with "mvn clean install" or "mvn clean compile" i got the message:

[INFO] Internal error in the plugin manager executing goal 'org.apache.axis2:axi s2-wsdl2code-maven-plugin:1.5.1:wsdl2code': Unable to load the mojo 'org.apache. axis2:axis2-wsdl2code-maven-plugin:1.5.1:wsdl2code' in the plugin 'org.apache.ax is2:axis2-wsdl2code-maven-plugin'. A required class is missing: org/apache/axis2 /wsdl/codegen/CodeGenerationException org.apache.axis2.wsdl.codegen.CodeGenerationException

Can someone help me please?

A: 

My guess is that you are missing this dependency:

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-codegen</artifactId>
    <version>1.5.1</version>
</dependency>

scope=Provided or plugin dependency are probably enough. You can see the plugin's dependencies on mvnrepository.com

seanizer
Thank you for your answer, i've added it but still it doesn't work. So i generated my client classes with wsdl2java.bat but a lot of jar were missing in my project. Then i replaced all the missing jars with the jars i got when i dowloaded axis2. I found out that my problem was about corrupted jars and corrupted pom. I don"t know where i can find not corrupted pom though to replace mines...
dagofly
personally, I switched to cxf. it's less buggy while providing similar functionality
seanizer
interesting, i'll look for it later ...
dagofly
Now i got the webservice client that i needed by generating them with wsdl2java.bat. I updated my pom.xml to add all the missing dependecies. I replaced all corrupted files ".pom". It's fine but now my problem is about testing the classes. Still i'm newbie to axis2, it's kind of ... hum ... let's say ...headache ...
dagofly
After replacing all the corrupted jars and corrupted pom, i found out that it just needed to add inside my maven settings another url for a repository which works. How slow of me T_T
dagofly