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 David Ojeda <do...@integra.la> on 2008/11/04 16:52:42 UTC

More questions about maven and axis2

Hello all,

I have some questions about using maven and axis2. I am using maven 2.0.9, 
axis2 1.4.1, axis2-wsdl2code-maven-plugin 1.4.1.

Here is my situation:
Right now I just want to have a project that generates the client stub for a 
webservice. I need to use xmlbeans over other databindings.

I set up a pom to do this:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>mypackage.ws.client</groupId>
	<artifactId>wsclients</artifactId>
	<packaging>jar</packaging>
	<version>1.0.0-SNAPSHOT</version>
	<name>wsclients</name>
	<url>http://maven.apache.org</url>
	<build>
		<resources>
			<resource>
				<directory>target/generated-sources/axis2/wsdl2code/resources</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.axis2</groupId>
				<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
				<version>1.4.1</version>
				<executions>
					<execution>
						<goals>
							<goal>wsdl2code</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<packageName>mypackage.x1</packageName>
					<wsdlFile>src/main/wsdl/WSClientOperations.wsdl</wsdlFile>
					<databindingName>xmlbeans</databindingName>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.axis2</groupId>
			<artifactId>axis2</artifactId>
			<version>1.4.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.axis2</groupId>
			<artifactId>axis2-xmlbeans</artifactId>
			<version>1.4.1</version>
		</dependency>
	</dependencies>
</project>

The first problem I encountered was that I had to explicitly declare the 
axis2-xmlbeans dependecy. No big deal there.
Then, I was having the TypeHolder class problem that xmlbeans usually has when 
the schemaorg_apache_xmlbeans directory is not in the classpath. That's why I 
had to add to the pom a resource in the build section. It seems like the 
plugin doesn't work as it should, because I believe this step should not be 
necessary.

Now I want to add another wsdl so another stub is generated. I plan to have 
10-20 wsdl in this project so all stubs are generated here. 

My first question is: how do I add another wsdl? I checked 
http://ws.apache.org/axis2/tools/1_4_1/maven-plugins/maven-wsdl2code-
plugin.html
and there is no documentation for this scenario.

Second question: I would rather generate xmlbeans classes separately and tell 
wsdl2code to only generate stubs with the -Ewdc option. Is this possible with 
the axis2-wsdl2code-maven-plugin ? Again, the documentation doesn't say 
anything about this feature.

Third question: axis2 and maven users: how do you structure your projects with 
maven? I am really interested specially if my first and second questions are 
no and no. Do you use a module for each webservice client and webservice 
implementation?
I was hoping to have a module for all webservices client and another one for 
the server implementations (although one module per ws implementation works 
for me too).

Thanks for you attention

-- 
David Ojeda


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: More questions about maven and axis2

Posted by CheffPJ <pa...@gmail.com>.
Hello.  I very much appreciate this posting as I was having the same issue
with axsi2 generated xmlbeans resources not being included in the packaging.

This looks to be a bug.  Can an axis2 developer confirm please and I'll file
a bug report?

Thanks,
Pat McDonough



David Ojeda-2 wrote:
> 
> Hello all,
> 
> I have some questions about using maven and axis2. I am using maven 2.0.9, 
> axis2 1.4.1, axis2-wsdl2code-maven-plugin 1.4.1.
> 
> Here is my situation:
> Right now I just want to have a project that generates the client stub for
> a 
> webservice. I need to use xmlbeans over other databindings.
> 
> I set up a pom to do this:
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd">
> 	<modelVersion>4.0.0</modelVersion>
> 	<groupId>mypackage.ws.client</groupId>
> 	<artifactId>wsclients</artifactId>
> 	<packaging>jar</packaging>
> 	<version>1.0.0-SNAPSHOT</version>
> 	<name>wsclients</name>
> 	<url>http://maven.apache.org</url>
> 	<build>
> 		<resources>
> 			<resource>
> 			
> <directory>target/generated-sources/axis2/wsdl2code/resources</directory>
> 			</resource>
> 		</resources>
> 		<plugins>
> 			<plugin>
> 				<groupId>org.apache.axis2</groupId>
> 				<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
> 				<version>1.4.1</version>
> 				<executions>
> 					<execution>
> 						<goals>
> 							<goal>wsdl2code</goal>
> 						</goals>
> 					</execution>
> 				</executions>
> 				<configuration>
> 					<packageName>mypackage.x1</packageName>
> 					<wsdlFile>src/main/wsdl/WSClientOperations.wsdl</wsdlFile>
> 					<databindingName>xmlbeans</databindingName>
> 				</configuration>
> 			</plugin>
> 		</plugins>
> 	</build>
> 	<dependencies>
> 		<dependency>
> 			<groupId>junit</groupId>
> 			<artifactId>junit</artifactId>
> 			<version>3.8.1</version>
> 			<scope>test</scope>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.axis2</groupId>
> 			<artifactId>axis2</artifactId>
> 			<version>1.4.1</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>org.apache.axis2</groupId>
> 			<artifactId>axis2-xmlbeans</artifactId>
> 			<version>1.4.1</version>
> 		</dependency>
> 	</dependencies>
> </project>
> 
> The first problem I encountered was that I had to explicitly declare the 
> axis2-xmlbeans dependecy. No big deal there.
> Then, I was having the TypeHolder class problem that xmlbeans usually has
> when 
> the schemaorg_apache_xmlbeans directory is not in the classpath. That's
> why I 
> had to add to the pom a resource in the build section. It seems like the 
> plugin doesn't work as it should, because I believe this step should not
> be 
> necessary.
> 
> Now I want to add another wsdl so another stub is generated. I plan to
> have 
> 10-20 wsdl in this project so all stubs are generated here. 
> 
> My first question is: how do I add another wsdl? I checked 
> http://ws.apache.org/axis2/tools/1_4_1/maven-plugins/maven-wsdl2code-
> plugin.html
> and there is no documentation for this scenario.
> 
> Second question: I would rather generate xmlbeans classes separately and
> tell 
> wsdl2code to only generate stubs with the -Ewdc option. Is this possible
> with 
> the axis2-wsdl2code-maven-plugin ? Again, the documentation doesn't say 
> anything about this feature.
> 
> Third question: axis2 and maven users: how do you structure your projects
> with 
> maven? I am really interested specially if my first and second questions
> are 
> no and no. Do you use a module for each webservice client and webservice 
> implementation?
> I was hoping to have a module for all webservices client and another one
> for 
> the server implementations (although one module per ws implementation
> works 
> for me too).
> 
> Thanks for you attention
> 
> -- 
> David Ojeda
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/More-questions-about-maven-and-axis2-tp20325210p20566200.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: More questions about maven and axis2

Posted by Nandana Mihindukulasooriya <na...@gmail.com>.
Another alternative for you would be, use the maven-antrun-plugin and use
the WSDL2Java directly so you can utilize the same command line options

eg.
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>source-code-generation</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <java
classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri path/to/wsdl -u -uw <any
options>"/>
                                    <classpath
refid="maven.dependency.classpath"/>
                                    <classpath
refid="maven.compile.classpath"/>
                                    <classpath
refid="maven.runtime.classpath"/>
                                </java>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

thanks,
nandana

On Tue, Nov 4, 2008 at 9:22 PM, David Ojeda <do...@integra.la> wrote:

> Hello all,
>
> I have some questions about using maven and axis2. I am using maven 2.0.9,
> axis2 1.4.1, axis2-wsdl2code-maven-plugin 1.4.1.
>
> Here is my situation:
> Right now I just want to have a project that generates the client stub for
> a
> webservice. I need to use xmlbeans over other databindings.
>
> I set up a pom to do this:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>        <modelVersion>4.0.0</modelVersion>
>        <groupId>mypackage.ws.client</groupId>
>        <artifactId>wsclients</artifactId>
>        <packaging>jar</packaging>
>        <version>1.0.0-SNAPSHOT</version>
>        <name>wsclients</name>
>        <url>http://maven.apache.org</url>
>        <build>
>                <resources>
>                        <resource>
>
>  <directory>target/generated-sources/axis2/wsdl2code/resources</directory>
>                        </resource>
>                </resources>
>                <plugins>
>                        <plugin>
>                                <groupId>org.apache.axis2</groupId>
>
>  <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
>                                <version>1.4.1</version>
>                                <executions>
>                                        <execution>
>                                                <goals>
>
>  <goal>wsdl2code</goal>
>                                                </goals>
>                                        </execution>
>                                </executions>
>                                <configuration>
>
>  <packageName>mypackage.x1</packageName>
>
>  <wsdlFile>src/main/wsdl/WSClientOperations.wsdl</wsdlFile>
>
>  <databindingName>xmlbeans</databindingName>
>                                </configuration>
>                        </plugin>
>                </plugins>
>        </build>
>        <dependencies>
>                <dependency>
>                        <groupId>junit</groupId>
>                        <artifactId>junit</artifactId>
>                        <version>3.8.1</version>
>                        <scope>test</scope>
>                </dependency>
>                <dependency>
>                        <groupId>org.apache.axis2</groupId>
>                        <artifactId>axis2</artifactId>
>                        <version>1.4.1</version>
>                </dependency>
>                <dependency>
>                        <groupId>org.apache.axis2</groupId>
>                        <artifactId>axis2-xmlbeans</artifactId>
>                        <version>1.4.1</version>
>                </dependency>
>        </dependencies>
> </project>
>
> The first problem I encountered was that I had to explicitly declare the
> axis2-xmlbeans dependecy. No big deal there.
> Then, I was having the TypeHolder class problem that xmlbeans usually has
> when
> the schemaorg_apache_xmlbeans directory is not in the classpath. That's why
> I
> had to add to the pom a resource in the build section. It seems like the
> plugin doesn't work as it should, because I believe this step should not be
> necessary.
>
> Now I want to add another wsdl so another stub is generated. I plan to have
> 10-20 wsdl in this project so all stubs are generated here.
>
> My first question is: how do I add another wsdl? I checked
> http://ws.apache.org/axis2/tools/1_4_1/maven-plugins/maven-wsdl2code-
> plugin.html<http://ws.apache.org/axis2/tools/1_4_1/maven-plugins/maven-wsdl2code-plugin.html>
> and there is no documentation for this scenario.
>
> Second question: I would rather generate xmlbeans classes separately and
> tell
> wsdl2code to only generate stubs with the -Ewdc option. Is this possible
> with
> the axis2-wsdl2code-maven-plugin ? Again, the documentation doesn't say
> anything about this feature.
>
> Third question: axis2 and maven users: how do you structure your projects
> with
> maven? I am really interested specially if my first and second questions
> are
> no and no. Do you use a module for each webservice client and webservice
> implementation?
> I was hoping to have a module for all webservices client and another one
> for
> the server implementations (although one module per ws implementation works
> for me too).
>
> Thanks for you attention
>
> --
> David Ojeda
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>