aspose file tools*
The moose likes Web Services and the fly likes Axis and WSAD 5 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 "Axis and WSAD 5" Watch "Axis and WSAD 5" New topic
Author

Axis and WSAD 5

Dharamvir (DV) Punia
Ranch Hand

Joined: Oct 04, 2004
Posts: 34
Hi,
I am new to Javaranch and Webservices

Does anyone know how to integrate Axis with wsad. I did an application using apache file upload utility, all it does it takes files ( any kinds) from an html form and submits to a servlet which uses apache's "Commons FileUpload package", parses the request and stores each files in db2. I am trying to extend the functionality by using "Web Services". In my servlet , I want to create soap envelops with these files and send that envelop over to another servlet. After doing some research, I came to know about AXIS and I am very keen to integerate that with Wesbsphere Studio Application Developer(WSAD 5.1.2). If anyone has done this before ( soap with attachments using Axis and WSAD), I would truly appreciate their help.


- DV
dv.punia@gmail.com
Endy Brosens
Greenhorn

Joined: Sep 22, 2004
Posts: 12
Hello,

WSAD has standard support 4 Axis. Check the redbooks and WSAD help about the Web Service "Generate Skeleton classes" function of WSAD.

Grtz
Dharamvir (DV) Punia
Ranch Hand

Joined: Oct 04, 2004
Posts: 34
Hi Jan,
Thanks for ur reply on my post.
I eventually figured it out, I was very suprised to see no one is involved with wsad and webservices. I also found a bug in WSAD when creating web services for Sending attachments, when you create webservices through the wizard, wsad creates WSDL but it doesn't create a proper data mapping for DATAHANDLER, so I have to manually edit the wsdl mapping, if anone else is having the same problem, read this article ==>
Web Services application fails to start - non-standard MIME Types should be mapped to javax.activation.DataHandler

Thanks,
-DV
[ October 18, 2004: Message edited by: Dharamvir (DV) Punia ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Also check the documentation on how to send and receive attachments in webservices.
Check the link http://cvs.apache.org/viewcvs.cgi/ws-axis/java/samples/attachments/ as well, it has a working sample on attachment using apache axis.


Spritle Software Blogs
siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
Hi DhanVir

Where can i get examples of using Apache's Axis inside WSAD
Dharamvir (DV) Punia
Ranch Hand

Joined: Oct 04, 2004
Posts: 34
Siva,
I dont't think there are any specific examples to using axis with wsad. If you know how to create any basic webservice using wsad then you can just try axis sample code with wsad. For example, Take any webservice java class from axis samples, using WSAD all you need to do is create a webservice using the webservice wizard and wrap this class as a webservice and expose its methods which you want to expose.

For the client, create a webservice wizard using the client to communicate with the webservice which will create stubs which will allow you to communicate with the webservice you created. And now you can take code from axis client from the samples use that to call your webservice , just make sure you have all the necessary "imports" in you class. Make sure all the jar files are added to classpath of wsad test enviroment as well. If you missed this , it will complain at run time, some class not found...

There are some tutorials and tech articles on IBM site on:
IBM Redbook:
WebSphere Version 5.1 Application Developer 5.1.1 Web Services Handbook

Technotes: WebServices

Tutorials: Technical library

-DV
siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
Thanks Dhanvir.

I have already published webservices using WSAD.


I want to know the steps in order for creating SOAP Enveloped ,adding the parameter using Axis for both Client and response
siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
hi dhramvir can you give some example which uses Apache Axis
Dharamvir (DV) Punia
Ranch Hand

Joined: Oct 04, 2004
Posts: 34
Hi Siva,
First of all learn to spell other people's name correctly, in all your post you have misspelled my name, if you cann't spell my name correctly then don't write the name , if you carefully look my name beside the post, you can see clearly which also says DV in bracket, if Dharamvir is so hard to spell then use DV or don't use the name.

Anyway, here is a link to the samples from Apache: Axis Samples.

Steps on using it:

Take any example, let just take StockQuote, doing it from scratch:
1. Now pick the class which you want to use for Webservice, in this case the class would be StockQuoteService.java, import this class from StockQuote folder in your WSAD, if you get any errors, check your import packages if they are in path if not, then you download apache axis jar files on you machines, put those library's in your path, the error would go away.

2. Now use your WSAD Webservice wizard to create a webservice, when going through the wizard pick JAVABEAN service, and pick the java class which you imported from the samples and then select the method from the class which you want to expose.

3. So far so good, Once done it will create several stubs and helper classes.

4. Now that you used the WSAD wizard to create the webservice, now use this wizard again to create the client ( at the start of the wizard, pick webservice client, specify a different name so that you see what files were created. It will be created in a different folder.

5. Once you have stubs and classes for the client, now you can import the client from axis, There are few clients in the folder like GetQuote.java, Just import this file in the folder where you have client stubs created
6. Make sure to assign the name of your service where you have
-- call.setTargetEndpointAddress( url );
// url would be the address of your sebservice, you can get this full path from wsdl file which gets created by the wizard, which should be at the bottom and should look like this:
<wsdlsoap:address location="http://localhost:9080/DV_WebService/services/WebServiceJavaBean"/>

7. That should be it, Start you websphere test environment and then run your java client.

-DV
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis and WSAD 5