Skip to content

Create a new web context

Create a brand-new web context via the remote WCF service and cache it in session. Trigger: BR-04 cross-application arrival referenced by OP-01 step 6, or Get(contextId) on cache miss.

Field Value
Operation ID OP-03
Trigger BR-04 cross-application arrival referenced by OP-01 step 6, or Get(contextId) on cache miss
Inputs Optional context id; serviceUrl from session key ContextServiceUrl
Outputs IWebContext; session cache updated
Primary components WebContextService.Get() calling private CreateContext(string contextId = null)
Entry point src/Web/WebContextService.cs

Steps

  1. Open a WebContextServiceClient over BasicHttpBinding at serviceUrl inside a using block (channel disposed on exit).
  2. Call Channel.CreateContext(contextId) on the remote WCF IWebContextService — the remote implementation is not part of this repository.**
  3. items.UpdateOrAdd(context.ContextId, context) — store the returned context in the session-backed dictionary under session key WebContextRepository (BR-09).
  4. Return the context.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Trigger])
    Open[Open WebContextServiceClient]
    Call[Channel.CreateContext]
    Cache[Cache in session under WebContextRepository]
    EndOk([Return context])
    Start --> Open
    Open --> Call
    Call --> Cache
    Cache --> EndOk

Failure and edge-case behavior

  • No unexpected failure paths beyond argument-guard exceptions and delegated dependency behavior were identified for 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/Web/WebContextService.cs
  • src/Web/WebContextServiceClient.cs