Skip to content

Send a fax

FaxServiceProxy.SendFax wraps the Fax SOAP service (FaxServiceSoapClient) to send a file, identified only by its local path, to a fax recipient over a Windows-authenticated transport.

Field Value
Operation ID OP-WP-03
Trigger Services/SAIF.Services.WCF/Services/FaxService.cs:42 (non-eligible in this run), or package consumers
Inputs FaxRecipient message, string fullFilePath
Outputs None; the call is fire-and-forget
Primary components FaxServiceProxy.SendFax
Entry point Services/SAIF.Services.Web.Proxies/FaxServiceProxy.cs

Steps

  1. Construct FaxServiceProxy(serviceUrl): guard serviceUrl (WP-BR-001), then build BasicHttpBinding(TransportCredentialOnly) with HttpClientCredentialType.Windows and int.MaxValue quotas (WP-BR-010).
  2. SendFax(message, fullFilePath):
  3. Build a wire FaxInfo with Attachment = fullFilePath (a file path, not file content), ToFaxNumber = message.FaxNumber, and ToName = message.RecipientName.
    • On failure: there is no null guard on message; CA1062 is suppressed, so a null message throws NullReferenceException.
  4. Call wire Send(faxInfo). Nothing is returned; the operation is fire-and-forget.

Process flow

The following diagram visualizes the fax send path.

flowchart TD
    Start([SendFax invoked]) --> Guard{"message not null?"}
    Guard -->|No| Fail([NullReferenceException])
    Guard -->|Yes| Build["Build wire FaxInfo<br>(Attachment = file path)"]
    Build --> Send["Call wire Send(faxInfo)"]
    Send --> Ret(["Return; no result"])

Failure and edge-case behavior

  • A null/empty serviceUrl at construction throws an argument exception before any wire client is created.
  • A null message throws NullReferenceException, because the caller-supplied argument is not guarded (CA1062 suppressed).
  • The remote fax service receives only a file path; the file's existence and readability at send time are the remote service's responsibility, not this wrapper's.

Sources

  • Services/SAIF.Services.Web.Proxies/FaxServiceProxy.cs