This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Webservices  RSS feed

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I tried to create a webservice using eclipse IDE.Since it shows some error on publishing the service to tomcat i did it with command .So now when im taking http: //localhost:8080/axis/servlet/AxisServlet
My service is listed there.

http://localhost:8080/axis/services/fibonacci shows there is a webservice availabe.
Can any one guide me how can i access my services from a jsp form.
How to create one and where to deploy that jsp form in the axis runtime inorder to access the services.

Thanks and Regards
Anuja K.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article and this one have examples of web service clients which you can adapt. (The first one even has a Fibonacci-calculating example.)

It's not considered good design to embed WS accesses in JSP pages, though - a servlet would be more appropriate. And of course the JSP or servlet does not need to run inside the Axis web app - any web app will do.
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any one tell me how can i access an already published webservice by some provider,

Regards
Anuja K
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
I gone to the site following the link you provided .But what i don't understand is after creating the client how can i access it?

its given in the link
Client: Write a Client That Uses the Generated Stubs to Easily Access the Web Service

package fibonacci;

public class FibonacciTester {
public static void main(String [] args) throws Exception {
// Make a service
fibonacci.ws.FibonacciService service =
new fibonacci.ws.FibonacciServiceLocator();


// Now use the service to get a stub to the service
fibonacci.ws.Fibonacci fib = service.getFibonacci();

// Make the actual call
System.out.println("Fibonacci(10) = " +
fib.calculateFibonacci(10));
}
}

how we can invoke the main() method of the FibonacciTeseter class.
May be this sound too silly but im really confused.

Thanks & Regards,
Anuja K.
 
Ulf Dittmer
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main method is called when you run the program from the command line like:

java -classpath ... fibonacci.FibonacciTester

If the code is not part of an application (e.g. in a servlet), you can just move the 3 lines accessing the web service whereever you like.

I would advise to use a command-line client to access your web service while you are developing it.
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
I could run it using commandline client but How can we access it through browser?


Thanks ,
Anuja K.
 
Ulf Dittmer
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to access it directly from the browser, you have to use the JavaScript XmlHttpRequest object. See some documentation here and here.

If you're talking about a web page that accesses the service, put the code in a servlet, as suggested earlier.
[ November 03, 2005: Message edited by: Ulf Dittmer ]
 
anuja Edathu
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ulf,
Anuja K.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!