Skip to content

OP-001: Read a byte range from a caller-supplied path

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

Field Value
Operation ID OP-001
Trigger Caller invokes ReadFile over the FileService route.
Entry operation ReadFile
Owning component SAIF.Services.WCF.Services.FileService.ReadFile
Inputs Request message parts listed below
Outputs The requested byte range from the file at path.
Failure behavior Generic SOAP fault, per Faults and error pipeline

Request and response

Direction Element Type Declared in Notes
Request path string BCL (System) Absolute or relative filesystem path to read; not validated or constrained. (Yes)
Request byteLength int BCL (System) Number of bytes to allocate and read into the returned buffer. (Yes)
Response byte[] byte[] BCL (System) The requested byte range from the file at path.

Steps

  1. Allocate new byte[byteLength] with no validation of byteLength against the real file length, so a byteLength larger than the file yields a trailing run of zero bytes and a byteLength of zero yields an empty array (BR-WCF-003).
  2. Call File.OpenRead(path).Read(result, 0, byteLength) directly against the caller-supplied path with no canonicalization, containment check, or authorization; the stream is not disposed and the return value of Read is discarded (BR-WCF-004).
  3. On failure: a filesystem exception (IOException, UnauthorizedAccessException, FileNotFoundException) is logged by the installed error handler and surfaced to the caller as a generic SOAP fault with exception detail included.
  4. Return the buffer.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Allocate fixed-length buffer"]
    B["Read byte range from file into buffer"]
    C["Return the buffer."]
    A --> B
    B --> C

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 None
Shared state touched None
Repeat-call behavior Re-reads the same bytes; no state is mutated

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
Filesystem exception (IOException, UnauthorizedAccessException, FileNotFoundException) 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/FileService.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/FileService.cs