wood burning stoves*
The moose likes Web Services and the fly likes Javadoc generated from Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Javadoc generated from Web Service" Watch "Javadoc generated from Web Service" New topic
Author

Javadoc generated from Web Service

Markus Olsson
Greenhorn

Joined: Nov 18, 2010
Posts: 12
Hi, I have a quite large project including a web-service.

What I'd like to do is to generate a javadoc for just the web-service specific files, I'm using mac and netbeans and in Netbeans I can generate a javadoc for my entire project. But seeing there are several packages and classes that should not be included I wish to only get a java doc from the things the web-service will generate.

As you might understand what I want to achieve is a javadoc for the wsimport generated client, which is the javadoc I wrote on the server side for all the specific classes. So either a way of generating it on the client side from the info gather from wsimport, or a way to just generate the web-service specifics on the server side instead of the entire project.

If this is not possible is there somehow I can include the javadoc comments to the web-service?

I've only generated my javadoc from Netbeans so I'm not familiar with other ways than this.

Best Regards, Markus
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Markus,
If this is not possible is there somehow I can include the javadoc comments to the web-service?

Once java artefacts are generated on server side or client side, you can update them with necessary javadoc comments and then generate using your IDE. Is it not this simple? What problems are you facing in this process? If you want docs only for selective java classes, you may ignore other docs.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
Markus Olsson
Greenhorn

Joined: Nov 18, 2010
Posts: 12
The problem that occurs if I generate it on the client (from wsimport) I get for example: Login.java, LoginResponse.java and everything like that.

Same problem will be on the server after I create the web-service.
The Login is just a method in my web-service class so I don't want it to be javadoced as an entire class itself unless it actually is.

What I've done so far is I've generated a javadoc for my entire project, then sitting and sorting out all the html pages that is not "used" in the web-service or not needed. I feel this is not a good process for every time I might need to update either the javadoc or the code.

The point is to make it as easy as possible for the person using the web-service together with a documentation to understand, and as easy as possible for me to update my web-service without going through a lot of process.

If I'm going about this the wrong way and there are easier ways of having a documentation of a web-service please let me know. I'm using the @WebParam annotations as well for the names of each parameter.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Markus,
Okay, I got your problem. I'm not sure if we can selectively document class files/ packages from IDE especially NetBeans though there should be a way. But, what I can suggest you at this point is to use "javadoc" command directly to generate documentation required. Below is the syntax.


For more comprehensive options and attributes, you can refer javadoc syntax.
Markus Olsson
Greenhorn

Joined: Nov 18, 2010
Posts: 12
Hi Naren, great thanks for the replies.

Sorry to say but this will not directly solve my problems, since the web-service is just putting all my classes in one big package while the javadoc would still separate all the classes.

I've worked-around the problem in a bit easier way now by coping the project, putting all the classes in the same package as they are in the web-service generated client, and changed all the package notations so they are all in the same package. Then generate the javadoc, but just as well as my old "solution" this is really annoying to do every time I need to change something.

I can try something else than Netbeans if you know of an IDE or similar that can help me do this.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 576

Hi Markus,
Good that you are getting at something. But, you might not need to re-package your classes just for the documentation sake! javadoc task has got options to provide multiple classes (spreaded in various packages). If you include the javadoc command in your ANT build script then you can automate the whole process. I know it'd be a pain intially to identify dependent packages in your attempt to selectively provide classes, but it's worth doing as this should be just one-off.
Markus Olsson
Greenhorn

Joined: Nov 18, 2010
Posts: 12
Ah okey! Great thanks once again Naren, I'll certainly try and do that! That would surely be a great way of solving the matter, that would also allow me to include the svn repository version easily as well.

Once again great thanks for your assistance.
 
Consider Paul's rocket mass heater.
 
subject: Javadoc generated from Web Service