This article demonstrates the entire process of creation and consuming of a WebService in SAP ABAP.
There are few changes made by SAP in the screens of transactions like SOAMANAGER, that we see in the process of configuring the WebService definition and the transaction LPCONFIG, which is used to create the logical port in the process of consuming the WebService is obsolete.
Now we come across this information message, when we run the transaction LPCONFIG,
So, this article helps out in following the new SAP screens and an alternative process of creating the logical port, rather than using the transaction LPCONFIG.
The entire article is divided into two parts,
- Creation of WebService and
- Consuming a WebService in ABAP.
PART – 1 :- Creation of WebService in SAP
- Create an RFC. (Here I took an example of simple addition logic in the RFC).
- Create a WebService from the above RFC.
- It opens the following WebService creation wizard; enter the Service Definition name description.
- Check the check box Map Name.
- Select the security profile, which is the authentication method to be followed while consuming the WebService.
- Click on complete. Now your WebService will be created.
- Below is the service definition created and remember to activate it immediately.
- Now this WebService has to be configured in SOA Management, to publish it.Run the transaction “SOAMANAGER”, which would launch a Web Dynpro ABAP based SOA Management application in your Internet Browser.
- Below is the SOA Management window. This screen has been modified by SAP. Now click on the WebService configuration link highlighted in orange color under the Service Administration tab.
- Select your webservice and click on apply selection button.
- Now the screen will be expanded with the part where the service has to be configured. Click on create under configurations tab.
- A pop up will be opened. Enter the following details and click on apply settings,
- Now the screen will be extended with the part, where the authentication method has to be selected. Select User ID/Password under transport channel authentication and click on save.
- The service definition has been configured.
- Under the overview tab, click on “Show/ hide selected binding’s or services WSDL URL”, which would generate the WSDL link. Copy it locally.
PART –2 :- Consuming a WebService in ABAP
- First create a consumer proxy as shown,
- A consumer proxy creation wizard will be opened, select the Service Consumer.
- Select the source as External WSDL.
- Paste the WSDL URL copied locally in step 16 of part
- Save a give some prefix, to your proxy name.
- Click on complete.
- Service Consumer will be created and remember to activate it immediately.
- Now the logical port has to be created. As the transaction LPCONFIG is obsolete, this can be done through the SOAMANAGER. Again run the SOAMANAGER and select the consumer proxy.
- The screen will be extended, with a part to create the logical port. Click on create under configuration tab.
- It will open a pop up to enter the logical port name and settings as follows. Under the WSDL location, enter the WSDL URL of the WebService to be consumed and the authentication credentials.
- The logical port is created.
- Now test the service consumer from the SAP GUI by clicking on execute.
- Enter the logical port created and execute.
- Enter the values and execute.
- Result will be displayed as,
- Now create a program to consume the WebService in ABAP and execute.