Consuming a web service in ABAP
Consuming a web service in ABAP
ABAP
July 21, 2017
Let’s start:
In this exercise, we will look at how we can consume a web service using a client proxy
using ABAP.
3. Creation of Valid SOAP messages and evaluation of received responses is taken care by
the proxy.
So a developer can concentrate on the Business Application without bothering about the
Step 1: To start the Service Wizard again, from SE80 right click and choose Create-
>Enterprise Service.
Step 2 : This time in the Object Type step of the Service Wizard, choose Service
Consumer.
For the source of the Service Consumer, you can choose between the Enterprise Service
Repository, a URL to a WSDL or the local file location of a WSDL, a UDDI, and the
Step 4: Enter the URL of WSDL file which we had created in an earlier exercise.
http://sapignite.com/create-a-web-service-in-10-minutes/
Fill in the necessary details in the wizard.
On the final step, you can press Complete to start the Proxy object generation.
You will be promoted for your logon User name and Password.
The generated proxy class is now displayed. Click on save and activate.
Go back to transaction SOAMANAGER and in order to setup a Logical Port for our new
Service Provider.
shown below.
A consumer proxy never stores any details regarding the URl server which are specific
to one system.
Go back to transaction SOAMANAGER and in order to setup a Logical Port for our new
Service Provider.
We will navigate to the same location as the last exercise – the Service
Administration tab and then click the link named Single Service Administration.
This time when you search in the Web Service Administration, choose to Search
by Consumer Proxy. Don’t forget to press the Apply Selection button after highlighting
your proxy.
From the Popup screen that is generated, you will have to fill in several parameters.
First you will need to name your logical port and set it as the Default. Next we need to
use WSDL Based Configuration. This way the application will read all the necessary
security settings for calling this service directly from the WSDL definition. Finally, you
will again need to supply the WSDL URL for the services you are call (hopefully you still
left that browser window open). You also must supply your system User name and
here you can further define the settings for this logical port. For now, we need to embed
user credentials for calling this Enterprise Service. So once again input your User name
You can now return to the ABAP workbench in the package ZPROXIES and the
Switch to the XML Editor and replace the number value with 16. You can go ahead and
Drag and Drop the proxy class ZCO_ZWS_SQRT and you get the template for
REPORT zpw_webservice.
Obviously, it’s not the best kind of report to build, but I hope the basics fundamentals