Deploying Web Services via HTTP(S)
The central web service interface allows Technical Processes to be provided as web services via HTTP(S), e.g. for ReSTful web services or SOAP web services. The individual resources of a web services can be addressed from the outside via an HTTP URL (Uniform Resource Locator).
Base URL and functionality
The base URL of the central web service interface is http://<server>/X4/httpstarter/ReST
(e.g. http://localhost:8080/X4/httpstarter/ReST
).
HTTP requests are processed instantly by the central web service interface and handed over as XML document to a process. The result of the process, e.g. a generated document, can be returned instantly.
Configuration
Web services are configured within the X4 Designer using the graphical Webservice Configuration Editor.
Return values
The web service interface returns the current status code (e.g. 201 Created
), and depending on the request, the identified resource.
Supported web service types
- ReSTful web services: Representational State Transfer (ReST) is an architectural style in which any resource of an information system can be addressed under its own URI, e. g. via HTTP. Thus, the target of ReSTful services within the X4 Server is to map path structures of a URI to processes in a transparent and comprehensible way.
For ReSTful web services multiple operations or HTTP methods can be assigned for each resource and linked with a process, e.g. for accesses viaGET
,POST
orDELETE
. The following HTTP methods are supported:
GET
PUT
POST
DELETE
and any other methods with a valid XML name.
When calling a web service, a particular XML data structure is passed to the process by default, see ReSTful Web Services: Input XML Structure. Moreover, the web service interface expects an XML document as result, which is structured according to a defined structure, and provides a number of options.
The transmitted data must be Base64 or Base16 (hexadecimal) encoded, since only bytes are transferred via HTTP. To avoid problems with the interpretation of the content within the element<body>
, text or XML is directly supported here. Therefore, the text/XML document must first be converted to bytes and encoded to Base16/Base64, to have full control of the bytes that are returned as response.For further information regarding the ReST architecture, see the dissertation of Roy T. Fielding at http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm.
- SOAP web services: SOAP is a W3C-standardized message protocol (http://www.w3.org/TR/soap), which enables standardized communication between distributed applications. SOAP web services can be provided in various forms, i. a. with external WSDL definition or without WSDL definition, in RPC style or in document mode. As message format for SOAP web services XML is typically used for Requests and Responses; binary data is optionally attached via MIME (MTOM).
SOAP web services can be provided in the same way as ReSTful services via HTTP(S), see Providing SOAP Web Services.
The service type SOAP supports the standards SOAP 1.1 and SOAP 1.2. SOAP service definitions can be combined with HTTP ReST web service definitions and with file web service definitions. - File web services: The central web service interface also allows static file resources from the repository or documents generated dynamically by processes to be provided as service via HTTP GET, see Providing File Web Services.