Skip to Content

Author: Avinash Palavai, SAP Technical Consultant, Atos India Pvt. Ltd.

Introduction:

      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,

/wp-content/uploads/2012/05/1_104863.png

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,

  1. Creation of WebService and
  2. Consuming a WebService in ABAP.

                                                

PART – 1 :-  Creation of WebService in SAP

1. Create an RFC. (Here I took an example of simple addition logic in the RFC).

/wp-content/uploads/2012/05/2_104873.png

2. Create a WebService from the above RFC.

/wp-content/uploads/2012/05/3_104827.png

3. It opens the following WebService creation wizard; enter the Service Definition name description.

/wp-content/uploads/2012/05/4_104843.png

4. Check the check box Map Name.

/wp-content/uploads/2012/05/5_104844.png

5. Select the security profile, which is the authentication method to be followed while consuming the WebService.

/wp-content/uploads/2012/05/6_104845.png

6. Save

/wp-content/uploads/2012/05/7_104849.png

7. Click on complete. Now your WebService will be created.

/wp-content/uploads/2012/05/8_104850.png

8. Below is the service definition created and remember to activate it immediately.

/wp-content/uploads/2012/05/9_104851.png

9. 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.

/wp-content/uploads/2012/05/10_104855.png

10. 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.

/wp-content/uploads/2012/05/11_104856.png

11. Select your webservice and click on apply selection button.

/wp-content/uploads/2012/05/12_104857.png

12. Now the screen will be expanded with the part where the service has to be configured. Click on create under configurations tab.

/wp-content/uploads/2012/05/13_104860.png

13. A pop up will be opened. Enter the following details and click on apply settings ,

/wp-content/uploads/2012/05/14_104861.png

14. 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.

15. The service definition has been configured.

/wp-content/uploads/2012/05/15_104862.png

16. 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

  1. First create a consumer proxy as shown,

          /wp-content/uploads/2012/05/1_104863.png

2. A consumer proxy creation wizard will be opened, select the Service Consumer.

/wp-content/uploads/2012/05/2_104873.png

3. Select the source as External WSDL.

/wp-content/uploads/2012/05/3_104827.png

4. Paste the WSDL URL copied locally in step 16 of part 1.

/wp-content/uploads/2012/05/4_104843.png

5. Save a give some prefix, to your proxy name.

/wp-content/uploads/2012/05/5_104844.png

6. Click on complete.

/wp-content/uploads/2012/05/6_104845.png

7. Service Consumer will be created and remember to activate it immediately.

/wp-content/uploads/2012/05/7_104849.png

8. 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.

/wp-content/uploads/2012/05/8_104850.png

9. The screen will be extended, with a part to create the logical port. Click on create under configuration tab.

/wp-content/uploads/2012/05/10_104855.png

10. 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.

/wp-content/uploads/2012/05/11_104856.png

11. The logical port is created.

/wp-content/uploads/2012/05/12_104857.png

12.Now test the WebService by executing the service consumer from the SAP GUI by clicking on execute.

/wp-content/uploads/2012/05/13_104860.png

13. Enter the logical port created and execute.

/wp-content/uploads/2012/05/14_104861.png

14. Enter the values and execute.

/wp-content/uploads/2012/05/15_104862.png

15. Result will be displayed as,

/wp-content/uploads/2012/05/16_104896.png

16. Now create a program to consume the WebService in ABAP and execute.

/wp-content/uploads/2012/05/f_104889.png

17. Result

     /wp-content/uploads/2012/05/f2_104888.png


To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Martin Maruskin

    Hi Avinash,

     

    I followed your creation of your web service as described in the blog.

    While I test the web service by executing the service consumer from the SAP GUI with logical port created I’m getting following error:

     

    SOAP:1.023 SRT: Processing error in Internet Communication Framework: (“ICF Error when receiving the response: ICM_HTTP_CONNECTION_FAILED”)

     

    I guess there is something wrong as my web service is not using proper RFC connection (type G) to SAP’s backend. However I’m not able to determine which RFC Connection is actually used.

     

    Can you advice what is missing in my configuration?

     

    thanks in advance

    m./

    (0) 

Comments are closed.