• 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

Struts and WebServices

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can Struts integrate with WebServices and SOAP? Can anyone give a brief synopsis of how this is accomplished?
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not Struts specific, but the easiest way I have found to add webservices to any java app is Axis ( http://xml.apache.org/axis/ ).
If you want to act as a web service client - put the call wheveer it belongs (probably in the model oart), if you want to export functionality of your Struts app to a web service, make sure you are well layerd, then add a seperate web service interface to the application (basically alongside struts, using the same model underneath).
-Brian
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frosty One,
We don't have many rules at Javaranch, but our naming policy is one of them. Please read this policy and change your display name to comply with it if you wish to continue posting. Thanks.
You can change your display name here.
 
Author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Brian said, you can access a web service from Struts in the same way you would access any application model -- via the Action. Instead of calling a method that returns a result from a database, you would call a method that returns a result for a web service.
Ideally, you should try and encapsulate your business tier behind a facade. The Action doesn't need to know where the data comes from. It just knows it needs to call this method with these parameters. The Action can then return the result to the view (via the request context).
The Artimus application bundled with Struts in Action makes calls to both a database and the Lucene search engine. But all calls are behind a consistent facade so that the Action doesn't know where the result comes from. This makes it easy to add another persistance device, like a web service.
HTH, Ted.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic