File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes calling wsdl in a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "calling wsdl in a jsp" Watch "calling wsdl in a jsp" New topic

calling wsdl in a jsp

kishani liyanage
Ranch Hand

Joined: Dec 08, 2003
Posts: 40
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- 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

Joined: Jul 13, 2001
Posts: 3150
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.

Spritle Software Blogs
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
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

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: calling wsdl in a jsp
It's not a secret anymore!