Question

I have to call a web service from my web application, and show the response from the web service in my view. Any suggestions?

Thanks in advance

I am using Spring MVC for my web app and Axis2 for the web service.

[EDIT 1] I was Asking about the posibility to do that since It seemed to me preaty strange to use it that way. (The client generates a web app, so I was like "A web app into another")

Was it helpful?

Solution

You need to generate a client (I suppose you use axis2/soap) using the axis2-tools (wsdl2java). Then you can simply instantiate the client in one of your business logic classes and consume the result.

Using wsdl2java can be quite tedious to run, if you have maven, there is a wsdl2java converter plugin.

Also, I suggest you put the wsdl2java in it's own project, as it should not change regularly.

Spring may be handy to configure the axis server URL and inject a client into your code, but is not required to run the axis2 client.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top