The SAP Business One Service Layer is a REST based API that allows for consuming SAP Business One data and services. Built on HTTP and OData, it provides a uniform way to expose business objects. As a REST based service, it allows developers to develop applications in any programming language such as ASP, JAVA or PHP.
The service layer is an application server built on the Apache web server and can be configured in one of two ways.
In this mode, the Service Layer is installed on the same server as SAP HANA. This mode keeps the landscape simple but consumes the same resources.
In a distributed mode, the Service Layer is installed on separate machines, which provides it with more computing power.
The Service Layer is based on a 3-tier architecture. The client communicates with the Web server using HTTP requests and the Web server communicates with the database to perform CRUD operations.
When an HTTP request is made to the Web server, the request is parsed using the OData parser. The business object(s) representing the request is loaded. The OData parser examines the HTTP method (GET/POST/PATCH/DELETE) and translates them to a callable method on the respective object(s). The data format for the HTTP request and response is in JSON.
Behind the scene, the Service Layer uses the DI API as the interface to access SAP Business One objects and services. If you have DI API experience, you will find using the Service Layer quite similar.
In the next article PHP Service Layer Example Part 1
, I explain how to connect to the Service Layer using PHP.