Reputation: 4167
Would anyone be able to tell me how I can call a webservice in my struts application?
Upvotes: 2
Views: 3689
Reputation: 3196
Well, I can think of several ways to do this depending on the web service. Most IDEs have ways to auto-generate webservice clients. I would probably create a java library package that which wraps the service client and provides an interface for your Struts application to invoke the client methods from within your Struts action class.
For example, if the service has a method getPerson(), I would create a remote DAO class that invokes the web service getPerson() method:
public class PersonServiceInterface{
public Person getPersonFromService(){
// web service calls to retrieve person object
return person;
}
}
Upvotes: 2