In addition to the browser-based back office and storefront interfaces, Intershop provides access to resources and functionality using web services.
Web services can be accessed by other software systems using URLs. Web services enable you to automatically exchange data between two remote software components without any user interaction.
Using web services, developers can make well-defined business processes or data accessible to any internal or external web service client. Organizations can communicate data without knowledge of each other's IT-systems behind the firewall. For example, one company can call another service to calculate the shipping costs for a package of a certain weight or size.
This enhances the modularity of the system, and enables re-use of functionality.This document gives an overview about the main web service architectures supported and discusses their usage scenarios.
Term | Description |
---|---|
REST | Representational State Transfer |
SOAP | Simple Object Access Protocol |
WSDL | Web Service Description Language |
JSON | JavaScript Object Notation |
Detailed documents for the different web service architectures can be found here:
Historically, the term Web Service was mostly used for SOAP web services. SOAP web services have been used to integrate different systems using standardized XML messages over the last decade.
SOAP web services are a form of Remote Procedure Calls and thus method-oriented. Clients call methods provided by a web service (e.g., a payment web service) and receive the result of the call. Both, the server and the client usually use special classes generated from the web service description file (WSDL-file) or implemented manually. The messages consist of complex XML describing the method, its parameters, and its return values.
Over the last years, web services following the REST design pattern have gained popularity. In contrast to SOAP web services, they don't require specialized clients but can be consumed by almost any client that can handle HTTP. REST web services are resource-oriented. They provide access to - more or less complex - resources on the server using the standard methods defined in the HTTP protocol ( POST
to create, PUT
to update/store, GET
to retrieve, DELETE
, and OPTIONS
). They return a representation of the accessed resource, usually in a simple format like JSON or plain XML. Resources can be retrieved, created, updated, and deleted (depending on the actual resource implementation).
REST services operate on a stateless server, meaning for example that no server-side session is retained across multiple requests. While this is good for data retrieval and manipulation, it makes modelling complex sequential processes harder.
SOAP Web Services | REST Web Services | |
---|---|---|
Basic mechanism | Remote procedure calls | Resource access |
Accessed object | Web service providing methods | Resource providing data |
Server-code | Complex, but can be generated | Simple |
Client-code | Complex, but can be generated | Simple |
Accessibility | bad | good (if necessary, by any HTTP client such as browsers) |
Contracts | strict | loose |
Coupling | tight | loose |
Versioning | mandatory | discouraged |
Performance | average | good |
Because of their different design and characteristics, both mechanisms have specific usage scenarios.
SOAP web services are hosted on a server and offer the client a number of predefined functions. To use a web service, the client must register with the server, call the requested function, and pass on the necessary parameters. After that, a web service provides the client with the requested XML data. This data can then be used in the client application as if the function had been executed locally.
Intershop 7 provides a complete infrastructure and various tools to both use web services as a client in Intershop 7 and to publish business processes as web services for other applications to use. For example, a pipeline can be published as web service, with the same pipeline integrating other web services to solve particular business tasks.
Publishing Pipelines as Web Services
Requests to the web service from a client application then automatically trigger the execution of the pipeline. Web service pipelines can be selected and published using the Intershop Studio without writing code.
Calling External Web Services
Apart from providing web services, Intershop 7 applications can easily integrate calls to external web services. The necessary stubs and helper classes to call web services from pipelets and pipelines can be generated using the Intershop Studio.
REST web services are hosted on a server and offer the client a number of predefined resources. To interact with a resource, the client can access the resource via its URI using standard HTTP methods, headers, and parameters. Subsequently, the server returns the requested data in the requested format (usually, JSON or XML). Finally, the client application can use the data.
Intershop 7 provides a REST framework that makes it easy to design and extend REST APIs. Resources are created in Java and can be registered to any IS7 application (Backoffice, SMC, Storefront etc.) using the Component Framework. The Component Framework provides base and helper classes to quickly start developing REST resources.
Intershop 7 includes several REST APIs, including the customer-facing B2C WebShop REST API. For details, see the Overview - Intershop Commerce Management REST API.