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
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.
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.
<a href="http://husted.com/struts/book.html" target="_blank" rel="nofollow">Struts in Action</a>