Loading…
Loading…
Execute tests against backend SOAP services to validate connectivity, authentication, and request/response transformations. Run individual or bulk tests.
The Backend Application Test Service provides a mechanism for API publishers to test and validate integrations with backend SOAP services. It allows for executing test runs against a configured backend profile to verify connectivity, authentication, payload transformations, and overall message processing before exposing an operation to API consumers.
This service is an administrative tool designed to be used during the configuration and maintenance of a backend integration. It operates by taking a saved backend profile and an operation, applying any temporary "preview" overrides, constructing a SOAP request, invoking the backend, and then processing the SOAP response.
The primary functions include:
The output of a test is a detailed report including the status, latency, previews of the REST and SOAP payloads, and any errors encountered during the process.
The service orchestrates a multi-step process to simulate a call to a backend SOAP service and translate the result back into a REST-like format. The runApplicationTest method is the core of this process.
sequenceDiagram
participant Admin as Admin API
participant TestService as Backend Application Test Service
participant SOAPBackend as SOAP Backend
Admin->>TestService: runApplicationTest(...)
TestService->>TestService: Load saved profile & operation
TestService->>TestService: Merge preview settings
Note right of TestService: Applies temporary overrides for<br/>backend profile, operation,<br/>and transformation rules.
TestService->>TestService: Build SOAP request payload
TestService->>TestService: Resolve authentication credentials
TestService->>SOAPBackend: Invoke SOAP endpoint (HTTP POST)
SOAPBackend-->>TestService: Return SOAP Response (HTTP)
TestService->>TestService: Parse SOAP response
Note right of TestService: Checks for SOAP faults and<br/>extracts attachments.
TestService->>TestService: Apply response transformations
TestService->>TestService: (Optional) Save test preview to database
TestService-->>Admin: Return detailed test resultThe process consists of the following steps:
BackendProfileRecord and OperationRecord from the database using the provided profileId and operationId.previewBackendProfile, previewOperation), the service merges them with the loaded records. This allows for testing configuration changes without saving them permanently.requestFormat (json, xml, or soap-envelope).json format, it can apply request transformation rules to the input payload.authType in the backend profile, it resolves the necessary credentials (e.g., Basic, Bearer) and prepares the Authorization header.
WARNING
To prevent credential leakage, the service enforces a strict security guard. Saved backend credentials will only be sent to the saved target endpoint URL and Host header. If a test preview specifies a different target, the test will fail. To test a new target with credentials, you must first save the backend profile with the new target and re-enter the credentials.
endpointUrl. It configures mTLS if required by the profile.retryCount, retryBackoffMs) from the backend profile.base64Binary) and generates a special preview containing metadata and a truncated, Base64-encoded sample of the data.s2r_backend_test_preview table.The service exposes several public methods for testing and managing backend integrations.
runApplicationTestExecutes a single test run for a specific operation. This is the primary method for on-demand testing and debugging.
| Name | Type | Required | Description |
|---|---|---|---|
profileId | UUID | Yes | The ID of the BackendProfileRecord to test against. |
operationId | UUID | Yes | The ID of the OperationRecord to test. |
requestFormat | String | No | The format of the requestBody. Supported values: json (default), xml, soap-envelope. |
requestBody | String | No | The request payload to send. If null, an empty body is used. |
savePreview | boolean | Yes | If true, a record of the test run is saved to the database. |
previewBackendProfile | BackendProfilePreview | No | A set of temporary backend profile settings to override the saved profile for this test run. |
previewOperation | OperationPreview | No | A set of temporary operation settings to override the saved operation for this test run. |
previewValidationRules | List<FieldRuleOverride> | No | A list of temporary validation rule overrides to apply to the contract schema. |
previewRequestTransformRules | List<OperationTransformRuleRecord> | No | A list of temporary rules to transform the request payload before it's converted to SOAP. |
previewResponseTransformRules | List<OperationTransformRuleRecord> | No | A list of temporary rules to transform the response payload after it's parsed from SOAP. |
actor | String | No | An identifier for the user or system initiating the test. Defaults to system. |
testType | String | No | A string to categorize the test type. application-generated is used for bulk tests. |
A Map<String, Object> containing a detailed report of the test execution. Key fields include:
overallStatus: ok or failed.previewId: The UUID of the saved test preview, if savePreview was true.soapRequestPreview: A trimmed preview of the generated SOAP request envelope.soapResponsePreview: A trimmed preview of the received SOAP response envelope.restResponsePreview: A map representing the final REST-like response after all transformations.backendHttpStatus: The HTTP status code from the backend.backendLatencyMs: The round-trip time to the backend in milliseconds.failureReason: A description of the error if the test failed.runGeneratedSampleTestsExecutes tests for multiple operations within a service version using automatically generated request payloads based on the operation's contract schema.
This is useful for regression testing an entire backend integration. By default, operations with mutating HTTP methods (POST, PUT, PATCH, DELETE) are skipped to prevent unintended side effects during bulk runs.
| Name | Type | Required | Description |
|---|---|---|---|
profileId | UUID | Yes | The ID of the BackendProfileRecord. |
versionId | UUID | Yes (if operationId is null) | The ID of the service version containing the operations to test. |
operationId | UUID | No | If provided, only this specific operation will be tested. If null, all operations in versionId are tested. |
sampleFlavor | String | No | The type of sample to generate. minimal (default) or rich. |
sampleOverrides | Map<String, Object> | No | A map of JSON path to value, to override fields in all generated samples. |
sampleOverridesByOperation | Map<String, Map<String, Object>> | No | A map of operation ID to an override map, for operation-specific overrides. |
savePreview | boolean | Yes | If true, a record is saved for each individual test run. |
preview... | various | No | The same preview objects as runApplicationTest, with ByOperation variants to apply them to specific operations. |
includeMutating | boolean | Yes | If true, tests will be run for operations with POST, PUT, PATCH, or DELETE methods. |
actor | String | No | An identifier for the user or system initiating the test. |
A Map<String, Object> containing a summary of the bulk run, including counts for successfulCount, failedCount, skippedCount, and a results list with the detailed report for each operation tested.
prepareSyntheticMonitorGenerates a PreparedSyntheticMonitor object containing all the necessary information to configure an external synthetic monitoring job for an operation. This method does not execute a test.
| Name | Type | Required | Description |
|---|---|---|---|
profileId | UUID | Yes | The ID of the BackendProfileRecord. |
operationId | UUID | Yes | The ID of the OperationRecord to monitor. |
sampleFlavor | String | No | The type of sample to generate for the monitor's request body. minimal (default) or rich. |
sampleOverrides | Map<String, Object> | No | A map of JSON path to value, to override fields in the generated sample. |
preview... | various | No | The same preview objects as runApplicationTest to model the monitor's configuration. |
A PreparedSyntheticMonitor object containing the generated SOAP request template, endpoint URL, authentication details, and other parameters required by the monitoring service.
recentPreviewsRetrieves a list of the most recent test previews saved for a given backend profile.
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
profileId | UUID | Yes | — | The ID of the BackendProfileRecord. |
limit | int | No | — | The maximum number of previews to return. The value is capped at 100. |
A List<Map<String, Object>> where each map represents a saved test preview record from the s2r_backend_test_preview table.
BackendProfilePreviewA record containing a subset of BackendProfileRecord fields that can be temporarily overridden for a single test run.
| Field | Type | Description |
|---|---|---|
endpointUrl | String | The backend SOAP endpoint URL. |
wsdlUrl | String | The URL of the backend's WSDL file. |
healthcheckUrl | String | The URL for backend health checks. |
hostHeader | String | A custom value for the Host HTTP header. |
authType | String | The authentication type (e.g., basic, bearer, none). |
secretRef | String | The source does not specify the usage of this field. |
mtlsSecretRef | String | The source does not specify the usage of this field. |
soapNamespace | String | The target namespace for SOAP messages. |
soapVersion | String | The SOAP version to use (1.1 or 1.2). |
connectionTimeoutMs | Integer | Timeout in milliseconds for establishing a connection. |
readTimeoutMs | Integer | The source does not specify the usage of this field. |
retryCount | Integer | The number of times to retry a failed request. |
retryBackoffMs | Integer | The delay in milliseconds between retries. |
routingPriority | Integer | The priority for routing decisions. |
routingWeight | Integer | The weight for routing decisions. |
OperationPreviewA record containing a subset of OperationRecord fields that can be temporarily overridden for a single test run.
| Field | Type | Description |
|---|---|---|
operationId | UUID | The ID of the operation these settings apply to. |
restMethod | String | The REST HTTP method (e.g., GET, POST). |
restPath | String | The REST URL path. |
timeoutMs | Integer | Per-operation request timeout in milliseconds. |
retryCount | Integer | Per-operation retry count. |
executionMode | String | The source does not specify the usage of this field. |
callbackPath | String | The source does not specify the usage of this field. |
callbackAuthMode | String | The source does not specify the usage of this field. |
callbackSecretRef | String | The source does not specify the usage of this field. |
asyncAckHttpStatus | Integer | The source does not specify the usage of this field. |
When a test run fails, the overallStatus will be failed and the failureReason field will contain an error message. Common failure scenarios include:
| Failure Reason | Cause |
|---|---|
backend profile not found | The provided profileId does not exist. |
operation not found | The provided operationId does not exist. |
operation does not belong to backend profile service | The specified operation is part of a different service than the one associated with the backend profile. |
unsupported requestFormat: <format> | An invalid value was provided for the requestFormat parameter. |
SOAP envelope request body is required | The requestFormat was soap-envelope but the requestBody was empty. |
credentials... are required for auth_type=<type> | The backend profile is configured for an authType like basic or bearer, but the required credentials have not been set. |
The preview endpoint URL or Host header differs... | A preview test attempted to use saved credentials with a different endpointUrl or hostHeader than what is saved in the backend profile. This is a security protection. |
connectivity check failed: <reason> | The service could not establish a TCP connection to the backend host and port, often due to network firewall rules or an incorrect address. |
backend accepted the request but did not respond within <N>ms... | An HttpTimeoutException occurred. The request was sent, but the backend did not send a response within the configured timeout. This typically indicates a slow or hung process on the backend. |
failed to parse SOAP response: <reason> | The backend returned a response, but it was not well-formed XML or did not conform to the expected SOAP structure. |
SOAP backend fault | The backend returned a valid SOAP message containing a <soap:Fault> element, indicating a server-side processing error. The restResponsePreview.error.details field will contain the fault details. |
generated sample unavailable... | A generated sample test was run for an operation that does not have a saved request contract schema. |