Loading…
Loading…
Configure backend endpoint URLs, authentication, timeouts, retries, and failover for services. Supports SOAP and REST backends with multiple auth types.
A backend profile defines the connection and authentication details for the upstream service that the runtime calls after converting a request. Every service requires a backend profile.
The role of the backend depends on the service direction:
Backend profiles are managed under Services → your service → Backend. When you create a service from a WSDL, the platform infers an initial endpoint and SOAP version from the WSDL's soap:address and binding information, which you must then confirm and complete.
When the runtime processes an incoming request for a service, it consults the service's backend profile to determine how to proxy the converted call. The profile dictates the target endpoint URL, authentication credentials, transport settings, and failure handling policies like timeouts and retries.
For services with multiple backends configured, the runtime uses health checks and a defined failover order to ensure high availability.
The following diagram illustrates the request flow for a service with a primary and a failover backend:
flowchart TD
subgraph "Request Flow"
direction TD
A[API Consumer] --> B{S2R Runtime};
B -- "Sends request to" --> C[Primary Backend];
C -- "Fails or is unhealthy" --> B;
B -- "Fails over to" --> D[Secondary Backend];
D -- "Returns response" --> B;
B -- "Returns response to" --> A;
endThese settings define the fundamental connection parameters for a backend. The default timeout and retry values are inherited from system-wide settings but can be overridden for each operation.
| Setting | Type | Default | Description |
|---|---|---|---|
| Endpoint URL | String | — | The address of the backend service. This is inferred from the soap:address in the WSDL during import but can be edited. |
| SOAP version | String | — | The SOAP version to use (SOAP 1.1 or SOAP 1.2). This is detected from the WSDL binding on import. Since v1.0, the runtime can also auto-detect the version from the request body and Content-Type header. |
| Transport settings | Object | — | Defines backend-specific SOAP transport details, such as Content-Type and SOAPAction handling. |
| Timeout | Integer | 100 | The request timeout in milliseconds for each operation. |
| Retries | Integer | 2 | The number of retries to attempt for each operation upon failure. |
WARNING
Increase the default Timeout value with caution. Slow backends can degrade overall system performance, especially when combined with retries.
Since v1.0, the platform supports several authentication types for securing connections to the backend service. Mutual TLS (mTLS) can be enabled in conjunction with any other authentication type.
| Auth Type | Description |
|---|---|
none | Connects to the backend without authentication. Suitable for backends within a trusted network segment. |
basic | Authenticates using HTTP Basic authentication (username and password). |
bearer | Authenticates using a static or externally-provisioned bearer token in the Authorization header. |
oauth2_client_credentials | Authenticates using the OAuth 2.0 Client Credentials grant flow. The runtime automatically requests and caches the access token. |
api_key_header | Authenticates by passing a static API key in a specified HTTP header. |
| mTLS | Enables mutual TLS by presenting a client certificate. This is configured by setting mtls_enabled=true and can be combined with any of the types above. |
All backend credentials, such as passwords and tokens, are encrypted at rest using pgcrypto. The encryption key is a critical secret configured at deployment time.
IMPORTANT
Credentials are never logged or returned in plaintext in any API response. To verify your configuration, use the test connection action available in the UI. This action validates the endpoint and authentication settings without exposing sensitive values. A successful connection test is a prerequisite for publishing a service.
Since v1.0, a service can be configured with more than one backend to improve reliability and support complex routing scenarios. This is configured under Services → your service → Backend.
Key capabilities include:
The default timeout of 100ms and 2 retries are optimized for fast, low-latency backends. If a specific backend operation is known to be slow, you can override these defaults on a per-operation basis. Be aware that failure behavior is bounded; retries do not execute indefinitely.
The runtime rejects synchronous requests with payloads larger than 30 MB. If a request exceeds this limit, the client will receive an HTTP 413 Payload Too Large response with the error code S2R-RUN-0413.
The backend configuration, including authentication and timeout settings, is validated by the "SOAP test" during the publishing process. If the runtime cannot successfully connect to the backend using the provided profile, the test will fail, and the service cannot be published. Correct the backend configuration and re-run the test to proceed.
upstream-failure-status to control the HTTP status code returned on backend failure)