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¶
- Open a
WebContextServiceClientoverBasicHttpBindingatserviceUrlinside ausingblock (channel disposed on exit). - Call
Channel.CreateContext(contextId)on the remote WCFIWebContextService— the remote implementation is not part of this repository.** items.UpdateOrAdd(context.ContextId, context)— store the returned context in the session-backed dictionary under session keyWebContextRepository(BR-09).- 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.
Related documentation¶
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.cssrc/Web/WebContextServiceClient.cs