• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to call this simple web service in JSP?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

ankur rathi wrote:This blog should help you: http://weblogs.java.net/blog/vivekp/archive/2006/12/webservices_in.html


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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic