Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I consume Web Services in Swing

 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I've deployed a web service using Eclipse WTP. What libraries should I choose in order to write a Swing Application to consume those web services. I have been trying this for a couple of days and came across a few code samples that use SOAP and Glue. But they don't seem very clear and I suppose they are out date. Could someone give me a rough idea on this.
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ragunath,

Please Use A Meaningful Subject Line. 'Newbie' does not tell what the question is about.
We have updated this one for you.

 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Jan Cumps thank you. I'll be careful next time.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consuming a web service has nothing to do with the kind of GUI that the consuming application might have. So you could use java.net.URLConnection, or Apache HttpClient, or the client-side libraries of Jersey or Axis2 or Metro - whichever suits your service best.
 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf Dittmer

I'm sorry I think I should rephrase the question. How do I construct a SOAP request for a web service using java. I have posted the WSDL generated using WTP.

 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say for example, how do I construct a SOAP request for verifyLogin.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual approach would be to have whatever SOAP toolkit you're using to generate code that accesses the service from the WSDL. All major toolkits have tools for that; for example, Axis2 has wsdl2java.

I would advise against generating the SOAP sort of "manually" in your code.
 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Axis 1. I'd like to do the following using java.

1. Discover all available services at the endpoint using java.
2. Construct request messages for each service with the information obtained form WSDL.

Could you enumerate it as sequences of steps for accomplishing my task.
 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup I found the tool. I've also generated the code using wsdl2java. What next?

Thanks in advance.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you worked through the samples that come with Axis, particularly the ones in the user guide? They show all aspects of getting a WS up and running.
 
Ragunath Jawahar
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. I just got through it. I generated the client rmi stub using Wsdl2java utility and used the service locator to access the services.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic