Creating a webservice client
The CoG framework will generate code to consume a webservice given a WSDL. To develop a web service client using CoGSole follow thses steps:
0. Open the CoGSole app in a browser window: http://<host>:<port>/webdynpro/dispatcher/local/tc~groovy~grails~wd/CoGSole?j_user=<user>&j_password=<password>
1. Click the webservices tab
2. Enter the WSDL
3. Enter user name and password if the service requires authentication and add "sap-user=USER&sap-password=PASSWORD" to the WSDL
4. Enter the proxy information if the service is outside the firewall
5. Click "Get Sample Code"
6. Sample code to consume the webservice will be generated, for example see the screen shot below:
7. Edit the code so it contains the input and output parameters you require and click "save".
8. Click "Evaluate Groovy Code".
For example, the following code will get a list of customers in Berlin, Germany and print out their names and IDs:
The client code can be integrated into the framewrok, for example see "ProductService.groovy" in the ILR sample application.