Skip to content

OP-008: Resolve a user's default printer from Active Directory

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

Field Value
Operation ID OP-008
Trigger Caller invokes GetDefaultPrinter over the PreferenceService route.
Entry operation GetDefaultPrinter
Owning component SAIF.Services.WCF.Services.PreferenceService.GetDefaultPrinter
Inputs Request message parts listed below
Outputs The AD extensionAttribute2 value for the SAIF-domain principal matching user.
Failure behavior Generic SOAP fault, per Faults and error pipeline

Request and response

Direction Element Type Declared in Notes
Request user string BCL (System) User whose default printer is requested. (Yes)
Response string string BCL (System) The AD extensionAttribute2 value for the SAIF-domain principal matching user.

Steps

  1. Open a PrincipalContext(ContextType.Domain, SaifUserPrincipal.DOMAIN) where DOMAIN is the constant "SAIF".
  2. SaifUserPrincipal.FindByIdentity(context, user); a null principal returns string.Empty (BR-WCF-012).
  3. Otherwise return principal.DefaultPrinter, backed by the AD attribute extensionAttribute2 (BR-WCF-013).
  4. On failure: a directory exception is logged by the installed error handler and surfaced as a generic SOAP fault with exception detail included.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Open PrincipalContext for<br>SAIF domain"]
    B["SaifUserPrincipal.FindByIdentity(context, user)"]
    B1{"Principal found?"}
    B2["Null principal: return string.Empty"]
    C["Return DefaultPrinter from<br>AD extensionAttribute2"]
    A --> B
    B --> B1
    B1 -->|"No"| B2
    B1 -->|"Yes"| C

Transaction and side effects

Aspect Finding
Unit of work None
Commit point Not applicable
Records written None
Downstream calls Active Directory (SAIF domain)
Shared state touched None
Repeat-call behavior Idempotent read

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
Directory exception Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/Security/SaifUserPrincipal.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/PreferenceService.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/PreferenceService.cs
  • src/WCF/SAIF.Services.WCF.Host/Services/Security/SaifUserPrincipal.cs