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
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: 61206
    
  66

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: 2922
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call this simple web service in JSP?