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.
Constructor resolves EnvironmentConfigKeys.FaxSoapServiceUrl and EnvironmentConfigKeys.FaxTempStorageFolder, constructs FaxServiceProxy and a FileService (BR-WCF-002, BR-WCF-019).
Enforce.ArgumentNotNull(config) and Enforce.ArgumentNotNull(config.Recipients) (BR-WCF-020).
On failure: ArgumentNullException, logged and surfaced as a generic SOAP fault.
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).
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.
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).
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.
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.
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
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.