aspose file tools*
The moose likes Struts and the fly likes Struts and WebServices Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and WebServices" Watch "Struts and WebServices" New topic
Author

Struts and WebServices

Frosty One
Greenhorn

Joined: Nov 07, 2002
Posts: 5
Can Struts integrate with WebServices and SOAP? Can anyone give a brief synopsis of how this is accomplished?
Brian McCallister
Greenhorn

Joined: Dec 03, 2002
Posts: 19
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
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
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.


Matthew Phillips
Ted Husted
Author
Ranch Hand

Joined: Dec 02, 2002
Posts: 37
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts and WebServices