Introducing ABAP Web Services

Objective

After completing this lesson, you will be able to Introducing ABAP Web Services.

What is a Web Service?

Business processes are divided into a certain number of process steps. You can assign one or more functions to each of these steps and an executing software component to each of these functions. If you look at a typical heterogeneous system landscape in an organization, it is quickly apparent that the necessary functions in a business process are not all implemented using the same technology and the same components. In particular, the integration of an ever increasing number of business partners further complicates this problem. A modern software infrastructure must therefore be capable of integrating functions that are implemented on very different software components into an efficient global process.

Internet technology already provides the basis for communicating with distributed services. Superimposed onto this simple, globally accepted communication standard, XML (eXtensible Markup Language) provides the basis for defining additional necessary standards. Only when we move away from proprietary definitions and toward generally accepted standards can there can be any guarantee of smoothly integrating all the functions and partners involved in the process. The result is web services.

Web Service Definition

A web service is an independent, modular, self-describing application function or service. Based on XML standards, this application function can be described, made available, located or called using standard internet protocols. Each web service therefore encapsulates a piece of functionality that can be used, for example, to forward a price query to a provider, check the availability of an item in an enterprise resource planning system, locate a telephone number, or even to run credit card checks, convert currencies, or implement payroll functionality.

Web Services:

  • Are application functions / services.
  • Can be used via internet standards.
  • Are self-descriptive.
  • Can be published and traced.

Technical Implementation SOAP via HTTP

The definition of a web service according to W3C.org leaves the technical implementation completely open. Neither message nor application protocol are defined. They only have to comply with applicable internet standards.

For example, an XML in a mail would be a valid implementation of the web service definition just like a SOAP message over HTTP. In practice, SOAP (Simple Object Access Protocol) has established itself as the message protocol and HTTP as the application protocol.

Differentiation to the Representational State Transfer Protocol (REST)

SOAP via HTTP was a System2System communication, a further programming paradigm has emerged as an alternative web service implementation with the widespread use of alternative devices such as tablets, etc. REST (Representational State Transfer). REST is a programming paradigm for web applications. There is no explicit norm, therefore the ideas of what REST is diverge. Basically, REST refers to the idea that a URL represents exactly one page content (resource) as the result of a server-side action (such as displaying a hit list after a search). The internet standard HTTP for static content (permalinks) already provides this. For dynamically generated pages, however, this sometimes requires additional effort.

In contrast to the classic web service, where SOAP is used as the message protocol, REST uses different message protocols:

JSON (JavaScript Object Notation)
Is a lightweight data-interchange format.
YAML (YAML Ain't Markup Language)
Is a human-readable data-serialization language.
XML (eXtensible Markup Language)
Is a method to store structured data in text format.
HTML (Hyper Text Markup Language)
Is the standard markup language for documents designed to be displayed in a web browser.

SAP mainly uses REST to access business data via mobile devices, such as tablets, etc.

Web Service Paradigm

The figure illustrates the most important web services and internet standards and how they interact.

Service Provider

A service provider provides access to a service. If a service is a web service, the service provider has a corresponding XML-based description that is a Web Services Description Language (WSDL) document. Any programming language can be used to implement the web service.

Based on HTTP, Simple Object Access Protocol (SOAP) is now established as the quasi-standard access protocol. In a client/server relationship, the service provider can be regarded as the server.

When publishing a service, the service provider transmits information about itself and a description of the service it offers to the Service Registry (SR). A Service Registry is a type of yellow pages for web services. An SR provides, among other things, information about calling the web service. The Service Registry therefore provides only a description of the web service. This description forms an abstraction layer, independent of the corresponding implementation. The web service itself is hosted by the service provider.

Service Requester

A web service user is referred to as a service requester. A service requester can, for example, be someone who locates a web service using a web browser and then uses the service. In most cases, however, the service requester is an application that accesses the web service. The application can also bind to the service dynamically if required, that is, the application can dynamically create a web service client proxy at runtime and use this proxy to access the web service. The application obtains the necessary information for accessing the web service from the service description.

This information is then stored in the SR. However, if the application knows the provider and the call details, it can use the web service without having to access the SR. In a client/server relationship, the service requester is the application client.

Web Service Standards

Web services can exist in any implementation. Therefore, a standardized description is required if web services are to be called from any application. The WSDL best meets this demand. However, a web services description in WSDL alone is not sufficient. To find the right business partner and corresponding service quotation, you need a company registry to help you to find the required service.

The web service provider must also be able to make its offer publicly available as easily as possible. The Universal Description, Discovery and Integration (UDDI) offers a solution.

For more information, see http://uddi.xml.org.

UDDI Registry (Universal Description, Discovery and Integration)

With its UDDI Registry and UDDI specification, UDDI provides the necessary tools for making services public. The specification provides a detailed description of how to locate and register services. The UDDI Registry contains a list of registered web services in WSDL format. The UDDI Registry does not store documents or specifications, but only references them.

SOAP (Simple Object Access Protocol)

To call web services based on internet technologies, a suitable protocol definition is needed. SOAP has created a simple standard that allows web services to be accessed in decentralized, distributed landscapes. SOAP specifies a package of XML documents for transport via internet protocols such HTTP(S), SMTP, or FTP. SOAP defines a so-called envelope. In this envelope, you will find the actual XML-based message with a header and a body, as well as further information about how the message should be processed.

WSDL (Web Service Description Language)

WSDL is an XML-based description language for web services. The WSDL Service Definition includes the description of distributed systems and provides instructions for automating data exchange between applications. The WSDL is used to describe web services or electronic services in XML format. A service is defined as a collection of endpoints (ports) and the messages they work with. By using WSDL, a service provider can describe the requirements and features of their web service so that a potential customer understands them and interacts properly with the service.

Call a Web Service With a Test Tool

Log in to track your progress & complete quizzes