SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Consume SOAP Web Services in SAP Cloud Application Programming Model (CAP)

This tutorial explains how to consume legacy SOAP Web Services in a SAP Cloud Application Programming Model (CAP) backend service application.

Overview

🎓 advanced 15 min. SAP Cloud Application Programming ModelAdvancedNode Js

You will learn

  • โœ”Understand the business problem
  • โœ”Understand the application architecture
  • โœ”How to get prepared for development
  • โœ”How to get the web service definition (WSDL)
  • โœ”How to create the web service reference
  • โœ”How to use the destination and XSUAA services to point to the service host
  • โœ”How to use additional node modules to create the SOAP client and perform the web service calls
  • โœ”How to develop a reusable module to create SOAP clients
  • โœ”How to develop the CAP service code to achieve the application’s objective
Unknown U Unknown November 1, 2022
Created by September 28, 2022
Contributors

Prerequisites

Prerequisites

  • Get an SAP Business Technology Platform trial account following this tutorial
  • Setup SAP Business Application Studio in your trial account following this tutorial
  • Have access to an SAP S/4HANA Cloud tenant with a communication user with access to communication scenario SAP_COM_0193 or SAP_COM_0093, via some communication arrangement (unfortunately S/4HANA Cloud trial tenants do not provide it, so make sure you’re granted such access by other means)

Steps

Intro

IMPORTANT NOTE: this tutorial is intended for developers who have previous experience in developing CAP applications which consume either OData or REST APIs using SAP Business Application Studio and SAP BTP destinations, as well as handling communication scenarios and communication arrangements in S/4HANA Cloud.


Step 1 Unserstand the business problem
โ€”

You may have realized that most modern cloud applications are built to interact with other external solutions via OData and/or REST APIs (and you may have already done it yourself in several opportunities). But, there are some solutions that still do not offer 100% of services as OData or REST, providing some interfaces via SOAP web services โ€“ this is the case, for example, of S/4HANA Cloud which exposes a variety of OData services but, for same cases, still sticks with SOAP web services.

If you started programming in the last 5 years, you might not even know what I’m talking about โ€“ or if you know, it’s the fault of some legacy system you have to deal with.

SOAP, or Simple Object Access Protocol (not to be confused with SOA), is a protocol for creating distributed and decentralized web services โ€“ the famous web services โ€“ which allow the exchange of information between systems, using the XML format. The latest version is from 2007 (1.2) and was the most popular way of connecting systems in the first decade of the 2000s, before the emergence of the REST protocol that encouraged web APIs with JSON and, later, microservices โ€“ lighter ways to exchange information between systems over the web.

As previously mentioned almost all the latest web and mobile technologies offer native (or close to) support for handling REST Web APIs, but little is said about SOAP connections. The purpose of this tutorial is precisely to help those who need to deal with Node.js CAP applications on the client and SOAP on the server.

Step 2 Understand the application architecture
+
Step 3 Get prepared for development
+
Step 4 Download the web service definition
+
Step 5 Create the reference to the web service host
+
Step 6 Bind the destination and XSUAA services
+
Step 7 Install dependencies
+
Step 8 Create a module to handle SOAP clients
+
Step 9 Create a handler to read business users
+
Step 10 Create the CAP service definition
+
Step 11 Attach the handler function to the READ event
+
Step 12 Test the application
+
Step 13 Check your knowledge
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 13
1. Unserstand the business problem 2. Understand the application architecture 3. Get prepared for development 4. Download the web service definition 5. Create the reference to the web service host 6. Bind the destination and XSUAA services 7. Install dependencies 8. Create a module to handle SOAP clients 9. Create a handler to read business users 10. Create the CAP service definition 11. Attach the handler function to the READ event 12. Test the application 13. Check your knowledge

Learn more →