aspose file tools*
The moose likes Web Services and the fly likes web service with jax-ws Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "web service with jax-ws" Watch "web service with jax-ws" New topic
Author

web service with jax-ws

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
I'm trying to create web service using jax-ws and following the instructions as shown in the following article by sun.

Creating Simple Web Service Using JAX-WS _ Sun.com

i'm using tomcat 5.0 as container

I have created a service implementation class as shown in the code bellow



now what the article says is as follows

he @WebService annotation declares the class as a web service. The name property in the @WebService annotation lets you define the web service name (the wdsl ortType attribute in WDSL 1.1). The serviceName property lets you define the WDSL service name. These properties are optional; if undefined, sensible default values will be derived from the class name.

The @WebMethod annotation is used to indicate which methods are to be exposed by this web service. Again, this annotation takes optional parameters that can be used to customize the WDSL values, though the default values are often quite sufficient. Note again that, apart from the annotations, this class is a perfectly normal Java class.

The annotations are processed by the JDK annotation processing tool, or Apt. Although Apt can be used as a command-line tool, in general you should integrate it into your build process. To do this using Ant, you need to declare the Apt task, as follows. The class is provided in the jaxws-tools.jar file:


you can find it in the link.

However i'm not able to understand what is apt and what the following xml content shows and where does it should go.



Till now i have written in one implementation class as shown in the code block.

created 1 cmd file as follows



But it is giving me the following error.



what might be the cause of this error ???

If more clarification needed please do let me know.

Thanks.

I tried to run the cmd file after removing
wsgen.bat -cp %CLASSPATH% india.StockQuoteImpl LINE

the class is getting complied fine.
[ February 07, 2008: Message edited by: Jigar Naik ]

Jigar Naik


Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 755
yippy.. i got the solution.

wsgen command was generating the web method(.java files) but it wasn't able to compile the generated java files.

i needed to set the classpath for one of the jar file of jaxb which is being used in generated java files. and it for compiled.

xxx
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web service with jax-ws