Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to call this simple web service in JSP?

 
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.
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
Ranch Hand
Posts: 3851
  • 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
 
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.

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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic