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 Stadelmann Josef <jo...@axa-winterthur.ch> on 2012/03/13 17:25:03 UTC

[Axis-1.6.1, JAX-WS] how to deploy JAX-WS web service into Axis2

	I try to make my first JAX-WS Web service for Axis2-1.6.1
running on Tomcat-6.0.26
	
	Before I atempted to do so, I generated a JAX-WS web service and
depleoyed it success fully into GlassFish (latest version). :-) It
deployes perfect into GF; it's java client works; creating a wsdl and
xsd was a sniff; adding the attributes into the JAX-WS annotations
worked; after all I had a running FlowerAlbumService and a Java Client
making requets and displaying the flower images;
	
	INTEROPERABILITY GF/Metro/FlowerService to .Net WCF 4.0 under
VisualStudio was a SNIFF ( 1 morning of work until my client apps worked
as the java client did)
	I tooke Visual Studio 2010 and generated a stub by just
generating a so called servicereference. I developed my Windows Forms ad
the event handlers and called the generated stubClient and its methode
on it. All OK; I tuned the app.config and changed from buffer to stream
transfers, an from text Encoding to Mtom Encoding, and without
adjustiong anything on the GF Web Service all went OK, I could use it. I
can jsut rerad from the stream the bytes received from the service.

	
	OpenVMS and TOMCAT and AXIS2-1.6.1
	Now - as we do not have GF / Metro-WS-Stack running on OpenVMS
but Tomcat and AXIS2
	I like to know how to best port my JAX-WS WebService Class into
a Axis2 Tomcat Web Service environment;


	I've read the JAX-WS pages at
http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html
	
	

	Then I generated, using latest snapshots from maven (lates
archetype-catalog.xml at ~/.m2
	a axis2 quickstart hello world apps; this mainly to get all
maven setups right.

	
	I NetBeans 7.1.1 opend the generated project, took from the
previous GF/Metro Project the FlowerService.java file and pasted it into
my new Project BlumenService.java
	
	I have only a problem with @Stateless - the mark in the
annotation asking for a stateless session been.
	With one more dependency in maven 
	        <dependency>
	            <groupId>javax</groupId>
	            <artifactId>javaee-api</artifactId>
	            <version>6.0</version>
	            <type>jar</type>
	        </dependency>
	and a new build trigger, the errors went away and I hada clean
build.
	Question: Is this the rigth way to deal with @Stateless ?
	

	The build went OK, a jar and a aar file is generated; But when I
deploy the genrated aar into tghe service directory the troubles start.
	
	I think my service.xml is not properly deployed, or at the wrong
position in thegenerated aar file.

	
	SO - how do I get best for the service.xml, because deployment
via aar needs one?
	
	
	The
http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html#DeployServi
ce
	explains deployment like 

Packaging and deploying a JAX-WS service
Axis2 provides two mechanisms for deploying JAX-WS services: 
1.	The service may be packaged and deployed as an AAR, just like
any other service within Axis2. Like with all AARs, a services.xml file
containing the relevant metadata is required for the service to deploy
correctly. 
2.	The service may be packaged in a jar file and placed into the
servicejars directory. The JAXWSDeployer will examine all jars within
that directory and deploy those classes that have JAX-WS annotations
which identify them as Web services.

With 1. I have have problems with wsgen - where is that tool described
more closer, 
where do I best set my default to get the best and easieste (shortes
comamnd string) to do some usefule and correct for me?

With 2. I have a problem as Tomcat does know a service directory but not
a servicejar directory. Is this a documentation but? and is with
servicejar actually service meant?

	And if I deploy the BlumenService.jar (not the aar file) into
service directory of Tomcat the Deployment fails wit hthe following
message
1242690 [Timer-1] INFO  org.apache.axis2.deployment.DeploymentEngine  -
org.apache.axis2.deployment.DeploymentException: The services.xml file
cannot be found for the service: C:\Program Files\Apache Software
Foundation\Apache Tomcat
6.0.26\webapps\axis2\WEB-INF\services\FlowerService-1.0.jar


	So that would mean: I have to deliver in any case a service.xml
even if the coded is full of as JAX-WS annotations.
	So what does the JAXWSDepoyer of Axis2 expect? 
Can someone give me a pointer to the proper directory struicture and the
proper JAR command to make THAT JAR which JAXWSDepoyer canhandle? 

And hiow Help Full is wsgen in that game? What exactly does it generated
for me?

OR

	Also my maven generated jar file ( a pre-stept for the
aar-file,) is the wrong way to go.

can someone get me some light into that.

Josef

 


Re: [Axis-1.6.1, JAX-WS] how to deploy JAX-WS web service into Axis2

Posted by Shameera Rathnayaka <sh...@gmail.com>.
Hi Josef,

On Tue, Mar 13, 2012 at 9:55 PM, Stadelmann Josef <
josef.stadelmann@axa-winterthur.ch> wrote:

> **
>
>    *********I try to make my first JAX-WS Web service for Axis2-1.6.1
>    running on Tomcat-6.0********.********26*********
>
>    Before I atempted to do so, I generated a JAX-WS web service and
>    depleoyed it success fully into GlassFish (latest version). J It
>    deployes perfect into GF; it's java client works; creating a wsdl and
>    xsd was a sniff; adding the attributes into the JAX-WS annotations
>    worked; after all I had a running FlowerAlbumService and a Java Client
>    making requets and displaying the flower images;
>
>    INTEROPERABILITY GF/Metro/FlowerService to .Net WCF 4.0 under
>    VisualStudio was a SNIFF ( 1 morning of work until my client apps
>    worked as the java client did)
>
>    I tooke Visual Studio 2010 and generated a stub by just generating a
>    so called servicereference. I developed my Windows Forms ad the event
>    handlers and called the generated stubClient and its methode on it. All
>    OK; I tuned the app.config and changed from buffer to stream transfers, an
>    from text Encoding to Mtom Encoding, and without adjustiong anything on
>    the GF Web Service all went OK, I could use it. I can jsut rerad from
>    the stream the bytes received from the service.
>
>
>     *******OpenVMS and TOMCAT and AXIS2-1.6.1*
>
>    Now – as we do not have GF / Metro-WS-Stack running on OpenVMS but
>    Tomcat and AXIS2
>
>    I like to know how to best port my JAX-WS WebService Class into a Axis2
>    Tomcat Web Service environment;
>
>    *******I've read the JAX-WS pages at********
>    http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html*********
>
>     Then I generated, using latest snapshots from maven (lates
>    archetype-catalog.xml at ~/.m2
>
>    a axis2 quickstart hello world apps; this mainly to get all maven
>    setups right.
>
>    I NetBeans 7.1.1 opend the generated project, took from the previous GF/Metro
>    Project the FlowerService.java file and pasted it into my new Project
>    BlumenService.java
>
>    I have only a problem with @Stateless – the mark in the annotation
>    asking for a stateless session been.
>
>    With one more dependency in maven
>
>            <dependency>
>
>                <groupId>javax</groupId>
>
>                <artifactId>javaee-api</artifactId>
>
>                <version>6.0</version>
>
>                <type>jar</type>
>
>            </dependency>
>
>    and a new build trigger, the errors went away and I hada clean build.
>
>    Question: Is this the rigth way to deal with @Stateless ?
>
>    The build went OK, a jar and a aar file is generated; But when I
>    deploy the genrated aar into tghe service directory the troubles start.
>
>    I think my service.xml is not properly deployed, or at the wrong
>    position in thegenerated aar file.
>
>    SO - how do I get best for the service.xml, because deployment via aar
>    needs one?
>
>     The ***
>    http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html#DeployService
>    *<http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html#DeployService>
>
>    explains deployment like
>
>  *******Packaging and deploying a JAX-WS service*******
>
> Axis2 provides two mechanisms for deploying JAX-WS services:
>
> 1.      The service may be packaged and deployed as an AAR, just like any
> other service within Axis2. Like with all AARs, a services.xml file
> containing the relevant metadata is required for the service to deploy
> correctly.
>
> 2.      The service may be packaged in a jar file and placed into the
> servicejars directory. The JAXWSDeployer will examine all jars within that
> directory and deploy those classes that have JAX-WS annotations which
> identify them as Web services.
>
> With 1. I have have problems with wsgen – where is that tool described
> more closer,
>
> where do I best set my default to get the best and easieste (shortes
> comamnd string) to do some usefule and correct for me?
>
> With 2. I have a problem as Tomcat does know a service directory but not a
> servicejar directory. Is this a documentation but? and is with servicejar
> actually service meant?
>

Try with creating servicejar directory under the WEB-INF directory and
moving your jar file to it.

>          And if I deploy the BlumenService.jar (not the aar file) into
> service directory of Tomcat the Deployment fails wit hthe following message
>
> 1242690 [Timer-1] INFO  org.apache.axis2.deployment.DeploymentEngine  -
> org.apache.axis2.deployment.DeploymentException: The services.xml file
> cannot be found for the service: C:\Program Files\Apache Software
> Foundation\Apache Tomcat
> 6.0.26\webapps\axis2\WEB-INF\services\FlowerService-1.0.jar
>
.aar file is an another zip file which has .aar extension. If you are
deploying an archive file in "services" directory it required to have a
service.xml file to understand the web service . That is why you are
getting this error


>          So that would mean: I have to deliver in any case a service.xml
> even if the coded is full of as JAX-WS annotations.
>
>         So what does the JAXWSDepoyer of Axis2 expect?
>
> Can someone give me a pointer to the proper directory struicture and the
> proper JAR command to make THAT JAR which JAXWSDepoyer canhandle?
>
> And hiow Help Full is wsgen in that game? What exactly does it generated
> for me?
>
> OR
>
>         Also my maven generated jar file ( a pre-stept for the aar-file,)
> is the wrong way to go.
>
> can someone get me some light into that.
>
> Josef
>
>
>
>


-- 
Shameera Rathnayaka
Undergraduate
Department of Computer Science and Engineering
University of Moratuwa.
Sri Lanka.

Blog : http://shameerarathnayaka.blogspot.com/