Loading…
Loading…
Explains the S2R-ADM-0612 error, which occurs when a WSDL's example values fail validation against their own XSD constraints during import.
The WsdlContractValidationException is a runtime exception that signals an inconsistency found within a WSDL contract during the service creation process. It is thrown by the WsdlContractRoundTripValidator when an example value for a field does not conform to the validation rules (such as an XSD pattern or data type) defined for that same field in the schema.
This exception carries the error code S2R-ADM-0612.
The primary purpose of this exception is to detect and report self-contradictory definitions in a WSDL/XSD. For example, if a field is defined with a regular expression pattern that requires a 5-digit number, but its own declared default or example value is "abc", this validation will fail.
The exception provides detailed, structured information about each failure, enabling both automated processing by administrative UIs and clear, actionable guidance for the API publisher who needs to correct the source WSDL.
When an API publisher provides a WSDL to create a new service, the platform performs a round-trip validation to ensure the contract is internally consistent.
flowchart TD
subgraph Service Creation
A[API Publisher imports WSDL] --> B(WSDL Round-Trip Validator)
B --> C{For each scalar field...}
C --> D[Get or generate example value]
D --> E{Validate value against field's XSD constraints}
E -- Validation Fails --> F[Create `Violation` record]
F --> G{Any violations found?}
E -- Validation Succeeds --> C
G -- No --> L[Service workspace created successfully]
C -- All fields checked --> G
G -- Yes --> H{Is validation configured as blocking?}
H -- Yes --> I[Throw `WsdlContractValidationException`]
I --> J[Fail with error S2R-ADM-0612]
J --> K[Service workspace NOT created]
H -- No --> M[Attach violation details as warnings]
M --> L
endThe validation flow is as follows:
WsdlContractRoundTripValidator processes the WSDL and its associated schemas.default or example from the XSD, or it may be generated by the platform if none is provided.xsdType) or any regular expression pattern facet.Violation record is created containing details of the failure.WsdlContractValidationException is thrown, which halts the service creation process. The API response will contain the error code S2R-ADM-0612 and a structured details object.NOTE
By default, a validation failure for a field's example value is treated as a non-blocking warning. The service workspace is created, and the service is usable. However, API publishers should review and correct these warnings before the service is used in a production environment.
When this validation fails, the details are returned in a structured format within the API response. If the error is blocking, the details appear in the error.details object. If it is a non-blocking warning, a similar structure is included elsewhere in the successful response.
The payload contains a list of all violations found. Each violation includes the location of the field, the problematic value, the constraint it failed, and human-readable guidance on how to fix it.
Below is an example of the structured details returned for two violations. This structure is used for both blocking errors and non-blocking warnings.
{
"code": "S2R-ADM-0612",
"warningCount": 2,
"message": "Service workspace prepared. 2 fields' example values do not match their required formats — the service is usable, but review the field mapping before going live. See the per-field guidance below:\n • operation 'getUser' (request) field '$.user.zipCode': example value 'ABC' must match pattern [0-9]{5} (string) — Value 'ABC' does not match pattern '[0-9]{5}'\n • operation 'getUser' (response) field '$.user.id': example value 'not-a-number' is invalid — 'not-a-number' is not a valid 'integer' value",
"warnings": [
{
"operation": "getUser",
"surface": "request",
"fieldPath": "$.user.zipCode",
"exampleValue": "ABC",
"pattern": "[0-9]{5}",
"xsdType": "string",
"reason": "Value 'ABC' does not match pattern '[0-9]{5}'",
"guidance": "This field requires its value to match the format [0-9]{5}. Check the field's definition in the source XSD: either the example/default value declared there does not match this pattern, or the pattern is too strict. Adjust whichever is wrong, then re-import the WSDL. If the XSD looks correct, this is likely a platform example-generation issue — report it to support with the operation and field name above."
},
{
"operation": "getUser",
"surface": "response",
"fieldPath": "$.user.id",
"exampleValue": "not-a-number",
"xsdType": "integer",
"reason": "'not-a-number' is not a valid 'integer' value",
"guidance": "The example value for this field is not a valid integer value. If the source XSD declares an explicit example/default for this field, correct it there and re-import. Otherwise this is a platform example-generation issue — report it to support with the operation and field name above (the field's WSDL type definition does not need to change)."
}
]
}
The structured details payload contains the following fields.
When returned as a blocking error, the error.details object contains these fields.
| Field | Type | Description |
|---|---|---|
violationCount | number | The total number of validation violations found. |
violations | array | An array of violation detail objects, described below. |
When returned as a non-blocking warning, the payload contains these fields.
| Field | Type | Description |
|---|---|---|
code | string | The error code S2R-ADM-0612. |
warningCount | number | The total number of validation warnings found. |
message | string | A human-readable summary of the warnings. |
warnings | array | An array of warning detail objects, with the same structure as violations. |
Each object in the violations or warnings array has the following structure.
| Field | Type | Description |
|---|---|---|
operation | string | The name of the SOAP operation where the field is located. |
surface | string | Indicates whether the field is in the "request" or "response" message. |
fieldPath | string | The JSONPath to the offending field within the message structure. |
exampleValue | string | The generated or declared example value that failed validation. The value may be truncated. |
pattern | string | The XSD regular expression pattern the value was required to match. This field is absent if the field has no pattern facet. |
xsdType | string | The field's underlying XSD type (e.g., string, integer). This field is absent if the type is not available. |
reason | string | A concise, technical explanation of why the validation failed, typically from the underlying runtime mapper. |
guidance | string | A detailed, human-readable explanation of the problem and concrete steps for the API publisher to resolve it. See Troubleshooting section. |
When you encounter the S2R-ADM-0612 error or warning, it indicates a mismatch between a field's example value and its own constraints within the WSDL/XSD. Use the guidance provided for each violation to determine the fix.
There are two primary causes, which can be distinguished by the presence of the pattern field in the violation details.
patternThis is the most common cause. The field's example value does not match the regular expression defined in its XSD pattern facet.
To resolve:
exampleValue from the error details with the pattern.example or default value for the field, and that value is wrong, correct it to match the pattern.pattern is too strict or incorrect for the intended values, adjust the regular expression.patternThe failure is due to a base data type mismatch. For example, the value "text" was provided for a field of type integer.
To resolve:
example or default for this field. If it does, it is likely invalid for the field's xsdType. Correct the value in the XSD and re-import.xsdType. The field's type definition in the WSDL does not need to be changed.WsdlContractRoundTripValidator: The component responsible for performing this validation and throwing the exception.