Skip to content

OP-010: Replace the stored web context for an application and session

Save is invoked over the WebContext route on SAIF.Services.WCF.Services.WebContextService; this page documents the process end to end, from route dispatch to the message the caller receives.

Field Value
Operation ID OP-010
Trigger Caller invokes Save over the WebContext route.
Entry operation Save
Owning component SAIF.Services.WCF.Services.WebContextService.Save
Inputs Request message parts listed below
Outputs No response payload (void)
Failure behavior Generic SOAP fault, per Faults and error pipeline

Request and response

Direction Element Type Declared in Notes
Request applicationName string BCL (System) Application name portion of the context key. (Yes)
Request sessionId string BCL (System) Session id portion of the context key. (Yes)
Request context IWebContext External contracts assembly (SAIF.Services.WCF.Contracts / framework closure) ** The context whose entries are persisted. (Yes)
Response void void n/a (void) Not applicable.

Steps

  1. Enforce.ArgumentNotNullOrEmpty on applicationName and sessionId, Enforce.ArgumentNotNull on context (BR-WCF-014).
  2. On failure: ArgumentNullException, logged and surfaced as a generic SOAP fault.
  3. unitOfWork.Begin().
  4. Query and Delete every existing WebContextItem for the application and session (BR-WCF-017).
  5. Add one WebContextItem per entry returned by context.GetAll(), stamping UpdateDate = DateTime.Now (BR-WCF-011).
  6. unitOfWork.Commit().
  7. On failure: logged by the installed error handler, surfaced as a generic SOAP fault, and rolled back on Dispose.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Validate applicationName, sessionId,<br>and context"]
    B["unitOfWork.Begin()."]
    C["Delete existing context items<br>for application and session"]
    D["Add new context items from<br>context.GetAll()"]
    E["unitOfWork.Commit()."]
    A --> B
    B --> C
    C --> D
    D --> E

Transaction and side effects

Aspect Finding
Unit of work SqlServerUnitOfWorkFactory (NETFRAMEWORK/APPM)
Commit point unitOfWork.Commit() after the delete-then-insert sequence
Records written WebContextItem (delete all, then insert)
Downstream calls None
Shared state touched None
Repeat-call behavior Idempotent — replaces the full stored set each time

Logging

Surface Written content
ErrorLogErrorHandler → LogService Failure-path exception logging only, carrying method signature, calling user and exception detail; see Faults and error pipeline

Faults and error handling

Failure Fault type the caller receives Produced by Source
ArgumentNullException Generic SOAP fault The operation itself, via Enforce src/WCF/SAIF.Services.WCF.Host/Services/WebContextService.cs
SQL Server/NHibernate exception Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/WebContextService.cs

Authorization

Requirement Enforced by Source Applies to
None in code IIS authentication on the deployment (see Activation and hosting) src/WCF/SAIF.Services.WCF.Host/Services/WebContextService.cs This operation

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • src/WCF/SAIF.Services.WCF.Host/Services/WebContextService.cs