Since working with SOAP calls in XML is very tiresome, we have libraries like axis and wsdl2java to generate stubs to make web-service client calls. I generated the stubs using IntelliJ IDEA to make SOAP calls in grails using the steps below.
1. Adding Framework Support
If the IntelliJ project does not already have the framework support, then add it by right clicking on the “ProjectName” project and selecting the “Add Framework Support”. Go to Web services client in left pane and select Apache Axis in the right pane. Also, specify the path where you want necessary files to be downloaded. It will prompt you to download files. Just click “Yes”.
2. Generate Java code from WSDL
Right click the project’s src/java directory, and select “Webservices >> Generate Java code from WSDL”. Now point to the URL and ensure that the “output path” points to “src/java” .
Using the generated stub, we should now be able to invoke web service calls by importing in the necessary classes where ever we want to use them.
No more haggling with XML.. cheers…!!!