Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a web service from a servlet........

 
karthik mama
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i am actually new as to how can we call a web service from a servlet/jsp. I could do the same from a client but not from a servlet can anyone please help.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet can run the very same code you're using from a client (by which I assume you mean a desktop Java app). What problems are you encountering? (Please never, ever, do this kind of thing in a JSP.)
 
karthik mama
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using RAD 7 and the server is WAS 6.1.

I need to send the form details to the servlet from where in i need to create a bean based on those form details. then invoke a service on that bean get the response back then present it.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "a bean" in the context of WS? Which WS toolkit are you using? Most toolkits come wth tools to create client code for a WS given by a WSDL.
 
karthik mama
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes for a WS client code is automatically generated. But the thing is without the help of the client generated i need to invoke the WS from a servlet after getting the form parameters leave aside 'bean' a mistype
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you need some code to invoke the WS - why not use the code generated by whichever toolkit you're using?
 
karthik mama
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code generated automatically is through SOAP messages and what i need is the code for a servlet where in i can invoke a WS...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic