aspose file tools*
The moose likes Web Services and the fly likes How to call this simple web service in JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to call this simple web service in JSP?" Watch "How to call this simple web service in JSP?" New topic
Author

How to call this simple web service in JSP?

Ryan Stille
Greenhorn

Joined: Aug 09, 2008
Posts: 10
I haven't written a line of JSP, but I would like to test out, in various languages, a web service I just created. I'm mainly trying to see the differences between returning a native ColdFusion structure vs a ColdFusion component.

Can someone give me a couple of lines of JSP that mimic what I've done here in PHP?



Thanks for any help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

There is nothing directly built into JSP to call SOAP services. I've moved this to the Web Services forum for further discussion.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
It's not a good idea to write "business logic" in JSP.

You better think of layering architecture: JSP - view, Servlet - controller (for navigation), POJO - model (for business logic). In your case, you consume web service in POJO.

This blog should help you: http://weblogs.java.net/blog/vivekp/archive/2006/12/webservices_in.html
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Ryan Smith wrote:I haven't written a line of JSP, but I would like to test out, in various languages, a web service I just created.

Using a JSP just complicates matters - for testing purposes a simple command line program should do the trick. Also the Java code needed depends on the WSDL-to-Code generation tool that is being used.


JAX-WS will only work if the web service provider uses the rpc/literal or document/literal messaging mode.
Which style of WSDL should I use?

Other JAX-WS examples (which include client generation):
StockQuote
Xslt2Xml
GeoIP
BookSearch

If the web service provider uses the rpc/encoded messaging mode then you have to use something like Axis 1.x.
Creating Web Services with Apache Axis: 3. WSDL2Java: Generate the Server-side Wrapper Code and Stubs For Easy Client Access


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call this simple web service in JSP?
 
Similar Threads
Learning web services - Argument values disappear when reaching server.
Consume a .NET kerberized web service
Web Service doesn't read my parameter
Problems with Spring Security and JSF2
Can not Populate the form on combo box change