Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

web service with jax-ws

Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 _

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.


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
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Hold that thought. Tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic