Skip to content

OP-014: Stage a document and dispatch it to each fax recipient

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

Field Value
Operation ID OP-014
Trigger Caller invokes SendFax over the Fax route.
Entry operation SendFax
Owning component SAIF.Services.WCF.Services.FaxService.SendFax
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 config SAIF.Core.Services.Documents.FaxConfig External contracts assembly (SAIF.Services.WCF.Contracts / framework closure) ** Fax request carrying the document bytes and the recipient collection. (Yes)
Response void void n/a (void) Not applicable.

Steps

  1. Constructor resolves EnvironmentConfigKeys.FaxSoapServiceUrl and EnvironmentConfigKeys.FaxTempStorageFolder, constructs FaxServiceProxy and a FileService (BR-WCF-002, BR-WCF-019).
  2. Enforce.ArgumentNotNull(config) and Enforce.ArgumentNotNull(config.Recipients) (BR-WCF-020).
  3. On failure: ArgumentNullException, logged and surfaced as a generic SOAP fault.
  4. Generate a GUID file name and concatenate it onto the configured temp folder, assuming the folder ends in a separator rather than using Path.Combine (BR-WCF-021).
  5. Delegate to FileService.WriteFile to materialize config.File at that path (BR-WCF-004).

    Origin: This step is implemented in WriteFile and executed within this operation.

  6. For each recipient in config.Recipients, call FaxServiceProxy.SendFax(recipient, fullFilePath), which builds a FaxInfo (Attachment, ToFaxNumber, ToName) and invokes the Legacy.Fax Send operation over BasicHttpBinding with TransportCredentialOnly/Windows (BR-WCF-022).
  7. On failure mid-loop: the downstream FaultException/CommunicationException/TimeoutException propagates, is logged by the installed error handler, and is surfaced as a generic SOAP fault; recipients already sent are not compensated.
  8. Delegate to FileService.DeleteFile to remove the temporary file; because this is not in a finally, a fault at the previous step leaves the file behind (BR-WCF-021).

    Origin: This step is implemented in DeleteFile and executed within this operation.

  9. Return.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Resolve fax config and<br>construct FaxServiceProxy/FileService"]
    B["Validate config and recipients"]
    C["Generate temp file path"]
    D["Write document to temp file"]
    E["Send fax to each recipient"]
    F["Delete temp file"]
    G["Return."]
    A --> B
    B --> C
    C --> D
    D --> E
    E --> F
    F --> G

Transaction and side effects

Aspect Finding
Unit of work None
Commit point Not applicable — no unit of work is opened
Records written None
Downstream calls Legacy.Fax SOAP service (one call per recipient) — see Dependencies
Shared state touched None
Repeat-call behavior Each call restages and redispatches the fax; not idempotent, and a duplicate call resends to every recipient

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/FaxService.cs
FaultException/CommunicationException/TimeoutException from Legacy.Fax Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/LegacyProxies/FaxServiceProxy.cs
Filesystem exception staging or removing the temp file Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/FileService.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/FaxService.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/FaxService.cs
  • src/WCF/SAIF.Services.WCF.Host/Services/FileService.cs
  • src/WCF/SAIF.Services.WCF.Host/Services/LegacyProxies/FaxServiceProxy.cs