cancel
Showing results for 
Search instead for 
Did you mean: 

How to call local SOAP API in BTP ABAP environment?

MattDion
Participant
0 Kudos

In my BTP ABAP environment, I want to consume an SAP provided SOAP API (this one: https://api.sap.com/api/AC_MANAGEBUSINESSUSERIN/overview) and then call it from a class in the same ABAP environment.

I followed this tutorial: https://developers.sap.com/tutorials/abap-environment-soap-web-services.html

And this works well. However, the destination was created using the method:

DATA(lo_dest) = cl_soap_destination_provider=>create_by_url( lc_url ).
lo_dest->set_basic_authentication( i_user = lc_user i_password = lc_password ).

The issue here is that I need to specify both the URL of my ABAP environment as well as a hard coded user ID and password. This is fine for my testing, but as SAP points out it is not recommended for productive use.

I've been trying to create a destination through one of the other two methods:

DATA(lo_dest) = cl_soap_destination_provider=>create_by_comm_arrangement( comm_scenario  = lc_comm_scenario
									  service_id     = lc_service_id
									  comm_system_id = lc_comm_system_id ).

DATA(lo_dest) = cl_soap_destination_provider=>create_by_cloud_destination( i_name = lc_cloud_dest ).

But I haven't had much luck. Does anyone have any pointers on how to locally call this SOAP API?

Accepted Solutions (1)

Accepted Solutions (1)

kaidehmann
Advisor
Advisor

Hi Matt,

using cl_soap_destination_provider=>create_by_comm_arrangement is the preferred approach to create a destination for SOAP service service call.

As developer you need to maintain

  • outbound service
  • communication scenario

As administrator you need to maintain

  • communication user
  • communication system
  • communication arrangement

Did you check the Developing External Service Consumption (Outbound Communication) documentation?

Additionally, you may have a look at my Authenticating at Internet-Facing Services via Outbound Communication User blog. Maybe this helps.

Best regards
Kai

P.S: When maintaining the scenario, you can specify that there can be one arrangement per client. In that case, you do not need to specify the communication system when calling cl_soap_destination_provider=>create_by_comm_arrangement.

MattDion
Participant
0 Kudos

Hi kai.dehmann,

Many thanks! I was able to get it working. My issue was that I was thinking about the SOAP service as an inbound scenario. As I pondered your reply and went through the steps of creating the outbound service and an associated communication scenario everything lined up properly in my head.

Best Regards,

Matt

Answers (1)

Answers (1)

andrefischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is also a tutorial avaiable that describes how to use the SAP IDP for that

Provision Users into your SAP BTP ABAP Environment | SAP Tutorials