Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAXB step by step  RSS feed

 
samir mohamed
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am new in java web services and I want to learn about JAXB. I could understand how a web service can be published and consumed using Apache axis, Is is it possible to implement JAXB using axis?, if so, is there any link where I can find a step by step example of on how to use JAXB using Apache axis or any other tool.

Best Regards
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you gone through the tutorial you were pointed to in this thread, where you asked essentially the same question?
 
samir mohamed
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I did

I am looking for an example of implementation using Apache axis. I mean how can I implement JAXB using Apache axis.

Best Regards
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know Axis 2 doesn't yet support JAXB though it seems to be planned for the future.
Because JAXB wasn't readily available when Axis 1.x became popular examples tend to use Castor instead of JAXB.
Create Web services using Apache Axis and Castor
This article may contain some valuable hints on how to integrate JAXB (instead of Castor).

Some traffic in the Mailing list archives suggest that it may be easiest to use the Axis 1.x Message Services Style that gives you direct access to the XML message if you are trying to use JAXB.

Note that if you are limited to Java 1.4 then you are also limited to JAXB 1.0.
 
samir mohamed
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peer

I am reading a document showing how to use JAXB step by step, but it requires to download "JAXB EA Implementation v 1.0"

I could not download it from the SUN site, do you know any other site where I can download it from?

Best Regards
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAXB 1.0 Project Page
JAXB 1.0 RI Download
Follow the Stable Builds link.
Then follow any one of the release folders: 1.0.3, 1.0.4, 1.0.5, 1.0.6
 
samir mohamed
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peer

In the site that you provided, I could find jar files that contain java classes.
what I am looking for is the xjc command, this is the paragraph that shows how to use the xjc command :

"Assuming that the JAXB EA Implementation v 1.0 is installed and set up correctly, run the following command in a command prompt or terminal to generate the processing codes:

xjc item.dtd item.xjs

Please note that xjc is the schema compiler that is part of the JAXB distribution. The parameters specified are files that are shown in Code Samples 2 and 3. "

I wonder how can I get the package that contains such command

Best Regards
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The xjc compiler is implemented as the com.sun.tools.xjc.XJCTask class and deployed in the \lib\jaxb-xjc.jar
You execute it with a command script found in the \bin directory: xjc.sh or xjc.bat
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!