Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call this simple web service in JSP?

 
Ryan Stille
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64838
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing directly built into JSP to call SOAP services. I've moved this to the Web Services forum for further discussion.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic