File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

calling wsdl in a jsp

kishani liyanage
Ranch Hand

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

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


Spritle Software Blogs
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
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: http://aspose.com/file-tools
 
subject: calling wsdl in a jsp
 
Similar Threads
Unable to test webservice using a client
Axis question
Can't see the WSDL file
Axis question
Using a tomcat-based web service in .NET