Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling wsdl in a jsp

 
kishani liyanage
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem- I want to know how i could run a jsp in a similar fashion
as a java class is run in the command line. (eg:After compiling a java class
you run the class in the command line passing necessary arguments. How can do
the same thing in a jsp and also appending a WSDL URL location)
My Problem lies here........
I run the java program like this,
java samples.client.DynamicInvoker http://localhost:8080/axis/services/calculator?wsdl add 2 6
The name of the java class is- DyanamicInvoker.java(the location where this class resides is - samples/client.)
The location of the wsdl file is - http://localhost:8080/axis/services/CK?wsdl
The method name in the web service is - add
the parameters that pass are - 2 and 6

how do i do the samething using a jsp? Please if anyone could help me with
some guidance i'll be very grateful!

thanx in advance,
rgds Kishani.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Its seems u r using axis, then please read the documentation on how to use WSDL2Java, this will generate you stub classes(client code) to access the methods (say add), later you can use the code from jsp or servlets.
check the axis documentation for furter steps.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kishani, JSP files eventually get compiled into servlets which are, surprise surprise, Java classes. Whatever code you use in a standalone Java program, you can embed into a JSP or servlet. In the case of DynamicInvoker, which is meant to be run with the main() method and prints to System.out, you need to simply grab that class and change these two aspects so that you have a method like
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic