This page captures the framework/behavioral contract rules enforced by this library. SAIF.Web.API.Clients.35 is an infrastructure library; the rules below govern HTTP client behavior (identity propagation, authentication, retry, serialization, and error translation), not SAIF insurance-domain business logic. No domain-specific rule was found in the compiled scope. All rules apply identically to the linked source shared with SAIF.Web.API.Clients, subject to the dormant/retired build status described in Overview.
When acting on behalf of an interactive user, the domainless user name is forwarded.
Trigger
SetOnBehalfOfUserHeaders == true.
Enforcement
JsonHttpClient.GetJsonResponse adds an OnBehalfOfUser header sourced from HttpContext.Current.DomainlessUser().
Outcome
The OnBehalfOfUser header is added to the request. In this .35 project, Extensions/HttpContextExtensions.cs is excluded from compilation and System.Web is not referenced, so this path has no compilable implementation here.*
Source
src/SAIF.Web.API.Clients/JsonHttpClient.cs, src/SAIF.Web.API.Clients/Extensions/HttpContextExtensions.cs (excluded from this project)
A cast failure on a complex result yields default(T) rather than an exception.
Trigger
InvalidCastException thrown while extracting the first element of the deserialized content array.
Enforcement
JsonHttpClient.GetResult<T>.
Outcome
The caller receives default(T) instead of an unhandled exception. An empty result array raises IndexOutOfRangeException instead, since only InvalidCastException is caught.*
Error text is sourced from the response body when present. When the body is blank, GetContent's nested condition checks do not implement a simple "prefer ErrorMessage, else ErrorException, else status line" precedence: a nonblank ErrorMessage with a null ErrorException falls through to an empty string; a blank ErrorMessage with a non-null ErrorException returns the blank ErrorMessage (not the exception text); only when both ErrorMessage is nonblank and ErrorException is non-null does the method return ErrorException.Message. The synthesized status line is used only when both ErrorMessage and ErrorException are absent and the status is not 400.
Trigger
Error mapping, when response.Content is null/whitespace.
Enforcement
ExceptionHandler.GetContent: if (!Content.IsNullOrWhiteSpace()) return Content; else if (!ErrorMessage.IsNullOrWhiteSpace() \|\| ErrorException != null) { if (ErrorMessage.IsNullOrWhiteSpace()) return ErrorMessage; else if (ErrorException != null) return ErrorException.Message; } else if (StatusCode != BadRequest) return "{code} - {StatusDescription}"; return string.Empty; using SAIF.Common.Extensions.IsNullOrWhiteSpace from SAIF.Framework.Common.
Outcome
Body present → body text. Body blank, ErrorMessage nonblank + ErrorException null → string.Empty (not ErrorMessage). Body blank, ErrorMessage blank + ErrorException non-null → blank ErrorMessage (not ErrorException.Message). Body blank, both present → ErrorException.Message. Body blank, both absent → status line unless status is 400, otherwise string.Empty.
Constraint/defect
The inner branch order in GetContent appears inverted relative to its evident intent (prefer ErrorMessage, else fall back to ErrorException.Message): as written, a lone nonblank ErrorMessage is discarded and a lone ErrorException is also discarded in favor of the blank ErrorMessage. This is documented as observed, verified behavior of the current implementation, not its apparent designed intent.
This is an infrastructure library; the rules above are framework/behavioral contract rules, not SAIF insurance-domain business rules. No domain-specific rule was found in the compiled scope.
Note: Statements marked with * were inferred from code structure, naming conventions, or
contextual evidence where direct confirmation was not available in source artifacts.